Results 1 to 2 of 2

Thread: [tutorial] Build Our Own Tweaked Wep Cracking Script In Bash [tutorial]

  1. #1
    Senior Member shamanvirtuel's Avatar
    Join Date
    Mar 2010
    Location
    Somewhere in the "Ex" human right country
    Posts
    2,988

    Lightbulb [tutorial] Build Our Own Tweaked Wep Cracking Script In Bash [tutorial]

    as many person ask me to, i will try to give you a trail in order to develop your OWN TWEAKED WEP CRACKING SCRIPT............

    I choose Bash scripting language, because it's the easier one for begining coders....this guide is intended for unexperienced coders who want to learn and have phun at the same moment....it will be completely useless for an already skilled programmer.......

    LESSON 1 :

    TODAY WE WILL TALK ABOUT IDENTIFYING THE NEEDED PARAMETERS AND STORE THEM FOR FURTHER USAGE.......


    In order to build an attack system we need to get some parameters from the user, about victim network, the easier thing to do is to read them from stdin (standard input).

    We need also to know parameters for the attacking card we will use too, again we will choose and configure the net card via user inputs....

    Last thing is to param the attack process itself, it can be easily done via a little menu........

    When we will have finished this lesson 1, we will be able to launch the attack, but it's another story........
    SO LET'S GO :

    VICTIM NETWORK PARAMS NEEDED:
    AP ESSID, AP MAC ADRESS, AP CHANNEL,
    STATION MAC if one, if none we will use CARD MAC

    CARD PARAMS NEEDED:
    MAC ADRESS, NAME, CHANNEL, RATE

    ATTACK PARAMS NEEDED:
    WHICH ATTACK
    INJECTION RATE
    NUMBER OF DEAUTHS
    REASSOCIATION DELAY

    WE WILL BUILD EACH SETTING MODULE AND PUT THEM TOGATHER AT THE END

    1) List card and get the choice from user :

    we will list cards using ifconfig output :
    first thing is to rip all info we do not need :
    ifconfig -a | grep "Link encap:" | awk -F " " '{print $1}'
    ifconfig -a list all cards even non upped
    | grep "Link encap:" limit output to first line (list only lines containing "Link encap:")
    | awk -F " " '{print $1}' limit output to the first word
    so we get the first word of first line for each card ifconfig output.....
    Code:
    bt ~ # ifconfig -a | grep  "Link encap:" | awk -F " "  '{print $1}'
    eth0
    eth1
    lo
    rausb0
    we now present a menu to the user :
    we will use the read function to store selected card in a variable
    ifconfig -a | grep "Link encap:" | awk -F " " '{print $1}'
    echo
    read CARD
    clear && echo "CARD SELECTED : $CARD"
    Code:
    eth0
    eth1
    lo
    rausb0
    
    TYPE THE NAME OF YOUR SELECTED CARD
    rausb0
    
    CARD SELECTED : rausb0
    last thing is to get the mac of the card and save it with the name in a file for further use....
    macchanger will give us the mac:
    macchanger --show $CARD, but we don't need all text so we will rip like before with awk command
    macchanger --show rausb0 | awk -F " " '{print $3}' (only the mac, 3rd word in the output)
    we assign it directly to a variable like this
    MAC=$(macchanger --show $card | awk -F " " '{print $3}')
    next step is to store mac & name of card in a file
    echo "$CARD $MAC" > /tmp/attackcard
    Code:
    eth0
    eth1
    lo
    rausb0
    
    TYPE THE NAME OF YOUR SELECTED CARD
    rausb0
    
    CARD SELECTED rausb0 WITH THIS MAC : 00:18:f8:a4:de:b7
    2) get victim network parameter
    echo "VICTIM ESSID(add quotes if spaces or weird chrs name) :"
    read ESSID
    echo
    echo "VICTIM MAC"
    read VICTMAC
    echo
    echo "VICTIM CHANNEL :"
    read VICTCHAN
    echo "CLIENT MAC(if blank we will do clientless attacks)"
    read CLIMAC

    now we check if user provide a client :
    case $CLIMAC in
    "" ) echo "CLIENTLESS ATTACKS WILL BE DONE";CLI=0;;
    * ) echo "CLIENT ATTACKS WILL BE DONE";CLI=1;;
    esac

    case is the command for conditional instruction
    here if $CLIMAC is null then we show the clientless message , if not we show the client attack message.....
    we also set a flag for further use
    if we need clientless CLI=0
    if we do client attacks CLI=1
    Code:
    CLIENT MAC(if blank we will do clientless attacks)
    
    
    CLIENTLESS ATTACKS WILL BE DONE
    last thing is to save all inputs in a file
    echo $ESSID > /tmp/victim
    echo $VICTMAC >> /tmp/victim
    echo $VICTCHAN >> /tmp/victim
    echo $CLIMAC >> /tmp/victim
    echo $CLI >> /tmp/victim

    so lets finish this first part of the script :

    ifconfig -a | grep "Link encap:" | awk -F " " '{print $1}'
    echo
    echo "TYPE THE NAME OF YOUR SELECTED CARD"
    read CARD
    MAC=$(macchanger --show rausb0 | awk -F " " '{print $3}')
    echo "$CARD $MAC" > /tmp/attackcard
    echo
    echo "CARD SELECTED $CARD WITH THIS MAC : $MAC"
    echo
    echo "VICTIM ESSID(add quotes if spaces or weird chrs name) :"
    read ESSID
    echo
    echo "VICTIM MAC"
    read VICTMAC
    echo
    echo "VICTIM CHANNEL :"
    read VICTCHAN
    echo
    echo "CLIENT MAC(if blank we will do clientless attacks)"
    read CLIMAC
    echo
    case $CLIMAC in
    "" ) echo "CLIENTLESS ATTACKS WILL BE DONE";CLI=0;;
    * ) echo "CLIENT ATTACKS WILL BE DONE";CLI=1;;
    esac
    echo $ESSID > /tmp/victim
    echo $VICTMAC >> /tmp/victim
    echo $VICTCHAN >> /tmp/victim
    echo $CLIMAC >> /tmp/victim
    echo $CLI >> /tmp/victim

    and here is the output :
    Code:
    eth0
    eth1
    lo
    rausb0
    
    TYPE THE NAME OF YOUR SELECTED CARD
    rausb0
    
    CARD SELECTED rausb0 WITH THIS MAC : 00:18:f8:a4:de:b7
    
    VICTIM ESSID(add quotes if spaces or weird chrs name) :
    Livebox-a5a3
    
    VICTIM MAC
    00:1A:6B:04:9E:2F
    
    VICTIM CHANNEL :
    10
    
    CLIENT MAC(if blank we will do clientless attacks)
    00:1B:77:32:4E:EF
    
    CLIENT ATTACKS WILL BE DONE
    bt Desktop # cat /tmp/attackcard
    rausb0 00:18:f8:a4:de:b7
    bt Desktop # cat /tmp/victim
    Livebox-a5a3
    00:1A:6B:04:9E:2F
    10
    00:1B:77:32:4E:EF
    1
    FIRST LESSON FINISHED LIKE YOU SEE NOW WE GET ALL PARAMS FOR VICTIM & CARD, NEXT STEP IS SETTING UP THE ATTACK....STAY IN TOUCH FOR LESSON 2

    i hope it's clear, but you all know im french, and writing this crappy tut was not so easy for me
    Watch your back, your packetz will belong to me soon... xD

    BackTrack :
    Giving Machine Guns to Monkeys since 2006

  2. #2
    Very good friend of the forum drgr33n's Avatar
    Join Date
    Jan 2010
    Location
    Dark side of the moon ...
    Posts
    699

    Default

    Great tut shamanvirtuel thanks and you speak better english than me .......... And im english lol

Posting Permissions

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