I found the creds user:123
in the source code. Analyzing the code I discovered a basic SQLi vulnerability:
If we put: hello' OR 1=0 -- -
weโve got it. I dumped all the tables, but didnโt found anything, so I managed that might be something harder. Inspecting he source further I found that an H2 Java SQL database was in use:
So I searched for โH2 database command injection through sqliโ, and found this article
- Iโve created a note about it :D โ H2 databases ๐ฅ
Basically, if I capture the petition with burp and Do intercept the petition I can modify the POST parameter and inject there an ALIAS:
- First I create the alias:
- Then I call it by inserting a command in the notes table (I spend two days to manage this out xd):
- Then I performed a UNION SQLi to check if the command output was written to the table:
BINGO, BANGO, BONGO! We got this!
So we can check the /
directory for the flag (it name is random):
So in my case, the flag is called JN8fe3XRqTYK_flag.txt
, so I cat it:
And got the flag!
Challenge completed!