🫥WifineticTwo HTB Walkthrough

Reconnaissance

Scanning

I started by scanning the target machine using the following command:

The scan revealed several open ports:

Website Analysis

Upon accessing the website running on port 8080, I discovered that it was an OpenPLC login page. After a quick search, I found that the default credentials openplc worked for authentication.

Exploitation

Exploitation Attempt

I attempted to exploit the OpenPLC interface for remote code execution (RCE) using a known exploit for OpenPLC v3. However, the attempt failed during the login phase.

Manual Exploitation

Proceeding manually the previous exploit, I navigated to the "programs" section of the OpenPLC interface and uploaded a custom PLC program.

Next, I modified the hardware script to include a reverse shell payload and saved the changes.

After setting up the reverse shell payload, I initiated a listener on port 1234 and started the PLC .

Successfully obtaining a reverse connection, I was able to retrieve the user flag.

Root Flag

I noticed that the machine name was related to Wi-Fi access points (APs). Upon checking the network interfaces, I discovered the "wlan0" interface.

Investigating further, I found an available wireless network with WPS enabled.

WPS Exploitation

I utilized a script called OneShotarrow-up-right to exploit the WPS vulnerability.

Now, let's connect to it.

The connection is established, but there is no address.

let set it

We know that the default AP address is usually 192.168.1.1. I tried to connect to it over SSH, but it fails due to some terminal issue. Then I changed my shell.

Success!

Last updated