# Daily Bugle

{% embed url="<https://tryhackme.com/room/dailybugle>" %}

1. Ran a TCP Scan on the target via Nmap.

```bash
nmap -p 22,80,3306 -sC -sV 10.201.122.79
```

```
Starting Nmap 7.95 ( https://nmap.org ) at 2025-11-13 16:19 IST
Nmap scan report for 10.201.122.79
Host is up (0.23s latency).

PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 7.4 (protocol 2.0)
| ssh-hostkey: 
|   2048 68:ed:7b:19:7f:ed:14:e6:18:98:6d:c5:88:30:aa:e9 (RSA)
|   256 5c:d6:82:da:b2:19:e3:37:99:fb:96:82:08:70:ee:9d (ECDSA)
|_  256 d2:a9:75:cf:2f:1e:f5:44:4f:0b:13:c2:0f:d7:37:cc (ED25519)
80/tcp   open  http    Apache httpd 2.4.6 ((CentOS) PHP/5.6.40)
|_http-title: Home
|_http-generator: Joomla! - Open Source Content Management
|_http-server-header: Apache/2.4.6 (CentOS) PHP/5.6.40
| http-robots.txt: 15 disallowed entries 
| /joomla/administrator/ /administrator/ /bin/ /cache/ 
| /cli/ /components/ /includes/ /installation/ /language/ 
|_/layouts/ /libraries/ /logs/ /modules/ /plugins/ /tmp/
3306/tcp open  mysql   MariaDB 10.3.23 or earlier (unauthorized)

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 15.86 seconds

```

2. There was a `robots.txt`  file here which had a lot of delisted subdirectories. Only `/administrator` was the one that opened up.

   <figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FiEEJQnQ357GM2CFd4qtf%2Fimage.png?alt=media&#x26;token=f3f5cf37-c502-4436-94f1-677bf50caebe" alt=""><figcaption></figcaption></figure>

   &#x20;

I looked around to get the Joomla! version running on the target but couldn't find anything.

2. Next I ran a directory scan on the target using Gobuster.

```bash
gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -u http://10.201.67.34 -x php,txt,js
```

3. I got several subdirectories and files including `README.txt` which seemed useful.
4. I opened `README.txt` and saw the following.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2F29v1kwikOz2UawTZC5Aw%2Fimage.png?alt=media&#x26;token=d6eeb591-0dae-461b-a38f-2189030212a4" alt=""><figcaption></figcaption></figure>

5. In the first few lines of the README.txt I could see the Joomla version stated as 3.7.&#x20;
6. Next, I looked up online for relevant exploits for Joomla 3.7 and found a SQL Injection vulnerability.

{% embed url="<https://blog.sucuri.net/2017/05/sql-injection-vulnerability-joomla-3-7.html>" %}

7. I even found a Github script that automated the whole exploitation process.

{% embed url="<https://github.com/stefanlucas/Exploit-Joomla>" %}

8. I downloaded the script and ran it by supplying in the target URL as a parameter.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FK3bYYhmwvtfRapIda2HG%2Fimage.png?alt=media&#x26;token=8a48bf12-32ee-4224-98d0-06851c1c23d6" alt=""><figcaption></figcaption></figure>

9. Here I obtained all the credentials including the hashed password.&#x20;
10. I used John The Ripper to crack the hash as follows.

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

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FvE9iYq7Fx8HGlVajCU8L%2Fimage.png?alt=media&#x26;token=aa6b7108-21ee-47ed-ad91-6d899faeadeb" alt=""><figcaption></figcaption></figure>

11. `spiderman123` was the password of the user `jonah` . I visited the administrator login panel of joomla on the target and logged in using the credentials.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FtvNqbaBVkpzNikPVfrky%2Fimage.png?alt=media&#x26;token=e15ec4a0-40cb-409f-b5db-e4cdd7568fdc" alt=""><figcaption></figcaption></figure>

12. Next step was to obtain an initial foothold on the target for which I needed a reverse shell. I looked everyone on the admin panel and tried injecting PHP reverse shell code but nothing worked. After a while I checked the Templates section inside Extensions.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FN12TwIpgxPkw2LTGpJB0%2Fimage.png?alt=media&#x26;token=80aa6f41-7aba-450b-a190-666396b5b3f9" alt=""><figcaption></figcaption></figure>

13. There were two templates listed as follows

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FcEDAe0SEPDgR9wAjv7mY%2Fimage.png?alt=media&#x26;token=04ec4654-38ae-43e8-bf2a-c0e59e67886f" alt=""><figcaption></figcaption></figure>

14. Previously while checking the admin portal I had come across the templates section under configuration where Protostar was listed as the default template for the target website.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FLsrPx4RsxZw2k0VtApjB%2Fimage.png?alt=media&#x26;token=8610b064-279f-4d32-9ccb-7a797b7afb4f" alt=""><figcaption></figcaption></figure>

15. Hence I clicked on Protostar Details and Files.
16. There were a lot of files in the template hence I visited the `index.php` file.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2Fm8F9N548onUIanvalsZ0%2Fimage.png?alt=media&#x26;token=4f15d07c-8840-481f-8bbb-fa9922256afd" alt=""><figcaption></figcaption></figure>

17. Jackpot, here it was possible to execute malicious PHP code. Hence I picked up the pentestmonkey reverse shell and copied it here.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2F22TBrsKdiBffZXfRX4OQ%2Fimage.png?alt=media&#x26;token=0909a597-cecf-4535-9279-d5901bdbce3c" alt=""><figcaption></figcaption></figure>

18. Next, I visited the `index.php` page which was the home page on the target and simaltaneously initiated a Netcat reverse shell on my attacker machine.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FdZk3ymAL314vz9rY3NSe%2Fimage.png?alt=media&#x26;token=788f55ed-7112-4e01-be98-3bbf2f9eb93e" alt=""><figcaption></figcaption></figure>

19. Here, as you can see I had obtained the initial foothold on the target.
20. Next I enumerated the system and came across a `configuration.php` file inside `/var/www/html` .
21. I listed out it's contents and found the following

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2Fpya2PAY7efi3lKcpeLCo%2Fimage.png?alt=media&#x26;token=aa2c34a6-5108-4d5f-8866-1a6e9e5c939a" alt=""><figcaption></figcaption></figure>

22. There was a password given here along with `root` as the username. My initial approach was to try the credentials on `mysql` as there was a MariaDB server running on the target but it didn't work.
23. Previously while enumerated the system I had came across another user on the target by the name of `jjameson` . I tried using the given password to connect to the target via SSH as `jjameson` user.&#x20;

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FnNBevf8PjecGUTsNY8eJ%2Fimage.png?alt=media&#x26;token=1aa18c44-6aab-4162-984a-99889a6c5c9a" alt=""><figcaption></figcaption></figure>

24. I then obtained the user flag from the `home/jjameson` directory inside `user.txt`.&#x20;
25. The next objective was to gain root access to the target. The first thing I did was to run `sudo -l` .&#x20;

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FTpMVWSj4Q8mvs1JTehTj%2Fimage.png?alt=media&#x26;token=0d16fab1-48db-41b1-ab4e-53ffcc323a59" alt=""><figcaption></figcaption></figure>

25. Seems like I could run `yum` on the target. My next step was to check GTFObins for a relevant exploit for `yum`.

{% embed url="<https://gtfobins.github.io/gtfobins/yum/#sudo>" %}

26. I found the following two methods to get root shell.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FK2cZ4WzBrQHUv0uuQEKb%2Fimage.png?alt=media&#x26;token=a5cf4dca-e1a8-4c46-ae11-f694cf910741" alt=""><figcaption></figcaption></figure>

27. I initially tried the first approach but it didnt work hence I used the second exploit.&#x20;
28. I straightaway copied the whole codeblock into the SSH terminal and elevated to root.

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FDMDZScKpUQx9lim9JIsU%2Fimage.png?alt=media&#x26;token=a0b4415d-4bcc-4b52-8d03-23b88ccc1b0d" alt=""><figcaption></figcaption></figure>

29. The next obvious step was to get the root flag from `/root/root.txt`.&#x20;

<figure><img src="https://697415701-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGOxHHc65JQOToz8nkPKh%2Fuploads%2FREaW5woghjLZC2xJ4s3E%2Fimage.png?alt=media&#x26;token=3c578348-04af-477a-9dcf-7c3131827f85" alt=""><figcaption></figcaption></figure>

30. And that was it!

Stay tuned for more writeups in the future.

Happy Hacking!
