Dibble

Gaining Access

Nmap scan:

$ nmap -p- --min-rate 3000 -Pn 192.168.157.110
Starting Nmap 7.93 ( https://nmap.org ) at 2023-07-16 12:24 +08
Nmap scan report for 192.168.157.110
Host is up (0.17s latency).
Not shown: 65530 filtered tcp ports (no-response)
PORT      STATE SERVICE
21/tcp    open  ftp
22/tcp    open  ssh
80/tcp    open  http
3000/tcp  open  ppp
27017/tcp open  mongod

FTP accepts anonymous logins but there's nothing within it.

Web Enum -> Admin Takeover

Port 80 shows a blog about some web exploits:

Port 3000 shows a more dynamic incident reporting site:

I registed a new account and looked at the events:

Doesn't look super relevant. I checked Burpsuite, and noticed this cookie:

When decoded, it gives default. I changed it to a base64 encoded admin string, giving YWRtaW4=, which allows us to create logs.

RCE

The new log event specified that we can write code in it:

The X-Powered-By header specified that this was using Express, which is Javascript. Since we can directly write code, I tried putting in a Node.js reverse shell:

When we submit thiss, we get a reverse shell:

Privilege Escalation

cp SUID -> Root

cp is an SUID binary on this machine:

We can use this to overwrite files, just add this line into a copy of the current /etc/passwd:

Then, use cp to overwrite the existing /etc/passwd file and su to hacker with 'hello123':

Last updated