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