Prerequisites
- A Linux distribution designed for penetration testing (e.g., Kali Linux, Parrot OS) is highly recommended, as it comes with Wifite and its dependencies pre-installed.
- A wireless network adapter capable of packet injection and monitor mode (e.g., Alfa AWUS036NHA, TP-Link TL-WN722N v1).
- Root privileges (
sudoaccess) are required to run Wifite and its underlying tools. - The Aircrack-ng suite, Reaver (for WPS attacks), and potentially Pyrit (for GPU-accelerated WPA cracking) should be installed and up-to-date.
Key Wifite Features & Commands
Wifite offers a range of features that automate and streamline wireless network auditing. Here are some of its most notable capabilities and their corresponding command-line options:
Sort Targets by Signal Strength
Wifite can prioritize targets based on their proximity (signal strength), allowing you to focus on the most accessible networks first.
Command:
sudo wifite --sortThis option is often implicitly active, but explicitly stating it ensures targets are listed and potentially attacked in order of signal strength (dBm value).
De-authenticate Clients of Hidden Networks
This feature helps reveal the SSID (network name) of hidden networks by momentarily disconnecting clients, forcing them to re-associate and broadcast the SSID.
Command:
sudo wifite --deauth-hiddenWifite will send deauthentication packets to clients connected to networks with hidden SSIDs, aiming to capture the SSID during re-association.
Numerous Filters for Targeted Attacks
Wifite allows fine-grained control over which networks to target based on various criteria.
Command Example:
sudo wifite --wep --wpa --skip-wps --essid "MyHomeNetwork" --channel 6 --signal >=-75This command targets:
- WEP and WPA/WPA2 PSK networks (
--wep --wpa). - Skips WPS attacks (
--skip-wps). - Only networks with the SSID "MyHomeNetwork" (
--essid "MyHomeNetwork"). - Networks on channel 6 (
--channel 6). - Networks with signal strength greater than or equal to -75 dBm (
--signal >=-75).
wifite --help for a full list of filters.
Customizable Attack Settings
Adjust various parameters to fine-tune Wifite's behavior during attacks.
Command Example:
sudo wifite --wpa-timeout 300 --dict /usr/share/wordlists/rockyou.txt --pps 10
--wpa-timeout 300: Sets the WPA handshake capture timeout to 300 seconds.--dict /path/to/wordlist.txt: Specifies a custom dictionary file for WPA/WPA2 PSK cracking.--pps 10: Sets the packets-per-second rate for certain attacks (e.g., deauthentication).
Anonymous Feature (MAC Spoofing)
This feature changes your wireless card's MAC address to a random one before initiating attacks and reverts it upon completion, offering a layer of anonymity.
Command:
sudo wifite --mac randomAlternatively, --anon was used in older versions; --mac random is current. You can also specify a MAC: --mac XX:XX:XX:XX:XX:XX.
Automatic Backup of Captured Handshakes
Wifite automatically saves captured WPA/WPA2 handshakes (usually as .cap files) in its working directory (typically hs/), allowing for later offline cracking.
Note:
This is an automatic behavior. Files are saved in the 'hs' subdirectory.The --backup flag might not be a direct Wifite2 option; handshakes are generally saved by default.
Smart WPA De-authentication
During WPA/WPA2 attacks, Wifite intelligently cycles deauthentication packets between specific clients and broadcast addresses to maximize the chances of capturing a handshake.
Note:
This is an intrinsic part of Wifite's WPA attack strategy.The --deauth option (often used with --bssid) triggers deauthentication. Wifite's logic handles the smart cycling.
Interactive Attack Control
Users can interrupt ongoing attacks using Ctrl+C. Wifite then presents options to continue, switch targets, proceed to cracking, or exit.
Action:
Press Ctrl+C during an active attack.Session Summary at Exit
Upon exiting, Wifite provides a summary of the session, including any successfully cracked passwords or captured handshakes.
Note:
Summary displayed automatically upon exiting Wifite.Automatic Password Saving
All successfully cracked passwords are saved to a log file, typically named cracked.csv or cracked.txt in Wifite's directory.
Note:
Passwords saved automatically to cracked.csv (or similar).Built-in Updater
Wifite includes a mechanism to update itself to the latest version directly from its source repository.
Command (if running from cloned git repo):
cd /path/to/wifite2/
git pull
# For installed versions, package manager handles updates:
sudo apt update && sudo apt install wifiteThe old ./wifite.py --upgrade might apply to legacy Wifite. For Wifite2, updating via git pull (if cloned) or the system's package manager is standard.
Comprehensive Wifite Walkthrough: A Practical Scenario
This guide demonstrates a typical workflow for using Wifite to assess a WPA/WPA2 protected network.
Before scanning, your wireless interface must be in monitor mode. Wifite often attempts this automatically, but manual activation can be more reliable.
Identify your wireless interface (e.g., wlan0):
iwconfigEnable monitor mode using airmon-ng:
sudo airmon-ng check kill
sudo airmon-ng start wlan0This command stops network services that might interfere and then starts monitor mode, often creating a new interface like wlan0 or mon0. Use this new interface name with Wifite.
Launch Wifite to scan for available wireless networks. Specify your monitor mode interface.
Command:
sudo wifite -i wlan0Wifite will list nearby networks, their BSSIDs, encryption types, signal strength, and connected clients. Press Ctrl+C to stop scanning and select targets.
Once you've identified a target network (ensure you have permission!), you can instruct Wifite to attack it specifically using its BSSID.
Command:
sudo wifite -i wlan0 --bssid XX:XX:XX:XX:XX:XXReplace XX:XX:XX:XX:XX:XX with the actual BSSID of the target network. Wifite will then attempt appropriate attacks based on the network's security (WEP, WPA/WPA2, WPS).
For WPA/WPA2 protected networks, Wifite's primary objective is to capture the crucial 4-way handshake. This handshake occurs when a client device legitimately connects (or re-connects) to the wireless access point. Wifite automates this process by actively deauthenticating currently connected clients. This forces them to re-establish their connection, during which Wifite listens for and captures the handshake.
Command (Wifite focuses on WPA/WPA2 by default when attacking a specific BSSID):
sudo wifite -i wlan0mon --bssid XX:XX:XX:XX:XX:XXYou can also explicitly specify --wpa if you want to target only WPA/WPA2 networks, though it's often redundant if a BSSID is provided as Wifite will identify the encryption type.
The Process:
- Wifite will begin monitoring the target BSSID on its specific channel.
- It will then send deauthentication packets to any connected clients (or to the broadcast address of the AP) to disrupt their connection.
- When a client attempts to reconnect, Wifite will try to capture the EAPOL (Extensible Authentication Protocol over LAN) packets that form the 4-way handshake.
- You'll see messages in Wifite like "WPA handshake captured!" or similar upon success.
Where and How the .cap File is Saved:
Once Wifite successfully captures a WPA/WPA2 handshake, it automatically saves this data into a file with a .cap (capture) extension.
- Location: These files are typically saved in a subdirectory named
hs(which stands for "handshakes") located within the directory from which you launched Wifite. For example, if you ran Wifite from/home/user/wifite_tests/, the handshakes would likely be in/home/user/wifite_tests/hs/. - Naming Convention: The filename usually incorporates the BSSID (MAC address) and sometimes the ESSID (network name) of the access point, making it easy to identify later. For example:
ESSID_XX-XX-XX-XX-XX-XX.capor justXX-XX-XX-XX-XX-XX.cap. - Automatic Process: You do not need to manually save the file; Wifite handles this automatically upon successful capture.
Enabling Offline Attacks:
Yes, this saved .cap file is precisely what allows for offline password cracking. "Offline" means that once the handshake is captured and saved, you no longer need to be near the target network or even have your wireless card in monitor mode to attempt to crack the password. The captured handshake contains all the necessary cryptographic information (encrypted messages) to attempt to find the Pre-Shared Key (PSK).
You can then take this .cap file and use tools like Aircrack-ng (as detailed in Step 5), Hashcat, or John the Ripper, along with a wordlist or other cracking techniques, to try and discover the network password. The cracking process itself does not interact with the live network.
.cap file)
Once a handshake is captured, Wifite may attempt to crack it using a default wordlist. For more robust cracking, use Aircrack-ng with a comprehensive wordlist.
Using Aircrack-ng:
sudo aircrack-ng -w /path/to/your/wordlist.txt -b XX:XX:XX:XX:XX:XX /path/to/captured/handshake.cap
- Replace
/path/to/your/wordlist.txtwith the path to your wordlist (e.g.,rockyou.txt). - Replace
XX:XX:XX:XX:XX:XXwith the target BSSID. - Replace
/path/to/captured/handshake.capwith the path to the Wifite-captured.capfile.
Advanced Usage & Pro Tips
- Wordlists are Crucial: For WPA/WPA2 PSK, the success of cracking heavily depends on the quality and size of your wordlist. Consider using specialized wordlists or generating your own.
- Channel Hopping: By default, Wifite hops channels. If you know the target's channel, specifying it with
--channelcan speed up the process. - WPS Attacks: If a network has WPS enabled and is vulnerable, Wifite (using Reaver or Bully) can attempt to recover the PSK or PIN. Use
--wpsto focus on WPS.WPS Lockouts: Many modern routers implement WPS lockout mechanisms after several failed PIN attempts, rendering this attack ineffective. - Understand
.capFiles: These files contain captured wireless traffic. Beyond password cracking, they can be analyzed with tools like Wireshark for deeper network insights (with appropriate decryption keys). - Regular Updates: Keep Wifite and its dependencies (Aircrack-ng suite, Reaver, etc.) updated to benefit from the latest features and bug fixes.
It cannot be stressed enough: NEVER use Wifite or any penetration testing tools on networks for which you do not have explicit, written authorization. Unauthorized wireless attacks are illegal in most jurisdictions and can result in severe penalties, including fines and imprisonment. This guide is for educational and authorized professional use only.
Always act responsibly and ethically. The goal of learning these tools should be to understand vulnerabilities to better defend networks, not to engage in malicious activities.
Conclusion
Wifite is a powerful and convenient tool for automating wireless security audits. By understanding its features, commands, and the underlying principles of wireless attacks, security professionals can effectively assess network vulnerabilities. Always use this knowledge responsibly and within legal and ethical boundaries.