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

# Open Authentication

### Open Authentication without Password

Once we know your ESSID we can connect to the network, for that we create a “free.conf’ file to connect from bash using “wpa\_supplicant”.

```
nano free.conf
```

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FjLPYudLl38aowvbnjkH2%2Fimage.png?alt=media&amp;token=c7b35d9a-9a45-4709-ad5e-6fdd15e2468b" alt=""><figcaption></figcaption></figure>

```bash
network={
	ssid="$ESSID"
	key_mgmt=NONE
	scan_ssid=1
}
```

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FaRfqQJ0gNFpdZXbSTB4y%2Fimage.png?alt=media&amp;token=95d758f3-76f4-496c-9810-506353e1fbac" alt=""><figcaption></figcaption></figure>

```bash
sudo wpa_supplicant -Dnl80211 -iwlan2 -c free.conf
```

* **`wpa_supplicant`**: A daemon used to manage WPA/WPA2 authentication for Wi-Fi networks.
* **`-Dnl80211`**: Specifies the wireless driver backend.
  * `nl80211` is the modern driver used for most Linux wireless devices.
  * If `nl80211` doesn't work, you might try `wext` (legacy driver).
* **`-iwlan2`**: Specifies the wireless interface (`wlan2` in this case).
  * You should check your actual interface name using `iwconfig` or `ip link show`.
* **`-c free.conf`**: Specifies the configuration file (`free.conf`) containing network credentials and settings.

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FHGHeyMvjWcIsxFTsq2T5%2Fimage.png?alt=media&amp;token=b1033ef1-a2ff-445b-b1c3-9f2df8ef7545" alt=""><figcaption></figcaption></figure>

In another terminal as root:

<pre class="language-bash"><code class="lang-bash"><strong>sudo dhclient wlan2 -v
</strong></code></pre>

* **`sudo`**: Runs the command with superuser privileges.
* **`dhclient`**: A DHCP (Dynamic Host Configuration Protocol) client that requests an IP address from a DHCP server.
* **`wlan2`**: The name of the wireless interface requesting the IP.
* **`-v`**: Enables verbose mode to display detailed output.

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2Fqmleoi1q5LcjmleuYULK%2Fimage.png?alt=media&amp;token=8f69a5fc-d526-4278-b879-384cc64c68b2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FyXPxFzCboSbnPotOJ9FP%2Fimage.png?alt=media&amp;token=dd93857e-81b7-4c5f-94c0-5556f0234e11" alt=""><figcaption></figcaption></figure>

Once connected to the network and get IP with “dhclient” we can access the IP at IP 192.168.16.1 where we see a login where we can test default credentials such as admin/admin, accessing the admin panel where you can find the flag.

```
admin/admin
```

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2F9S3o7RmnnRtm6BEEwbxX%2Fimage.png?alt=media&amp;token=dec7a187-456e-44e7-b34f-9c39db08e33b" alt=""><figcaption></figcaption></figure>

#### Alternate Method to connect <a href="#id-06-what-is-the-flag-on-the-ap-router-of-the-wifi-guest-network" id="id-06-what-is-the-flag-on-the-ap-router-of-the-wifi-guest-network"></a>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2F8X3oWkwwXbIkfSsxQHz5%2Fimage.png?alt=media&amp;token=9e15ae73-a2e3-497d-b22e-406f0ee0911a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2Fk3U7hNC4Xz3xkfxmDq0L%2Fimage.png?alt=media&amp;token=0bd1090d-0c26-4597-af45-333ef773c3fa" alt=""><figcaption></figcaption></figure>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2F40mdrCN0Nn7Jb3Y8pAhC%2Fimage.png?alt=media&amp;token=cc0e475a-76ed-406b-a283-cdb09a946d0a" alt=""><figcaption></figcaption></figure>

### Opportunistic Wireless Encryption

**Opportunistic Wireless Encryption (OWE)**, also known as Enhanced Open provides encryption without requiring a password.

The Key Difference: Look at the `airodump-ng` output for **ENC and AUTH**.

* <mark style="color:orange;">Standard Open (Lab 1): Shows</mark> <mark style="color:orange;"></mark><mark style="color:orange;">`ENC: OPN`</mark> <mark style="color:orange;"></mark><mark style="color:orange;">and</mark> <mark style="color:orange;"></mark><mark style="color:orange;">`AUTH: [empty]`</mark><mark style="color:orange;">.</mark>
* <mark style="color:orange;">OWE (Lab 1.1): Shows</mark> <mark style="color:orange;"></mark><mark style="color:orange;">`ENC: WPA3`</mark><mark style="color:orange;">,</mark> <mark style="color:orange;"></mark><mark style="color:orange;">`CIPHER: CCMP`</mark><mark style="color:orange;">, and</mark> <mark style="color:orange;"></mark><mark style="color:orange;">`AUTH: OWE`</mark><mark style="color:orange;">.</mark>
* Wireshark View: Open your `.pcap` file. Unlike Lab 1 where you could see HTTP POST data in plaintext , the OWE traffic will appear as 802.11 QoS Data and will be encrypted, making the data unreadable to the sniffer

#### Connecting the Client

Next, you simulate a client connecting to this encrypted "open" network.

* Start the Client: Use `wpa_supplicant` to connect an interface (e.g., `wlan1`) using the OWE configuration

```
network={
        ssid="SweetB-OWE"
        key_mgmt=OWE
        pairwise=CCMP
}
```

```
wpa_supplicant -i wlan1 -c owe.conf
```

* Observe the Handshake: Watch the output for `Key negotiation completed`. You will notice that while no password was entered, the system negotiates a PMKSA-CACHE and a PTK CCMP (encryption key).

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FCIeQQN44kxRyq4B5Wswf%2Fimage.png?alt=media&amp;token=1c7a52b7-e6f9-48fc-9cad-2dd80b5c7314" alt=""><figcaption></figcaption></figure>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2F5KVkdd3uHYOfDxz0PxjG%2Fimage.png?alt=media&amp;token=b2bcb4d5-c022-4182-9a6a-7d8f0c06849f" alt=""><figcaption></figcaption></figure>

#### Traffic Sniffing & Analysis

Now, use a 2nd radio to capture the traffic and analyze it.

Enable Monitor Mode:

```
airmon-ng start wlan2
```

Locate the Target: Scan all bands to find the channel and BSSID of `SweetB-OWE`:

```
airodump-ng --band abg wlan2mon
```

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FS1DNXXYYVCcbgQQNYAiL%2Fimage.png?alt=media&amp;token=0ef66e97-bb28-40c0-81bc-a503c1494fb9" alt=""><figcaption></figcaption></figure>

Capture to PCAP: Once you have the channel (`-c`) and BSSID (`--bssid`), start a focused capture:

```
airodump-ng -c <#> --essid SweetB-OWE --bssid <mac> -w <output.pcap> --output-format pcap
```

```
airodump-ng -c 6 --essid SweetB-OWE --bssid CE:9E:05:59:B3:CE -w output_owe --output-format pcap wlan2mon
```

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FQy7usQplHTLSxeAXD5bf%2Fimage.png?alt=media&amp;token=6bc03d75-8496-4377-93c8-cf20baea9469" alt=""><figcaption></figcaption></figure>

#### Key Takeaway

On a standard open network, any attacker can see your HTTP traffic in plaintext. In an OWE environment, even though there is no password, the traffic between the client and the AP is encrypted, protecting users from passive sniffing
