Irked
Last updated
Was this helpful?
Last updated
Was this helpful?
Initial Foothold : Exploit of UnrealIrcd vulnerability
Privilege Escalation : SUID Bit was enabled on viewuser command
Starting with full port scanning
There was nothing important on webpage
This was showing that IRC is working and from our nmap scan we confirmed that UnrealIRC was running on port 6697 and 8067
Lets search this on google
Got some exploits
Got exploits for vulnerable version of IRC
Lets use exploit from github for getting reverse shell
I used the above exploit for exploiting this version of IRC
This exploit requires to change the local ip and local port in its script
Lets run this exploit and before setup netcat listener at port 80
Got the shell as ircd user
Lets find out which command has suid bit enabled
viewuser is looking non-standard command that has SUID bit enabled
Lets run that command
After review the output this command was trying to run binary listusers in /tmp folder
and there wasn't any listusers binary in /tmp folder
may be we can create our own executable binary named listusers in /tmp folder then we will run the command viewuser again and as suid bit is enabled this command will run as root user and we will have root shell
Write code in C for getting root privileges
Then compile the above code and put the binary with name listusers in /tmp folder
now again re-run the viewuser command
And got the root access
Simply create binary using bash scirpt
Got the shell as root user
That's all for this box
Thank you :)