How phenotypic/wificrack works
Project type and purpose
• WiFiCrack is an open-source, Bash-based CLI tool for demonstrating WPA/WPA2 handshake capture and password cracking.
• It glues together system utilities and external tools (mergecap, cap2hccapx, hashcat) to automate the end-to-end attack process for educational purposes.
File structure
• Top level contains only three entries:
• LICENSE – project license
• README.md – documentation and usage instructions
• WiFiCrack.sh – the single Bash script
• No frontend/backend split, no libraries or modules beyond the script itself
• All architecture lives inside the script’s workflow and its interaction with external dependencies
README for additional insights
• Describes the high-level flow:
a) Detect and configure Wi-Fi interface in monitor mode
b) Scan for and list available networks
c) (Optional) Deauthentication attack to provoke a handshake
d) WPA/WPA2 handshake packets
e) Convert capture to hashcat-readable format (cap2hccapx)
f) Invoke hashcat with a wordlist to crack the passphrase
• Lists external prerequisites: Xcode (macOS), hashcat, mergecap, cap2hccapx, plus a wordlist
a. Main components
• User / CLI – initiates the script and provides flags (–h, –w, –i, etc.)
• WiFiCrack.sh – central orchestration script
• OS & Shell Environment – Bash/Zsh on macOS
• Wi-Fi Adapter – switched to monitor mode by the script
• Wireless Network (Target AP + client device) – source of WPA handshake
• mergecap – packet file merger/converter (part of Wireshark)
• cap2hccapx.bin – hashcat-utils converter
• hashcat – GPU-accelerated password cracker
• Wordlist – dictionary for hashcat attacks
• Output (handshake files, cracked password)
b. Relationships and data flow
1. User invokes WiFiCrack.sh (CLI → Script).
2. Script configures Wi-Fi Adapter into monitor mode (Script → OS/Adapter).
3. Adapter captures beacon and handshake packets from Target AP/Client (Adapter ↔ Network).
4. Optionally, Script triggers deauth frames to force a handshake (Script → Network).
5. Packet capture file(s) passed to mergecap if needed (Script → mergecap → Script).
6. Script runs cap2hccapx to produce a .hccapx file (Script → cap2hccapx).
7. Script calls hashcat, supplying .hccapx file and Wordlist (Script → hashcat).
8. hashcat produces cracked password or retains .hccapx for later (hashcat → Script).
9. Script reports result to User (Script → CLI).
c. Architectural patterns and design principles
• Orchestration pattern: WiFiCrack.sh acts as a coordinator, invoking external tools in sequence.
• Modularity by externalization: heavy lifting is delegated to battle-tested utilities rather than reinvented.
• Clear separation of concerns: capture, conversion, cracking, and I/O are distinct steps.
d. Key technologies and libraries
• Bash scripting in macOS environment
• mergecap (Wireshark) for pcap manipulation
• cap2hccapx (hashcat-utils) for format conversion
• hashcat for GPU-based attack
• Standard Unix tools (awk/grep/sudo) for parsing and control flow