Created
July 9, 2013 05:33
-
-
Save fyoorer/5954944 to your computer and use it in GitHub Desktop.
Simple shell script to check injection on a given AP.
This file contains 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 | |
#syntax: checkinjection.sh -i IFACE -b BSSID -c CHANNEL | |
IFACE=$2 | |
BSSID=$4 | |
CHANNEL=$6 | |
sudo iwconfig $IFACE channel $CHANNEL | |
sleep 3 | |
INJ=$(aireplay-ng -9 -a $BSSID $IFACE | grep -A 2 "$BSSID" | tail -n 1 | cut -d " " -f 4 | tr "%" " ") | |
echo $INJ | |
if [ -z $INJ ] | |
then | |
echo "Injection is not working" | |
elif [ $INJ -eq 0 ] | |
then | |
echo "Injection is not working" | |
elif [ $INJ -gt 0 ] | |
then | |
echo "Injection is working" | |
else | |
echo "some error" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment