0

I'm trying to create a script to check if my router's IP to MAC address has changed from the view of my computer. Basically trying to check if a MITM attack is taking place. I cannot get this to work; the IP 172.16.213.254 is my gateway IP.

arp -a 172.16.213.254 | cut -d" " -f 4 >> routersmac.txt
if [[ cat routersmac.txt = "00:01:32:23:23:23"]]
then
  echo "You are safe"
else
  echo "MITM in progress"
fi
Cyrus
  • 84,225
  • 14
  • 89
  • 153
user001
  • 19
  • 3

1 Answers1

0

Simplifying:

arp -a 172.16.213.254 | awk '{if ("00:01:32:23:23:23"==$4) print "OK"; else print "Bad"}'
John1024
  • 109,961
  • 14
  • 137
  • 171