Page cover

WiFi Penetration Testing Guide

  • Ettercap - Check if you can do a MitM attack and sniff all the traffic in the network

7.3. Spoofing

  • Nmap/Zenmap - Security Scanner, Port Scanner, & Network Exploration Tool

  • Masscan - The faster version of nmap (it can break things, so be careful)

  • Netdiscover - ARP sniffing. Very useful if the networks are very well segmented

7.2. Types of scanners

7.1. Attacking the router

Once you are connected to the network

7. Post-exploitation


Windows:

Linux:

6.4. Other frameworks

An example to deauthenticate all the devices except a Fake Acess Point:

6.3. Wifi Jamming

6.2. OSINT

These are two advanced attacks discovered by the great Mathy Vanhoefarrow-up-right:

6.1. Krack Attack and Frag Attack

6. Other attacks


Find supported EAP methods

5.3 EAP methods supported

5.2 Brute force

Hostapd-wpe

When a client connects, read logs with:

Start the Access Point using:

Hostapd & Freeradius-wpe

In case you do not want to use the virtual machine, you can install everything using:

Local installation

Operating system
Platform
Credentials
Size
Link

Ubuntu 16.04.5

VMware

ricardojoserf:wifi

3.25 GB

Kali 2019.1

VMware

root:wifi

4.99 GB

Ubuntu 16.04.5

VirtualBox (OVA)

ricardojoserf:wifi

3.18 GB

Kali 2019.1

VirtualBox (OVA)

root:wifi

5.56 GB

Virtual machines download

5.1 Fake Access Points

5. WPA2-Enterprise


For that, you have to create a Fake Access Point using hostpad with a configuration file like this onearrow-up-right, with any password but the same network name. Create the fake network, the client device will try to connect to it and you get the 4-way handshake as in the 4.1 section in this guidearrow-up-right.

If you have access to a client device with the Wifi connection turned on but there is not a network around, you can still attack that network if the client devices has previously connected to it.

4.3. AP-less attack

  1. Crack it using Hashcat (option 16800)

The structure of each line is: PMKID * ROUTER MAC * STATION * ESSID (check at: https://www.rapidtables.com/convert/number/hex-to-ascii.htmlarrow-up-right)

  1. Create $HASH_FILE

  • Capture PMKID

  • Create a text file ($FILTER_FILE) and add the MAC address without ":". You can use sed and redirect the output to a file:

3a. If you want to attack a specific MAC address

  1. Install Hcxdumptool and Hcxtool (you can use this scriptarrow-up-right).

  2. Stop Network Manager

You can use this scriptarrow-up-right or follow these steps:

4.2. PMKID attack

  1. Option 2: Crack the handshake using Pyrit

You can get wordlists from herearrow-up-right.

  1. Option 1: Crack the handshake using Aircrack-ng

  1. Deauthenticate an user. Stop airodump capture when you see a message 'WPA handshake: $MAC'

  1. Start capture

4.1. Cracking the 4-way-handshake

4. WPA2-PSK cracking


  1. Crack the password using Aircrack-ng

  1. Accelerate the IV capture using Fake authentication + Arp Request Replay Attack + Deauthenticate user. Stop Airodump at ~100.000 different IVs

  1. Start capture

3. WEP cracking


  1. ARP Spoofing attack using Ettercaparrow-up-right

  2. Sniff the traffic using Wireshark or TCPdump

  3. Analyze the traffic using PCredzarrow-up-right (Linux) or Network Minerarrow-up-right (Windows)

Once you are in the network, you can test if it is vulnerable to Man in the Middle attacks.

2.2. Man in the Middle attack

  1. Create the tunnel

  1. Check if it works correctly in herearrow-up-right

  2. Execution in the client

  1. Execution in the server

  • One "A record": dns.$DOMAIN pointing to the $SERVER_IP (Example: dns.domain.com 139.59.172.117)

  • One "NS record": hack.$DOMAIN pointing to dns.$DOMAIN (Example: hack.domain.com dns.domain.com)

  1. Check the domain names are resolved:

A second method is creating a DNS tunnel. For this, it is necessary to have an accessible DNS server of your own. You can use this method to bypass the captive portal and get "free" Wifi in hotel, airports...

2.1.3. Bypass 2: DNS tunnelling

Also, you can use scripts to automate the process like:

  1. Change your IP and MAC addresses. You can use:

  1. Scan the network and get the list of IP and MAC addresses. You can use:

The first method to bypass a captive portal is to change your MAC address to one of an already authenticated user

2.1.2. Bypass 1: MAC spoofing

  1. Clone a website using HTTrackarrow-up-right

  2. Install Wifiphiserarrow-up-right. Add the HTTrack result in a new folder in wifiphisher/data/phishing-pages/new_page/html and a configuration file in wifiphisher/data/phishing-pages/new_page/config.ini.

  3. Recompile the project using python setup.py install or the binary in bin.

  4. This command works correctly in the latest Kali release after installing hostapd:

2.1.1. Fake captive portals

2.1. Captive portals

2. Open networks


For the character set it is possible to use l (lowercase letters), u (uppercase letters), n (numbers), c (lowercase+uppercase), m (lowercase+uppercase+numbers) or a (all printed).

2.b. Or execute a bruteforce attack

2.a. Execute a dictionary attack

List the networks using Airodump-ng and get the AP's MAC address ($AP_MAC) and one from a client ($CLIENT_MAC). Do not stop the capture.

  1. List networks

Get hidden SSID without clients

In another terminal, deauthenticate a client or all of them. When Airodump-ng captures a handshake from this network, the name or ESSID will appear in the first terminal:

  1. Deauthenticate

List the networks using Airodump-ng and get the AP's MAC address ($AP_MAC) and one from a client ($CLIENT_MAC). Do not stop the capture.

  1. List networks

Get hidden SSID with clients

  1. An Access Point (= all the clients in the AP)

  1. Only one client

Deauthentication

  1. Set monitor mode

  2. Run Airodump-ng-ng

List networks

Set monitor mode

Check interface status

Check interface mode

Set environment variable

1. Basic commands

Last updated