SRC SSDP Amp Scanner Source

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

Кто прочитал эту тему (Всего: 0) за последние 1 часов Посмотреть детально

    Кто просматривал эту тему (Всего: 0, Пользователей: 0, Гостей: 0)

      Кто отслеживал эту тему (Всего: 1) Посмотреть детально

      Похожие темы

      Ответы
      0
      Визитов
      83
      Ответы
      0
      Визитов
      73
      Ответы
      0
      Визитов
      74
      Ответы
      5
      Визитов
      242
      Ответы
      0
      Визитов
      115
      Ответы
      0
      Визитов
      107
      Назад
      Сверху