diff --git a/Makefile b/Makefile index 6bc6f1c..92e1215 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CC=clang -CFLAGS=-g -Wall -DDEBUG +CFLAGS=-g -Wall +LDFLAGS=-lpthread .PHONY: clean all diff --git a/arp.h b/arp.h index 49dbf39..e6f6b87 100644 --- a/arp.h +++ b/arp.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/arp_mitm.c b/arp_mitm.c index f49521e..727baa1 100644 --- a/arp_mitm.c +++ b/arp_mitm.c @@ -161,6 +161,20 @@ int main(int argc, char **argv) macaddr2[0],macaddr2[1],macaddr2[2], macaddr2[3],macaddr2[4],macaddr2[5]); + + struct args args; + memcpy(args.macaddr1, macaddr1, sizeof(*macaddr1)); + memcpy(args.macaddr2, macaddr2, sizeof(*macaddr2)); + memcpy(&args.ip_addr1, ipaddr1, sizeof(*ipaddr1)); + memcpy(&args.ip_addr2, ipaddr2, sizeof(*ipaddr2)); + + pthread_t thread; + if (pthread_create(&thread, NULL, redirect_traffic, (void *)&args)) { + perror("[FAIL] pthread_create()"); + exit(EXIT_FAILURE); + } + + /* We send ARP requests and replies to both targets, impersonating the other. We use both requests and replies because some devices (linux > 2.4.x for example) don't update their ARP cache on