Automate Wi-Fi Hacking with Wifite2
Wifite2 vs. Wifite
Wifite has been around for some time and was one of the first Wi-Fi hacking tools I was introduced to. Along with Besside-ng, automated Wi-Fi hacking scripts enabled even script kiddies to have a significant effect without knowing much about the way the script worked. Compared to Besside-ng, the original Wifite was very thorough in using all available tools to attack a network, but it could also be very slow.
One of the best features of the original Wifite was the fact that it performed a Wi-Fi site survey before attacking nearby networks, allowing a hacker to easily designate one, some, or all nearby networks as targets. By laying out available targets in an easy to understand format, even a beginner could understand what attacks might work best against nearby networks.
The original Wifite would automatically attack WPA networks by attempting to capture a handshake or by using the Reaver tool to brute-force the WPS setup PIN of nearby networks. While this method was effective, it could prove to take 8 hours or more to complete.
The updated WiFite2 is much faster, churning through attacks in less time and relying on more refined tactics than the previous version. Because of this, Wifite2 is a more serious and powerful Wi-Fi hacking tool than the original Wifite.
Attack Flow for Wi-Fi Hacking
Wifite2 follows a simple but effective workflow for hacking nearby networks as rapidly as possible. To do so, it pushes each tactic it tries to the practical limit, even going to far as to try to crack any handshakes it retrieves.
In the first step, Wifite2 scans across all channels looking for any network in range. It ranks these networks it discovers by signal strength, as a network being detected does not ensure you can reliably communicate with it.
Organized from strongest to weakest signal strength, the reconnaissance phase involves gathering information about what networks are around and which hacking techniques they might be vulnerable to. Because of the way Wifite2 is organized, it's easy to add a directional Wi-Fi antenna to use Wifite2 to locate the source of any nearby Wi-Fi network while performing a site survey.
After the site survey is complete, any targets displayed will show whether there are clients connected, whether the network advertises WPS, and what kind of encryption the network is using. Based on this, an attacker can select any target, a group of targets or all targets to begin an attack based on the information gathered.
Wifite2 will progress through the target list starting with the fastest and easiest attacks, like WPS-Pixie, which can result in a password being breached in seconds, on to less sure tactics like checking for weak passwords with a dictionary attack. If an attack fails or takes too long, Wifite2 will move on to the next applicable attack without wasting hours like its predecessor was prone to doing.
What You'll Need
To get started, you'll need a Wi-Fi network adapter you can put into wireless monitor mode. This means selecting one that is compatible with Kali Linux, which we have several excellent guides on doing.
Wifite2 is installed by default on Kali Linux, so I recommend you either use Kali in a virtual machine or dual-booted on a laptop. You can use Wifite2 on other Linux systems, but I won't go through the installation as this guide assumes you're using Kali Linux.
Recommended Adapter: Alfa AWUS036NHA
Step 1Install Wifite2
If you don't have Wifite2 installed on your system already, you can do so from the GitHub repository. First, you can clone the repository by opening a terminal window and typing the following commands.
This should download and install Wifite2 on your system. To test if it worked, you can type wifite -h to see information about the version installed.
Step 2Plug in Your Wi-Fi Card
With Wifite2 installed on your system, you'll need to plug in your Kali Linux-compatible wireless network adapter. Wifite2 takes care of not only auto-selecting a wireless network adapter to use but also puts that wireless card into monitor mode for you, meaning you don't need to do anything after plugging in the adapter.
Step 3Set Flags & Find a Target
If we know what channel we're attacking on, we can select it by adding the -c command followed by the channel number. Other than that, running Wifite2 is as simple as typing wifite and letting the script gather information.
Here, we executed a scan on channel 11 and found 10 different targets. Of those targets, two have clients connected, one has WPS enabled, and all are using WPA security.
Step 4Examine the Site Survey & Choose Targets
From our test survey, we can see that target number 5 may present the best target. While the signal strength isn't the best, and there aren't any clients connected, we can probably get a handshake with the new PMKID attack even if no one is connected.
If we're looking for weak passwords, the first three networks have the strongest signal strength, while targets 4 and 7 have the best chance of scoring a quick four-way handshake to try brute-forcing later. If we're targeting a particular network, now is when we can select it. If we want to pick the most likely networks, we might select targets 4, 5, and 7 for the likelihood of a fast handshake being captured and cracked, if the WPS PIN isn't cracked first.
If we want to focus on easy targets, we can tell the script to only display targets vulnerable to a certain kind of attack. To show only targets with WPS that might be vulnerable to Reaver or Bully attacks, we can run Wifite2 with the -wps flag.
We can do the same with -wpa or -wep to only show targets matching these types of encryption.
Step 5Automate Attacks by Target Type
From our results list, let's select a target with both WPS enabled and clients attached. After selecting the number of the network we wish to attack, Wifite2 will proceed through the most expedient attacks against the network.
Here, we can see that while the WPS-Pixie attack failed, we were able to easily grab and attack a handshake. The WPS-Pixie attack timed out pretty quickly, so we wasted a minimum of time exploring this avenue of attack. Sometimes, different wireless cards work better with different scripts, and this is true with Reaver and Bully. If one isn't working for you, try the other.
Wifite2 uses Reaver by default, but you can change this to Bully by using the -bully flag.
While we didn't have a better result with Bully, trying both is a good way of figuring out which your wireless network adapter works best with.
Step 6Skip & Examine Results
If Wifite2 is taking too long on any particular attack, we can always skip the current attack by pressing Ctrl-C to bring up a menu that asks if we'd like to continue. Here, you can skip to the next attack by pressing c, or type s to stop Wifite2.
If we're only able to get a four-way handshake, then we may want to add a custom dictionary list of password guesses to try and crack the handshake. We can do this by setting the --dict flag to set the file containing passwords for cracking, the default being set to /usr/share/wordlists/fern-wifi/common.txt. This password list contains many common passwords, but you'll want to use your own if you're serious about getting results.
Below, we successfully decrypt a captured handshake by using a custom dictionary "passwords.txt."
By adding a good password file, we can improve our chances of cracking a Wi-Fi network password even if the faster WPS attacks fail.
Some Practical Warnings & Defenses
Wifite2 is an example of how even script kiddies can be effective against networks with common vulnerabilities like WPS setup PINs and weak passwords. With an increasing amount of the more advanced attacks becoming automated, it's critical that you learn about the most common and effective ways of attacking a Wi-Fi network.
In general, the best way to defend your network from tools like Wifite2 is to make sure you have WPS disabled and pick a very strong password for your Wi-Fi network that you don't share with anyone you don't need to.
It's important to note that by selecting "all" in a target list, Wifite2 will attack all of the networks it has detected, not just the ones you have permission to attack. You must have permission to use this tool on any network you attack, as attacking a network belonging to someone else without permission is a crime and can get you in a lot of trouble. Saying the script did it isn't an excuse if you're caught attacking an important network, so be sure to keep Wifite2 targeted on networks you have permission to audit.
0 Comments