DsdL schrieb:
... Frage, was soll ich denn mit den patches anstellen? Soll der 200_arpspoof_c.patch beispielsweise einfach die arpspoof.c im Installationsordner ersetzen? Das funktioniert nämlich nicht, und ich sehe auch nicht was ich da anpassen müsste..
Die patches kannst Du (aus dem richtigen Verzeichnis bzw. mit der richtigen Option; siehe die manpage für patch) ausführen. Z. B. hier nur als Test:
$ cp arpspoof.c arpspoof1.c
$ patch -p0 < 200_arpspoof_c.patch
patching file arpspoof.c
$ diff arpspoof1.c arpspoof1.c
$ diff arpspoof.c arpspoof1.c
17d16
< #include <netinet/if_ether.h>
29c28
< //extern char *ether_ntoa(struct ether_addr *);
---
> extern char *ether_ntoa(struct ether_addr *);
31c30
< static libnet_t *l;
---
> static struct libnet_link_int *llif;
45,46c44,45
< arp_send(libnet_t *l, int op, u_int8_t *sha,
< in_addr_t spa, u_int8_t *tha, in_addr_t tpa)
---
> arp_send(struct libnet_link_int *llif, char *dev,
> int op, u_char *sha, in_addr_t spa, u_char *tha, in_addr_t tpa)
48,49c47,49
< int retval;
<
---
> char ebuf[128];
> u_char pkt[60];
>
51c51
< (sha = (u_int8_t *)libnet_get_hwaddr(l)) == NULL) {
---
> (sha = (u_char *)libnet_get_hwaddr(llif, dev, ebuf)) == NULL) {
55c55
< if ((spa = libnet_get_ipaddr4(l)) == -1)
---
> if ((spa = libnet_get_ipaddr(llif, dev, ebuf)) == 0)
56a57
> spa = htonl(spa); /* XXX */
61,63c62
< libnet_autobuild_arp(op, sha, (u_int8_t *)&spa,
< tha, (u_int8_t *)&tpa, l);
< libnet_build_ethernet(tha, sha, ETHERTYPE_ARP, NULL, 0, l, 0);
---
> libnet_build_ethernet(tha, sha, ETHERTYPE_ARP, NULL, 0, pkt);
64a64,67
> libnet_build_arp(ARPHRD_ETHER, ETHERTYPE_IP, ETHER_ADDR_LEN, 4,
> op, sha, (u_char *)&spa, tha, (u_char *)&tpa,
> NULL, 0, pkt + ETH_H);
>
71,72c74,75
< libnet_addr2name4(tpa, LIBNET_DONT_RESOLVE),
< libnet_addr2name4(spa, LIBNET_DONT_RESOLVE));
---
> libnet_host_lookup(tpa, 0),
> libnet_host_lookup(spa, 0));
77c80
< libnet_addr2name4(spa, LIBNET_DONT_RESOLVE));
---
> libnet_host_lookup(spa, 0));
81,87c84
< retval = libnet_write(l);
< if (retval)
< fprintf(stderr, "%s", libnet_geterror(l));
<
< libnet_clear_packet(l);
<
< return retval;
---
> return (libnet_write_link_layer(llif, dev, pkt, sizeof(pkt)) == sizeof(pkt));
125c122
< arp_send(l, ARPOP_REQUEST, NULL, 0, NULL, ip);
---
> arp_send(llif, intf, ARPOP_REQUEST, NULL, 0, NULL, ip);
142,144c139,141
< arp_send(l, ARPOP_REPLY,
< (u_int8_t *)&spoof_mac, spoof_ip,
< (target_ip ? (u_int8_t *)&target_mac : NULL),
---
> arp_send(llif, intf, ARPOP_REPLY,
> (u_char *)&spoof_mac, spoof_ip,
> (target_ip ? (u_char *)&target_mac : NULL),
157,158c154
< char pcap_ebuf[PCAP_ERRBUF_SIZE];
< char libnet_ebuf[LIBNET_ERRBUF_SIZE];
---
> char ebuf[PCAP_ERRBUF_SIZE];
170c166
< if ((target_ip = libnet_name2addr4(l, optarg, LIBNET_RESOLVE)) == -1)
---
> if ((target_ip = libnet_name_resolve(optarg, 1)) == -1)
183c179
< if ((spoof_ip = libnet_name2addr4(l, argv[0], LIBNET_RESOLVE)) == -1)
---
> if ((spoof_ip = libnet_name_resolve(argv[0], 1)) == -1)
186,187c182,183
< if (intf == NULL && (intf = pcap_lookupdev(pcap_ebuf)) == NULL)
< errx(1, "%s", pcap_ebuf);
---
> if (intf == NULL && (intf = pcap_lookupdev(ebuf)) == NULL)
> errx(1, "%s", ebuf);
189,190c185,186
< if ((l = libnet_init(LIBNET_LINK, intf, libnet_ebuf)) == NULL)
< errx(1, "%s", libnet_ebuf);
---
> if ((llif = libnet_open_link_interface(intf, ebuf)) == 0)
> errx(1, "%s", ebuf);
194c190
< libnet_addr2name4(target_ip, LIBNET_DONT_RESOLVE));
---
> libnet_host_lookup(target_ip, 0));
201,202c197,198
< arp_send(l, ARPOP_REPLY, NULL, spoof_ip,
< (target_ip ? (u_int8_t *)&target_mac : NULL),
---
> arp_send(llif, intf, ARPOP_REPLY, NULL, spoof_ip,
> (target_ip ? (u_char *)&target_mac : NULL),
EDIT:
Wenn Du den Inhalt des patches verstehst, dann kannst Du die source code-Datei, auch mit einem Editor, manuell ändern.