summaryrefslogtreecommitdiffstats
path: root/spoof.sh
diff options
Diffstat (limited to 'spoof.sh')
-rwxr-xr-xspoof.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/spoof.sh b/spoof.sh
new file mode 100755
index 0000000..bfb2df5
--- /dev/null
+++ b/spoof.sh
@@ -0,0 +1,20 @@
+if [[ $UID != 0 ]]; then
+ echo "You must be root."
+ exit -1
+fi
+if [[ $# -ne 4 ]]; then
+ echo "Usage: $0 ip netmask gateway mac."
+ exit -1
+fi
+
+systemctl stop dhcpcd.service
+systemctl stop wpa_supplicant.service
+ifconfig wlan0 down
+macchanger -m $4 wlan0
+ifconfig wlan0 $1 netmask $2
+ip route del default
+ip route add default via $3
+echo nameserver 8.8.8.8 > /etc/resolv.conf
+echo nameserver 8.8.4.4 >> /etc/resolv.conf
+ifconfig wlan0 up
+systemctl start wpa_supplicant@wlan0.service