Pentesting joomla
Querying this API, we can see over 3 million Joomla installs!
Important Joomla files and directories
Spot the use of Joomla:
Interesting files:
- robot.txt
- the telltale Joomla favicon
Joomla version
For spotting the version we can:
1. Read the README.txt file
2. Fingerprint the version from JavaScript files in the media/system/js/ directory or by browsing to administrator/manifests/files/joomla.xml.
3. Obtain the cache.xml file. It is located at plugins/system/cache/cache.xml.
Run a generic scan with droopescan
Output:
Drive a generic scan with joomlascan:
Login page
Admin login page located at http://$target/administrator/index.php
Author login page located at http://$target/index.php/author-login.
The default administrator account on Joomla installs is admin, but the password is set at install time.
joomla-bruteforce
Install from:
And run:
the template feature
Once logged in, we can see many options available to us. For our purposes, we would like to add a snippet of PHP code to gain RCE. We can do this by customizing a template.
We may include this line in the error.php page
Once this is in, click on Save & Close at the top and confirm code execution using cURL.
Leveraging enumeration for escalating
Once we know the version of our joomla, we may find vulnerabilities attached to it.
For instance, version 3.9.4 is likely vulnerable to CVE-2019-10945 which is a directory traversal and authenticated file deletion vulnerability.
We can use this exploit script to leverage the vulnerability and list the contents of the webroot and other directories.