Created
July 29, 2013 20:24
-
-
Save albertoalcolea/6107478 to your computer and use it in GitHub Desktop.
ARP Spoofing Detector
This file contains hidden or 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 | |
# | |
# Version: 1.0 | |
# Date: 24-07-2013 | |
# Author: Alberto Alcolea ([email protected]) | |
# | |
PRIORITY="local0.alert" | |
icon="/home/alberto/.icons/elementary/actions/48/process-stop.svg" | |
prev='' | |
arp | while read ip hwtype mac flag iface | |
do | |
if [ ! $mac == 'HWaddress' ] | |
then | |
for a in $prev | |
do | |
if [ $(echo $a | cut -d'_' -f2) == $mac ] | |
then | |
ip2=$(echo $a | cut -d'_' -f1) | |
# echo "MAC duplicada: $ip - $ip2 [$mac]" | |
logger -p $PRIORITY "MAC duplicada: $ip - $ip2 [$mac]" > /dev/null 2> /dev/null | |
service network-manager stop | |
notify-send 'Detectado envenenamiento de tablas ARP' "$ip - $ip2\n[$mac]" -i $icon -u critical | |
fi | |
done | |
prev="$prev $ip"_"$mac" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment