> For the complete documentation index, see [llms.txt](https://itszaiden.gitbook.io/pentesting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://itszaiden.gitbook.io/pentesting/writeups/dockerlabs/easy/paradise.md).

# Paradise

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2Fm8RS5CQi1HJMxCnJMvlU%2F%7B4B4E2EFE-3E95-4973-B299-F762DD145395%7D.png?alt=media&amp;token=f4d272c6-982d-41b8-ac66-b4ea7d93e1ad" alt=""><figcaption></figcaption></figure>

## 1 - Reconnaissance

We begin with a fast Nmap scan to identify open ports:

`nmap 172.17.0.2 -p- --open -sS -Pn --min-rate 5000 -T5`

**Result: ports 22, 80, 139 and 445 are open.**

## 2 - Enumeration

Now we run a service/version detection scan, targeting only the open ports we found on the previous scan:

`nmap 172.17.0.2 -p 22,80,139,445 -sS -Pn -sCV`

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2FVn1gE3vKx3PfGfR9IsuP%2Fimage.png?alt=media&amp;token=63b865b3-b1c9-454f-be0f-e7e78f4e14ba" alt=""><figcaption></figcaption></figure>

Using `enum4linux` we found 2 system users, `andy` and `lucas`:

![](https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2FT12OcUOUNlcU6uq2kLMi%2Fimage.png?alt=media\&token=ca0d8a35-bfda-4f0e-b1d1-a11631b5f082)

We tried to find exploits or shellcodes using `searchsploit` but there wasn't any. Our next step will be directory enumeration. Using our tool `ffuf-dir`:

```
ffuf-dir () { ffuf -u $1 -w /usr/share/wordlists/dirb/big.txt ${@: 2} -e .html,.php,.txt }
```

we ran `ffuf-dir http://172.17.0.2/FUZZ` and we found the following routes:

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2FEvdKHohufGHATVnk10Al%2Fimage.png?alt=media&amp;token=e10eebf6-baac-4b48-a722-190aefdf5707" alt=""><figcaption></figcaption></figure>

Browsing the website we found this Base64 string containing `estoesunsecreto`:

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2FiT5Vw3bAhp2VSxg2uQWs%2Fimage.png?alt=media&amp;token=b2d0e054-f0e3-4811-883a-1f2ae5d8c6d7" alt=""><figcaption></figcaption></figure>

After browsing `172.17.0.2/estoesunsecreto` we found the following message:

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2F71Xo9J07163x1pG4Y3oL%2Fimage.png?alt=media&amp;token=cf057e18-92c4-44af-a5b0-18aa2b8c9453" alt=""><figcaption></figcaption></figure>

## 3 - Exploitation

Knowing that information, we decided to perform an `hydra` attack on `lucas` account, using `rockyou.txt` as wordlist, finding `lucas:chocolate`.

Pasted image 20260411124031.png

## 4 - Privilege Escalation

After logging in through SSH as `lucas` we ran `sudo -l`, finding this users has sudo permissions as `andy` on `/bin/sed`. Looking on GTFOBins we find the following exploit, obtaining us an `andy` shell:

```
sed -n '1e exec /bin/sh 1>&0' /etc/hosts
```

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2FpHT6DOHIqqPEImocmPrf%2Fimage.png?alt=media&amp;token=fb2afbac-9fe4-417d-a60e-9aef891b62aa" alt=""><figcaption></figcaption></figure>

We ran `find / -perm -4000 2>/dev/null` and found the following:

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2FGJ2hzmnaAM3gW82RTzRp%2Fimage.png?alt=media&amp;token=1252db49-28f3-4c05-9901-1cf8a1d6b59f" alt=""><figcaption></figcaption></figure>

That `backup.sh` is interesting for us, since it's checking if there is a file on `/tmp/cron-vuln.sh` and then executes it.

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2FKX8bzDWKPsQSFbQSnuzt%2Fimage.png?alt=media&amp;token=f41c15c3-f54b-460c-afce-a4b67fbec8fe" alt=""><figcaption></figcaption></figure>

Sadly, after researching and trying many ways to get `cron-vuln.sh` hijacked we discover it's a rabbithole. After running `/usr/local/bin/privileged_exec` we instantly get a `root` shell:

<figure><img src="https://438683079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIbHEScEP34huXd5EXNdb%2Fuploads%2F0scsZ4023c1HvtstmoRo%2Fimage.png?alt=media&amp;token=de45c49e-7e61-45bf-bb89-422800dab544" alt=""><figcaption></figcaption></figure>
