---
description: >-
  Reference:
  https://www.exploit-db.com/docs/english/22763-guidelines-for-pentesting-a-joomla-based-site.pdf
---

# Joomla Exploitation

## Enumeration

1. Check for unnecessary files like ; Joomla.xml, readme.txt, htaccess.txt – These kind of files store good amount of information within them and can be of great use in identifying whether site is using Joomla or not.
2. Try to locate the path of Configuration File; /configuration.php – This can obviously give you information about CMS used as well as other information about the installations etc.
3. Try to locate the path of Administrator’s login : /administrator/index.php – If this gives you an OK response, go ahead and have a look on the page. The default page for administrator’s login will most probably use some logo or text which might give you an idea of CMS.
4. Check meta in page source=> \<meta name="generator" content="Joomla 1.5 CMS!">
5. Joomscan - Owasp's script. `joomscan -u <host>`
6. Wappalyzer addon
7. Default creds=> `username:passwd`

## Vulnerability Scanning

1. **Joomscan =>** Will give an output of vulnerable themes/plugins, WAFs, common usernames, config files etc.\
   `apt install joomscan`\
   `joomscan -u <host>`
2. **Bruteforcing =>** nmap can do this by\
   `nmap -p80 --script http-joomla-brute –scriptargs 'userdb=users.txt,passdb=passwds.txt,http-joomla-brute.threads=3, brute.firstonly=true' IP_ADDRESS`
3. **Exploit-db =>** Or `searchsploit "joomla x.x.x"`
4. **Joomblah.py (Only for Joomla 3.7.0) =>** A script to exploit SQLi vulnerability (CVE 2017-8917) and dump credentials right away. MUCH MUCH FASTER than SQLMAP.

## Exploitation

1. **Method 1 =>** Tampering template page to gain reverse shell. Assuming we have successfully retrieved the admin credentials for a joomla CMS

<div align="left"><img src="https://62284611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSvRnuhl_P5WCd1fZEn%2Fuploads%2Fyqm7ej8HBfdpwK3Ucu40%2Fimage.png?alt=media&#x26;token=0a229ab8-79cd-447d-8ee3-f70f9173d9ee" alt=""></div>

You'll find a template section whose PHP/HTML code might be editable. Simply add your own php-reverse-shell code here (available by default in Kali, developed by PentestMonkey: **/usr/share/webshells/php**)

<div align="left"><img src="https://62284611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSvRnuhl_P5WCd1fZEn%2Fuploads%2FcFMq5GOIsKKtREjYRVZR%2Fimage.png?alt=media&#x26;token=b6b44279-a5d5-4f38-bc6f-c7f832e2c30e" alt=""></div>

Now set a netcat reverse listener and boom! Done!

![](https://62284611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSvRnuhl_P5WCd1fZEn%2Fuploads%2FY83Bc0OOSUbzJcnwa7gW%2Fimage.png?alt=media\&token=3bda72ac-53dd-442f-b236-d47fcf0cc60a)

**2) Method 2=>** Coming soon...
