hcxdumptool Documentation
repository·master·Indexed 22 days ago
https://github.com/zerbea/hcxdumptoolA specialized tool for capturing WLAN packets and performing layer 2 attacks against the WPA protocol to identify security weaknesses in WiFi networks. Optimized for resource-constrained headless systems like the Raspberry Pi Zero, it captures raw traffic in pcapng format. It is designed to work within a pipeline alongside hcxtools (such as hcxpcapngtool), Hashcat, and John the Ripper to convert and crack captured hashes.
What's inside hcxdumptool
- hcxdumptool is a tool designed to capture packets from WLAN devices and discover potential vulnerabilities within your own WiFi networks. It achieves this by executing layer 2 attacks against the WPA protocol. The tool is optimized to run (mostly headless) on resource-constrained systems such as a Raspberry Pi Zero.
Understand the hcxdumptool workflow
masterhcxdumptool is an analysis toolkit designed for capturing wireless traffic in the modern
pcapngformat. It does not perform cracking or conversion itself. Instead, it is part of a multi-tool pipeline:- Capture: Use
hcxdumptoolto capture raw traffic. - Convert: Use
hcxpcapngtool(fromhcxtools) to convertpcapngfiles into formats readable by Hashcat or JtR. - Filter/Process: Use
hcxhashtool,hcxpsktool, orhcxeiutool(fromhcxtools) to filter hashes or generate wordlists. - Crack: Use Hashcat or JtR to recover the PSK from the processed hashes.
hcxdumptool -> hcxpcapngtool -> hcxhashtool (additional hcxpsktool/hcxeiutool) -> Hashcat or JtR- Capture: Use
Configure attack vectors and safety via BPF
masterBy default,
hcxdumptoolutilizes three attack vectors:- Connecting to an Access Point to get a PMKID (disable via
--associationmax=0). - Disconnecting a client from an AP to get a handshake (M1M2M3M4) and PMKID (disable via
--disable_disassociation). - Allowing a client to connect to
hcxdumptool(OSI layer 2 attack) to get a challenge (M1M2) or an EAP-ID (disable via--m2max=0).
Safety and Control
hcxdumptoolshould only be used in a 100% controlled environment. If you cannot control the environment, it is mandatory to set a Berkeley Packet Filter (BPF) to select specific targets or protect other devices.- Connecting to an Access Point to get a PMKID (disable via
General Workflow for hcxdumptool attacks
masterA typical attack workflow using this toolset follows this pipeline:
- Capture: Use
hcxdumptoolto capture wireless frames. - Convert: Use
hcxtools(specificallyhcxpcapngtool,hcxhashtool, orhcxpsktool) to convert the capture into a format suitable for cracking. - Crack: Use
hashcatorjohnto perform the password cracking. - Analyze: Optionally upload results to
wpa-secfor weak password analysis.
- Capture: Use
Manually terminate the hardware modification process
masterTo manually terminate the process using the hardware modification:
- Press and hold the push button for at least 10 seconds.
- Wait for the LED to turn on (the LED also turns on automatically when
hcxdumptoolterminates). - Once the LED is on, you can safely turn off the Raspberry Pi and disconnect its power supply.
Crack captured WPA/WPA2 keys with Hashcat or John
masterUse the converted files to perform a dictionary attack.
Using Hashcat: It is recommended to use a separate pot file to avoid overwriting existing results.
hashcat -m 22000 --potfile-path=hashcat.wpa.pot testap.hc22000 wordlistUsing John the Ripper:
john --pot=john.wpa.pot -w wordlist --format=wpapsk-opencl testap.johnMonitor hardware status via LED indicators
masterWhen using the specific hardware modification described in the documentation, the LED serves as a status indicator. A flashing LED (every 10 seconds) indicates that the system is functioning correctly and signals are being received as expected.Analyze password vulnerability via wpa-sec
masterTo check if a captured password is weak, you can upload the
.pcapngdump to the Distributed WPA PSK auditor (wpa-sec) via their web interface or using thewlancap2wpasectool:wlancap2wpasec dump_file_name.pcapngConvert pcapng captures for Hashcat or John the Ripper
masterOnce a capture is complete, use
hcxpcapngtoolto convert the.pcapngfile into a format compatible with cracking tools.For Hashcat (Mode 22000):
hcxpcapngtool -o testap.hc22000 testap.pcapngFor John the Ripper:
hcxpcapngtool --john testap.john testap.pcapngTroubleshooting Conversion:
hcxpcapngtoolmay throw errors if:- The capture is too short or incomplete.
- The file format is outdated.
- Too many DEAUTHENTICATION/DISASSOCIATION frames were detected.
- The capture file was cleaned.
- No undirected PROBEREQUESTs were detected.
- Too few M1 frames were detected.
Install hcxdumptool from source
masterWhile available via package managers, it is highly recommended to clone and build from source to ensure you have the latest version. Ensure all dependencies (like
libpcapandlibpcap-dev) are installed before compiling.Clone and Compile
git clone https://github.com/ZerBea/hcxdumptool.git cd hcxdumptool make -j $(nproc)Install
To install to
/usr/bin:make install (as super user)To install to
/usr/local/bin:make install PREFIX=/usr/local (as super user)Headless Optimization
If running on a headless system (e.g., Raspberry Pi), remove
-DSTATUSOUTfrom theMakefilebefore compiling. This prevents the status display from being compiled, saving CPU cycles and preventing errors.git clone https://github.com/ZerBea/hcxdumptool.git cd hcxdumptool make -j $(nproc) make installCreate a BPF filter for targeting or protecting addresses
masterCreating a Berkeley Packet Filter (BPF) is mandatory to instruct
hcxdumptoolto either attack or ignore specific addresses.To attack a specific MAC address (e.g.,
ccce1edc3bee) including its probe requests, generate a BPF file using the--bpfcflag:hcxdumptool --bpfc="wlan addr1 ccce1edc3bee or wlan addr2 ccce1edc3bee or wlan addr3 ccce1edc3bee or type mgt subtype probereq" > attack.bpfTo protect an address (ensure
hcxdumptoolignores it), use thenotoperator:hcxdumptool --bpfc="not wlan addr3 ccce1edc3bee" > protect.bpfNote: Do not filter undirected
PROBEREQUESTframes, as they may contain PreSharedKeys.Run hcxdumptool for wireless capture
masterAfter creating a BPF, run
hcxdumptoolwith root/sudo privileges. You can adjust the invasiveness of the attack using various flags:- Basic attack: Specify interface, channel, BPF, and output file.
- Non-responsive to clients: Use
--proberesponsetx=0to prevent responding to client probe requests. - Disable disassociation: Use
--disable_disassociationto prevent the tool from sending disassociation frames to clients.
Example commands:
# Standard attack sudo hcxdumptool -i wlan0 -c 11a --bpf=attack.bpf -w testap.pcapng # Attack without responding to clients sudo hcxdumptool -i wlan0 --rds=3 -c 11a --proberesponsetx=0 --bpf=attack.bpf -w testap.pcapng # Attack without responding to clients AND without disassociating clients sudo hcxdumptool -i wlan0 --rds=3 -c 11a --proberesponsetx=0 --disable_disassociation --bpf=attack.bpf -w testap.pcapngsudo hcxdumptool -i wlan0 -c 11a --bpf=attack.bpf -w testap.pcapng