🧱TryHack3M: Bricks Heist

License

The following post by anthonyjsaab is licensed under CC BY 4.0

0 - Introduction

Link to room: https://tryhackme.com/r/room/tryhack3mbricksheist

Machine version: Brick.By.Brick.v.2.1

This writeup walks you through a room on TryHackMe created by tryhackme, umairalizafar, ujohn, and l000g1c

1 - Port Scan

1a - Discovery

┌──(kali㉿kali)-[~]
└─$ sudo nmap -sS -T4 -p- 10.10.212.66
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-05-03 13:36 EEST
Nmap scan report for bricks.thm (10.10.212.66)
Host is up (0.13s latency).
Not shown: 65531 closed tcp ports (reset)
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https
3306/tcp open  mysql

Nmap done: 1 IP address (1 host up) scanned in 482.02 seconds

1b - Versioning and OS fingerprinting

We can see that Apache is running on port 443, and that Wordpress is installed on that server.

1c - Vulners

Nothing interesting in the above output

2 - Wordpress (443)

This is very interesting: a very recent unauthd RCE vulnerability has been detected on the target server.

3 - Foothold

3a - Metasploit

If we Google about the RCE vuln we found, we can see that Rapid7 already added an exploit to Metasploit: https://www.rapid7.com/db/modules/exploit/multi/http/wp_bricks_builder_rce/

3b - First flag

3c - Going from meterpreter to stable shell

Something very annoying is happening: every time I try to spawn a shell using meterpreter, or try to execute any command on the target machine, the meterpreter session dies.

That is why I chose to go with another exploit implementation:

4 - Looking around

We are supposed to find the name of a suspicious process. ps-aux does not give any useful info. However, if we list services, we find: (grepping because output is too huge without it)

The above outputs the name of a service, not the process that is executec by this service:

5 - Digging into the miner

A Bitcoin wallet address!

Last updated

Was this helpful?