This is bash script which provides multiple access point attack using reaver and BSSIDs list from a text file.
If processed AP reaches rate limit, script goes to another from the list, and so forth.
HOW IT WORKS ?
Script takes AP targets list from text file in following format
BSSID CHANNEL ESSID
For example:
And then following steps are being processed:Code:Select AllAA:BB:CC:DD:EE:FF 1 MyWlan 00:BB:CC:DD:EE:FF 13 TpLink 00:22:33:DD:EE:FF 13 MyHomeSSID
REQUIREMENTS
- Every line of list file is checked separately in for loop
- After every AP on the list once, script automatically changes MAC address of your card to random MAC using macchanger (you can also setup your own MAC if you need),
- Whole list is checked again and again, in endless while loop, until there is nothing to check loop is stopped,
- Found PINS/WPA PASSPHRASES are stored in {CRACKED_LIST_FILE_PATH} file.
USAGE EXAMPLE
- Wireless adapter which supports injection (see [https://code.google.com/p/reaver-wps/wiki/SupportedWirelessDrivers Reaver Wiki])
- Linux Backtrack 5
- Root access on your system (otherwise some things may not work)
- AND if you use other Linux distribution*
- Reaver 1.4 (I didn't try it with previous versions)
- KDE (unless you'll change 'konsole' invocations to 'screen', 'gnome-terminal' or something like that... this is easy)
- Gawk (Gnu AWK)
- Macchanger
- Airmon-ng, Airodump-ng, Aireplay-ng
- Wash (WPS Service Scanner)
- Perl
First you have to download lastest version
Go to auto-reaver directoryCode:Select Allgit clone https://code.google.com/p/auto-reaver/
Make sure that scripts have x permissions for your user, if not runCode:Select Allcd ./auto-reaver
Run wash scanner to make a formatted list of Access Points with WPS service enabledCode:Select Allchmod 700 ./washAutoReaver chmod 700 ./autoReaver
Wait for 1-2 minutes for wash to collect APs, and hit CTRL+C to kill the script. Check if any APs were detectedCode:Select All./washAutoReaverList > myAPTargets
If there are targets in myAPTargets file, you can proceed attack, with following command:Code:Select Allcat ./myAPTargets
ADDITIONAL FEATURESCode:Select All./autoReaver myAPTargets
so AA:BB:CCD:EE:FF will have only ADDITIONAL_OPTIONS changed (rest of variables from./configurationSettings file remains unchanged).
- Script logs dates of PIN attempts, so you can check how often AP is locked and for how long. Default directory for those logs is ReaverLastPinDates.
- Script logs each AP rate limit for every AP (default directory is /tmp/APLimitBSSID), so you can easily check when last rate limit occured
- You can setup your attack using variables from configurationSettings file (sleep/wait times between AP`s and loops, etc.)
- You can disable checking AP by adding "#" sign in the beginning of line, in myAPTargets file (then AP will be ommited in loop)
- (added 2014-07-03) You can setup specific settings per access point.
To do that for AP with MAC AA:BB:CCD:EE:FF, just create file./configurationSettingsPerAp/AABBCCDDEEFF
and put there variables from ./configurationSettings file that you want to change for example:
Code:Select AllADDITIONAL_OPTIONS="-g 10 -E -S -N -T 1 -t 15 -d 0 -x 3";
You can define channel as random by setting it's value (in myAPTargets file) to R, you can force script to automatically find AP channel.
Example:But remember that you probably should also increase value of BSSID_ONLINE_TIMEOUT variable - since hopping between all channels takes much more time than searching on one channel.Code:Select AllAA:BB:CC:DD:EE:FF R MyWlan
REAVER ACTIVITY CHECKER
This process is responsible for checking whether reaver is active, which means, that is - if it outputs messages similar to: [+] Received M1 message
during INACTIVITY_TIMEOUT seconds. If it's not, then reaver process is automatically killed by sending INT signal (which equals hitting CTRL+C), reaver session is saved, and another AP is processed.
CONFIGURATION SETTINGS DESCRIPTION=
Using file configurationSettings, you can adjust Auto Reaver to your needs.
Setup your additional reaver options: (type reaver --help for mor information about options)
since (2014-07-12)Code:Select AllADDITIONAL_OPTIONS="-E -S -N -T 1 -t 15 -d 0 -x 3";
To set minimum number of minutes between PIN attempts per access point, if AP blocks WPS often, consider to use this option to prevent blocking:
Set this to 0 if you wan't to see what's going on with AP (signal, beacons...etc),Code:Select AllMINUTES_WAIT_BETWEEN_PIN_ATTEMPTS=15;
1 means that airodump-ng window won't appear
Set this to 1 means that additional aireplay-ng (doing fake-auth) isn't startedCode:Select AllNO_AIRODUMP=1;
or to 0 if you encountered "[!] WARNING: Failed to associate with xx:xx:xx:xx:xx:xx (ESSID: yyyyy)"
Delay in seconds between association requests (aireplay-ng fake auth -l option)Code:Select AllNO_AIREPLAY=1;
Sleep in seconds between checking different AP's (inner loop iteration)Code:Select AllFAKE_AUTH_DELAY_SECONDS=60;
Notice: "Sleeping between AP's for {SLEEP_BETWEEN_APS}"
Sleep in seconds before another re-check of whole list (outer loop iteration)Code:Select AllSLEEP_BETWEEN_APS=5;
Notice: "Sleeping before another list re-check for {SLEEP_BEFORE_LIST_RECHECK} seconds"
Time in minutes during which AP is skipped inside loop because of reach "AP rate limit"Code:Select AllSLEEP_BEFORE_LIST_RECHECK=600;
Notice: "...was blocked less than {LIMIT_WAIT_MINUTES} minutes ago, skipping"
Timeout in seconds during script waits for AP to show up in airodump, after that AP is considered offline.Code:Select AllLIMIT_WAIT_MINUTES=60;
Notice: "Wait {BSSID_ONLINE_TIMEOUT} seconds... scanning if XX:XX:XX:XX:XX:XX (XXXX) is online"
SPOOFED MAC (if you want to define your own spoofed mac for wifi card)Code:Select AllBSSID_ONLINE_TIMEOUT=25;
If you leave this empty, MAC will be randomly generated by perl subroutine.
Reaver session files directoryCode:Select AllSPOOFED_MAC="00:21:6B:B5:E5:22";
Temporary directory for autoReaver script (containing some tmp files which are needed).Code:Select AllREAVER_SESSION_DIR="/usr/local/etc/reaver";
Remember that scripts must have write permissions for this dir.
Directory with tmp files indicating, that BSSID reached limit of attempts, files are named just like reaver session files. Simply if MAC=AA:BB:CCD:EE:FF file name is AABBCCDDEEFF every file is checking if it was modified over last LIMIT_WAIT_MINUTES,Code:Select AllTMP_DIR="/tmp/autoReaver";
if it was.. that means AP reached rate limit and will be skipped during the loop:
Directory with last dates of pin checks (if pin was checked, date of check was putted into PIN_DATE_TMP_DIR/BSSID file).Code:Select AllLIMIT_TMP_DIR="$TMP_DIR/APLimitBSSID";
Better don't set this directory in /tmp/ because it's cleared after reboot, and you loose your pin dates which are required to calculate average time between PINs.
File containing list of cracked access points.Code:Select AllPIN_DATE_TMP_DIR=$(pwd)"/ReaverLastPinDates";
(If something goes wrong with this file remember you can always recover PIN from session file /usr/local/etc/reaver/{MAC}.wpc.
First 2 lines of session file are first and second part of PIN.)
Activity Checker script checks, if file CHECK_ACTIVITY_FILE was modified before ($NOW - $INACTIVITY_TIMEOUT), then reaver process is killed due to inactivity (probably hanged up, can't associate or something like that),Code:Select AllCRACKED_LIST_FILE_PATH=$(pwd)"/AUTOREAVER_CRACKED_WPS_LIST";
CHECK_ACTIVITY_FILE is touched while AP responds with messsages such like: "Received M1-M6"
After INACTIVITY_TIMEOUT seconds of inactivity reaver will be killed, and started again with another AP.Code:Select AllCHECK_ACTIVITY_FILE="$TMP_DIR/autoReaverLastActivity";
Setting INACTIVITY_TIMEOUT=0 will prevent "Activity Checker" to run.
INACTIVITY_TIMEOUT=300;
You should modify this in case you have other interface like ath0 or something else:
WIRELESS_INTERFACE="wlan0";
Here you can define your own regexp which if matched - means that Reaver is active
If you want to be restrictive, you could change this to "Receive WSC NACK", which means that only this message, will be considered as activity.
Sometimes Reaver outputs only "Received M1" and won't go further, then you should change this to"Received M3".
This value should depend on specific AP's behavior.
REAVER_ACTIVITY_PERL_REGEXP="Received M\d+";
ADDITIONAL TOOLS
In auto-reaver directory you can find additional tools:
washAutoReaverList
Script that will scan network using wash, to search for Access points with WPS service enabled, and generate auto-reaver formatted list like:
Important: You can always block AP checking by simply adding # sign before each line, as follows:Code:Select AllAA:BB:CC:DD:EE:FF 1 MyWlan 00:BB:CC:DD:EE:FF 13 TpLink 00:22:33:DD:EE:FF 13 MyHomeSSID
so MyHomeSSID will be skipped during list check.Code:Select All# 00:22:33:DD:EE:FF 13 MyHomeSSID
showPinDates
Script shows last PIN attempt dates for the certain BSSID
It depends on PIN_DATE_TMP_DIR variable (see configuration section), from configurationSettings file.
You can use this tool to adjust setting of LIMIT_WAIT_MINUTES, it should help you discover, for how long certain AP is blocked during AP rate limit.
Using:
Example:Code:Select All./showPinDates [BSSID] [OPTIONS]
Example output:Code:Select All./showPinDates AA:BB:CC:DD:EE:FF
You can use additional options for grouping PIN dates:Code:Select All2014-06-26 06:06:54 2014-06-26 08:06:09 2014-06-26 13:06:08 2014-06-26 14:06:06 2014-06-26 15:06:10
Example:
Outputs:Code:Select All./showPinDates AA:BB:CC:DD:EE:FF --group-by-day
Options available:Code:Select AllGrouping PINs by day 2014-06-23: 24 PINs 2014-06-29: 20 PINs 2014-06-30: 51 PINs
--group-by-day - Grouping PIN dates, by day and shows PIN count of each day
--group-by-hour - Grouping PIN hours, by day+hour and shows PIN count of each day+hour
shuffleReaverSession.pl
PERL script to shuffle PINs in reaver session file.
This way you can increase probability of finding correct PIN earlier than using regular pin checking. Usage:
After execute, script will make a file {YOUR_FILE_NAME}_shuffled.Code:Select All./shuffleReaverSession.pl [REAVER_SESSION_FILE_PATH]
Remember to shuffle session before Access Point attack, otherwise you'll loose your old session.
testShuffledFileAgainstOriginal
Script purpouse is to test whether shuffled (by shuffleReaverSession.pl script) session file was more effective in finding PIN than the original.
Remember to test 4 digitsExample:Code:Select All*first part of PIN*, which is crucial to find *whole PIN* Usage: ./testShuffledFileAgainstOriginal [FIRST_PART_OF_PIN (4 digits)] [SESSION_FILE] [SHUFFLED_SESSION_FILE] `
Code:Select All./testShuffledFileAgainstOriginal 7834 ./AABBCCDDEEFF AABBCCDDEEFF_shuffled
AutoReaver 1.0
Auto Reaver - multiple access point attack using Reaver
- Watchers:
- This resource is being watched by 207 members.