TomGhost

Identify recent vulnerabilities to try exploit the system or read files that you should not have access to.

Scanning

Nmap

root@kali:~# nmap -T4 -p- -A -sV $IP
Starting Nmap 7.80 ( https://nmap.org ) at 2021-09-20 15:34 UTC
Nmap scan report for ip-10-10-65-241.eu-west-1.compute.internal (10.10.65.241)
Host is up (0.00050s latency).
Not shown: 65531 closed ports
PORT     STATE SERVICE    VERSION
22/tcp   open  ssh        OpenSSH 7.2p2 Ubuntu 4ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 f3:c8:9f:0b:6a:c5:fe:95:54:0b:e9:e3:ba:93:db:7c (RSA)
|   256 dd:1a:09:f5:99:63:a3:43:0d:2d:90:d8:e3:e1:1f:b9 (ECDSA)
|_  256 48:d1:30:1b:38:6c:c6:53:ea:30:81:80:5d:0c:f1:05 (ED25519)
53/tcp   open  tcpwrapped
8009/tcp open  ajp13      Apache Jserv (Protocol v1.3)
| ajp-methods: 
|_  Supported methods: GET HEAD POST OPTIONS
8080/tcp open  http       Apache Tomcat 9.0.30
|_http-favicon: Apache Tomcat
|_http-title: Apache Tomcat/9.0.30
MAC Address: 02:63:0C:81:BC:59 (Unknown)
Device type: general purpose
Running: Linux 3.X
OS CPE: cpe:/o:linux:linux_kernel:3
OS details: Linux 3.10 - 3.13
Network Distance: 1 hop
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

TRACEROUTE
HOP RTT     ADDRESS
1   0.50 ms ip-10-10-65-241.eu-west-1.compute.internal (10.10.65.241)

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 18.80 seconds

Enumeration

port 8080

tomcat server landing page

nothing interesting after directory busting

port 8009

8009/tcp open ajp13 Apache Jserv (Protocol v1.3)

ajp13 is vulnerable to LFI

here is the exploit Exploit-db

Credentials skyfuck:8730281lkjlkjdqlksalks

Initial Access

ssh

Looking at skyfuck’s home directory we can see a credential.pgp and we know from the box tags that this appears to be part of the challenge. We can also see tryhackme.asc which is the PGP private key block.

Privilege Escalation

Horizontal Escalation

lets extract passphrase from tryhackme.asc

  • extract hash

  • brute force it

passphrase alexandru

  • decrypt credential.pgp

Credentials merlin:asuyusdoiuqoilkda312j31k2j123j1g23g12k3g12kj3gk12jg3k12j3kj123j

Vertical Escalation

we can run /usr/bin/zip with NOPASSWD

zip | GTFOBins

Last updated