I noticed something interesting at port 111: rcpbind, so I enumerated it:
Portmapper
Info
Portmapper is a service that is utilized for mapping network service ports to RPC (Remote Procedure Call) program numbers. It acts as a critical component in Unix-based systems, facilitating the exchange of information between these systems. The port associated with Portmapper is frequently scanned by attackers as it can reveal valuable information. This information includes the type of Unix Operating System (OS) running and details about the services that are available on the system. Additionally, Portmapper is commonly used in conjunction with NFS (Network File System), NIS (Network Information Service), and other RPC-based services to manage network services effectively.
Default port: 111/TCP/UDP, 32771 in Oracle Solaris
I didnโt find anything from here, so I checked the port 80 and looked at the website:
It says that IRC is almost working, so might be an IRC channel on the back (note that thereโs also port 8067 in use):
We can notice that the Unreal IRCD version is 3.2.8.1
Weaponization
If we search in google โUnreal IRCD 3.2.8.1 exploitโ we find the following Metasploit exploit
It has the following function:
It seems that the exploit first connects to the target, sends AB; + perl shell + \n
Exploitation
Basically, I can connect with netcat to the machine, execute the previous payload and get a reverse shell.
Weโve got a reverse shell :D
Lateral Movement
Inspecting the /home directory I found the following:
Think I got the some steganography challenge. I think that this pass might be the one for the initial image at the website:
So now I got creds: djmardov:Kab6h+m+bbp2J:HG
Got user flag :)
Privilege Escalation
I manually enumerated SUID binaries:
I noticed one that itโs not a Debian default:
I donโt know what that is, so I executed file /usr/bin/viewuser:
Seems to be some kind of ELF program. Iโll copy it to my machine using scp:
Now execute ltrace to see what the binary did:
So if I execute it:
It says that /tmp/listusers is not found. Iโll create it:
Now I get a permission denied. Iโll add execute permissions to /tmp/listusers:
Well, now I can execute commands as root. I can get a reverse shell like: