# Wifi

Las pruebas que se describen y recomiendan realizar en esta sección están basadas en la metodología [OWISAM](https://www.owisam.org/index.php).

## Espacio de trabajo

Antes de comenzar a trabajar es necesario saber si las antenas que vamos a usar necesitan la instalación de los drivers, o son plug\&play y se identifican directamente por la máquina.

En el caso de las antenas Alfa, es necesario la instalación de los drivers, y para ello os dejamos este vídeo:

{% embed url="<https://www.youtube.com/watch?v=kvFBsvBA5ac>" %}

Para instalar los drivers puedes usar estos comandos:

```
sudo apt update
sudo apt upgrade -y
sudo apt dist-upgrade -y
sudo reboot now
sudo apt update
sudo apt install realtek-rtl88xxau-dkms
sudo apt install dkms
git clone https://github.com/aircrack-ng/rtl8812au
cd rtl8812au/
make
sudo make install

//instalar las headers de tu version de kali
//sudo apt search linux-headers
//sudo apt-get install –y linux-headers-<linux-headers package here>

lsusb //para identificar la antena conectada vía USB
iwconfig //para confirmar que se ha identificado la interfaz de red
```

{% hint style="info" %}
IMPORTANTE

En algunas versiones de Kali Linux después de instalar los drivers de la antena, es posible que cuando actualices Kali y reinicies, puede darte un kernel panic, pero arrancas Kali en modo seguro, desinstalas los drivers, vuelves a actualizar Kali, y ya está :)
{% endhint %}

Para desinstalar los drivers puedes usar estos comandos:

```
apt remove realtek-rtl88xxau-dkms && apt purge realtek-rtl88xxau-dkms
apt update && apt upgrade
apt autoremove && apt autoclean
reboot
apt-get dist-upgrade
reboot
```

## Configuraciones de la tarjeta de red

### 1. Modos de escucha:

* Modo managed. Permite ver las redes a tu alrededor y conectarte a ellas.

```bash
iwconfig [wlan0] mode managed 
```

* Modo monitor. Permite capturar el tráfico de las redes a tu alrededor.

```bash
iwconfig [wlan0] mode monitor
```

* Matar los procesos que interfieren con la suite aircrack-ng

```bash
airmon-ng check kill
```

### 2. Opciones de la tarjeta de red:

* Comprobar estado de la tarjeta de red

```bash
iwconfig
```

* Activar la tarjeta de red

```bash
ifconfig start [wlan0]
```

* Desactivar la tarjeta de red

```bash
ifconfig stop [wlan0]
```

* Cambiar la MAC de la interfaz de red:

```visual-basic
macchanger -a [wlan0]
```

## Recursos y enlaces de referencia

* <https://www.owisam.org/index.php>
* <https://wifichallengelab.com/>
* <https://command-not-found.com/wpa_passphrase>
* [Router hacking y firmware](https://secnigma.wordpress.com/2022/01/18/a-beginners-guide-into-router-hacking-and-firmware-emulation/)
* [Routers Passwords](https://www.routerpasswords.com/)
* [cracking WPA/WPA2 para CTF's](https://github.com/skickar/ChickenManGame)


---

# 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://wiki.securiters.com/securiters-wiki/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.
