Last active
October 9, 2017 06:35
-
-
Save cryptolok/b9b1ed6e8f91b17d53ef5d3d7d0c17a9 to your computer and use it in GitHub Desktop.
ultimate, simple and minimalistic UNIX ARP-MITM protection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ultimate, simple and minimalistic UNIX ARP-MITM protection by making gateway hardware address static just after DHCP and automatically after interface start | |
# place in /etc/network/if-up.d/ARProtect | |
if [[ "$IFACE" != "lo" && "$MODE" = "start" && "$ADDRFAM" = *[N,n]et* ]] | |
then | |
IP_GATEWAY=$(ip route | grep default | grep $IFACE | cut -d ' ' -f 3) | |
MAC=$(ip neigh show $IP_GATEWAY | cut -d ' ' -f 5) | |
arp -s $IP_GATEWAY $MAC | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment