Let’s add 10.10.11.13 runner.htb
to hosts.
Let’s check webpage:
Looks like basic landing page. Let’s FUZZ on domain:
After looking up about Nagios NSCA that is running on port 8000 I found nothing interesting. Let’s scan for subdomains:
Let’s add that to our hosts entry. So it will be 10.10.11.13 runner.htb teamcity.runner.htb
Here obviously we see jetbrains teamcity.
We see that version is 2023.05.3
Let’s search exploit for it cause it’s the only idea I have.
So we see RCE! Let’s try that exploit.
To copy it just run searchsploit -m 51884
And we will use that creds to login!
I tried playing with ssh keys
but nothing worked…
Let’s try creating and downloading a backup
So in backup I found key that I created and original id_rsa
Let’s run chmod 600 id_rsa
And use it to connect thru ssh.
So we got user flag! Let’s now become root.
sudo -l
requires password
- nothing interesting in home dir
- the only interesting thing is
/opt/portainer
Then I remembered that I saw local server in teamcity so it could be a good idea to check local ports.
-
port 22
is ssh
-
port 80
is landing page
-
port 53
is dns
-
port 9443
is some kind of port for SSL, seems unrelated
-
port 8111
is teamcity server, not interesting
-
port **9000**
is uncommon and might be interesting
-
port 5005
is some kind of “RTP control protocol”, seems unrelated
Let’s check port 9000.
So it’s running portainer! I will need to somehow access that port with my browser.
After a bit of research I found that: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding
So let’s end our ssh session and start another with port 9000 forwarded!
ssh -L 9000:localhost:9000 [email protected] -i id_rsa
After trying some creds I wasn’t able to connect. Maybe we can find some creds in backup?
Let’s search for john and matthew that we saw before
In database_dump
I found users
here are password hashes! Let’s try crack all of them
We need to edit this file a bit:
And we run john users --wordlist=/usr/share/wordlists/rockyou.txt
Got password! Let’s use it
We’re in!
I tried to connect into container and check maybe flag is there, but no
I found this
After following this and just creating new container I was able to get root flag!