Post

HTB Linux Easy: PC

PC is an Easy rated Linux machine on HTB.

HTB Linux Easy: PC

Nmap

Pasted image 20240715111019.png

Initial foothold

Googling for services that use port 50051 we get gRPC, to interact with a gRPC instance we can use grpcui. Pasted image 20240715111015.png

We get the following page when we browse to the URL. Pasted image 20240715111011.png

We are able to register an account on this page. Pasted image 20240715111007.png Pasted image 20240715111003.png

We can log in to the application using our registered account. Pasted image 20240715110957.png

We need to supply our token for the getinfo method to work, the id parameter also looks vulnerable to SQLi. Pasted image 20240715110952.png

Go into Burp and save the request. Pasted image 20240715110947.png

Supply the request to sqlmap and set the payload to the id parameter: sau:HereIsYourPassWord1431. Pasted image 20240715110943.png Pasted image 20240715110940.png

Lastly we can SSH into the machine as the sau user. Pasted image 20240715110936.png

Priv Esc

Nothing in particular stood out after running Linpeas except for a service on port 8000 that could only be accessed from the localhost. Pasted image 20240715110932.png

Curling the webpage with redirect enabled we see that the page uses pyload. Pasted image 20240715110926.png

Since we already have shell access to the system we can verify what version of pyload is running. Pasted image 20240715110919.png

In this case RCE, let’s create a rev shell script on the target system that we will execute using the RCE vuln. Pasted image 20240715110915.png

Before executing our payload we will set a nc listener to catch our reverse shell. Pasted image 20240715110905.png

Let’s get a shell now. Pasted image 20240715110859.png Pasted image 20240715110855.png

User.txt

Pasted image 20240715110851.png

Root.txt

Pasted image 20240715110846.png

Pwned

Pasted image 20240715110842.png

Sources

This post is licensed under CC BY 4.0 by the author.