Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2025-01107
- Vendor: 淡江大學推廣教育處
- Title: 淡江大學推廣教育處 SQL Injection via INTO OUTFILE Leading to Remote Code Execution
- Introduction: SQL Injection via INTO OUTFILE Leading to Remote Code Execution
處理狀態
目前狀態
公開
Last Update : 2025/09/09
-
新提交
-
已審核
-
已通報
-
已修補
-
已複測
-
公開
處理歷程
- 2025/09/02 10:19:32 : 新提交 (由 yusheng 更新此狀態)
- 2025/09/03 14:37:06 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/03 17:06:49 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/03 17:06:49 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/03 17:06:49 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2025/09/04 13:12:16 : 複測申請中 (由 組織帳號 更新此狀態)
- 2025/09/05 21:34:24 : 確認已修補 (由 yusheng 更新此狀態)
- 2025/09/09 03:00:14 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2025-01107
- 通報者:cat1528985 (yusheng)
- 風險:嚴重
- 類型:遠端命令執行 (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
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)
相關網址
透過 SQLi 上傳的 shell.php:
https://w2.dce.tku.edu.tw/shell.php?cmd=whoami
SQLi 的 Entry Point:
https://w2.dce.tku.edu.tw/plugins/validationEngine/check_member_id.php?fieldValue=%27
https://w2.dce.tku.edu.tw/shell.php?cmd=whoami
SQLi 的 Entry Point:
https://w2.dce.tku.edu.tw/plugins/validationEngine/check_member_id.php?fieldValue=%27
敘述
重現漏洞方式:
- 進到註冊頁 https://w2.dce.tku.edu.tw/register.php
- 發現在 "身分證字號" 欄位注入單引號,會看到 SQL Error Message,背後戳的 API 是 https://w2.dce.tku.edu.tw/plugins/validationEngine/check_member_id.php?fieldValue=%27 ,在 fieldValue 可以注入 SQLi Payload
- 可透過
INTO OUTFILE寫入 PHP 到 webroot(D:\xampp\htdocs)
P.S.[null, false]是這隻 APIcheck_member_id.php固定會回傳的內容,這隻 API 應該是檢查 "身分證字號" 有沒有被使用過的,總之看到此內容 = SQL 語法成功執行 - 訪問上傳的 PHP 後,成功執行
影響:
RCE 可以控制整台主機,包含(但不限於)以下
- 提取 DB 內所有資料
- SSRF
- 內網滲透
- 讓 Web 服務中斷
- 建立持久化後門
- 提取 D:\ 內所有的資料
修補建議
1. 使用 Prepared Statement 替代字串拼接
2. https://w2.dce.tku.edu.tw/shell.php 請刪掉
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。