Irked HTB
IP
Let's start with our initial Nmap scan
we can see we have the following ports open
22,80,111,6697,8067,50932,65534
Lets run a more in-depth scan
Results
We do find the hostname irked.htb we can add this to our hosts file
HTTP Port 80
When we navigate to the web server we can see the following
we can confirm this is a Debian based server
and the Apache version matches that of the Nmap scan: Apache
2.4.10
Let's get feroxbuster running and see if we can find any interesting directories
we do find
Doesnt lead anywhere interesting but would be classed as information disclosure
Since this mentions IRC not a bad place to start enumerating
What is IRC protocol?
Internet Relay Chat is a text-based chat system for instant messaging between internet-connected computers, designed for group communication in forums, and one-on-one communication via private messages
IRC generally runs on the following ports
6667, 6697
We can see from our nmap scans it is running a service called UnrealIRCd
UnrealIRCd is an open-source IRC daemon that utilises the following ports
6697
8067
65534
We can enumerate this daemon
Lets check for the service version using netcat
No luck
After abit of reading we can connect to the service using a random nick name so lets try
we can see the version number Unreal3.2.8.1
After abit of googling we can be certain this version is vulnerable to RCE due to a backdoor in the software
Now lets exploit this and gain a shell on the system
we can use the following script
Lets start a netcat listner
we need to make some slight modifications to the script
add our local ip and port for the shell to connect back to
Now we should be able to run the script
we know have a shell on the target
Priv Esc via ircd
First lets upgrade our shell
Lets find the version of debian
Lets find the kernel version
Lets check for any other users on the system
looks like there is one other user on the system
djmardov
Lets find what groups we are in and the user djmardov
Results
Lets see if we can find any interesting files within the system
SUID files
Lets search for files with keywords and certain extensions
we do find something interesting
When we read the file we can see a password
djmardov: UPupDOWNdownLRlrBAbaSSss
We saw ssh is available on the machine
we get a Permission denied might only be acssesible by ssh keys
Lets see if we can just su into the user
No luck again
hmmmm
It took me a minute to notice the sentence super elite steg backup pw
so stegenography, weird how the main page of the website only had an image could this be where our password is located
Let's download the image from the main web page
Now lets run steghide with our newly found password
there was a
pass.txt
file located in the image
We know have the password Kab6h+m+bbp2J:HG
Lets see if we can ssh into the machine now
it worked!
Priv Esc via djmardov
Now that we have a ssh session let's start enumerating
when we previously tried to find SUID bits there was one file that looked interesting
Why does this program have the SUID bit set
when we run it
it fails because there is no file named
/tmp/listusers
can we just create one and gain a root shell
Now if we run the viewuser
programs we should get a root shell
and we do!!
Last updated