summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-02-04 03:52:40 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2012-02-04 04:24:20 +0100
commit516917382ad3a2fa3dbe048e721c96215d5ab843 (patch)
treec7949408787f1324a07697f4a649d517f2c5d4ae
parentStrength testing. (diff)
downloadwifi-monitoring-scripts-516917382ad3a2fa3dbe048e721c96215d5ab843.tar.xz
wifi-monitoring-scripts-516917382ad3a2fa3dbe048e721c96215d5ab843.zip
Add reset module, spoofing convience script, and make normal do a reset instead of a start.
-rwxr-xr-xnormal.sh4
-rwxr-xr-xreset-module.sh15
-rwxr-xr-xspoof.sh20
3 files changed, 37 insertions, 2 deletions
diff --git a/normal.sh b/normal.sh
index 13970aa..29d36e3 100755
--- a/normal.sh
+++ b/normal.sh
@@ -4,5 +4,5 @@ if [[ $UID != 0 ]]; then
fi
ifconfig wlan0 down
ifconfig wlan0 up
-systemctl start dhcpcd.service
-systemctl start wpa_supplicant@wlan0.service
+systemctl restart dhcpcd.service
+systemctl restart wpa_supplicant@wlan0.service
diff --git a/reset-module.sh b/reset-module.sh
new file mode 100755
index 0000000..78845a3
--- /dev/null
+++ b/reset-module.sh
@@ -0,0 +1,15 @@
+if [[ $UID != 0 ]]; then
+ echo "You must be root."
+ exit -1
+fi
+ifconfig wlan0 down
+systemctl stop dhcpcd.service
+systemctl stop wpa_supplicant@wlan0.service
+rmmod ath9k
+rmmod ath9k_common
+rmmod ath9k_hw
+modprobe ath9k
+iwconfig wlan0 power on
+ifconfig wlan0 up
+systemctl restart dhcpcd.service
+systemctl restart wpa_supplicant@wlan0.service
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