Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- printf("%s %s (c) 2011 by %s %s\n\n", prg, VERSION, AUTHOR, RESOURCE);
- printf("Syntax: %s [-r] interface target-ip destination-ip\n\n", prg);
- printf("Randomly pings IPs in target network\n");
- // printf("Use -r to use raw mode.\n\n");
- exit(-1);
- }
- int main(int argc, char *argv[]) {
- char *interface = "eth1";
- int prefer = PREFER_GLOBAL;
- unsigned char *src6 = NULL;
- unsigned char *srcmac = NULL;
- unsigned char *dstmac = NULL;
- unsigned char *dst6 = "2001:8d8:fe20:100::1";
- int pkt_len = 0;
- int count = 0;
- int i;
- unsigned char *pkt = NULL;
- while (1) {
- count++;
- unsigned char ip6adr[256];
- sprintf(ip6adr, "2001:8d8:fe21:%x%x:%x%x:%x%x:%x%x:%x%x", rand() % 256, rand() % 256, rand() % 256, rand() % 256, rand() % 256, rand() % 256, rand() % 256, rand() % 256, rand() % 256, rand() % 256);
- dst6 = thc_resolve6(ip6adr);
- //thc_ping6(interface, src6, dst6, 16, 1);
- //thc_create_ipv6(interface, prefer, &my_ipv6_packet_len, src6, dst6, ttl, length, label, class, version);
- if ((pkt = thc_create_ipv6(interface, prefer, &pkt_len, src6, dst6, 255, 0, 0, 0 ,0)) == NULL)
- return -1;
- if (thc_generate_and_send_pkt(interface, NULL, NULL, pkt, &pkt_len) < 0) {
- fprintf(stderr, "Error sending packet no. %d on interface %s: ", count, interface);
- perror("");
- return -1;
- }
- thc_destroy_packet(pkt);
- usleep(100);
- if (count % 100 == 0)
- printf(".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement