Skip to content

Instantly share code, notes, and snippets.

@fyoorer
Created July 9, 2013 05:33
Show Gist options
  • Save fyoorer/5954944 to your computer and use it in GitHub Desktop.
Save fyoorer/5954944 to your computer and use it in GitHub Desktop.
Simple shell script to check injection on a given AP.
#!/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