当前位置:网站首页>SQL injection vulnerability (bypass)
SQL injection vulnerability (bypass)
2022-06-25 11:18:00 【errorr0】
After learning SQL Injection principle 、SQL The type of Injection Then you can say SQL Inject I've got a general idea , But the fact is that in reality, developers can't let you attack the database so easily , They usually make certain restrictions on the data that has been entered or can be entered , This article is mainly about SQL Injected code or waf Make a summary of the filter bypass .
Case around
This is the simplest and most difficult way to bypass , There are two reasons to take advantage of :SQL sentence Case insensitive 、 The blacklist filtering done by developers is too simple .
Double writing bypasses
The principle of double write bypass is that the background uses regular matching to replace sensitive words with empty words . That is, if you filter select, We type in 123select456 Sensitive words will be detected , The last replaced string is composed of 123select456 ---> 123456. The bypass of this filter is also very simple, that is, double write select that will do , Such as :selselectect ---> select , One such filter will double write , Write three times twice, and so on . Here's an example :
You can clearly see the wrong information here ,or It should be filtered , We use the above bypass method ,
succeed , This is the same. Double writing bypasses Methods , Pretty simple .
Space filtering
If spaces are filtered , The main ideas are to find a substitute , There are several that can replace the blank space :
Note bypassing /**/ : Under normal circumstances, as long as this is not filtered, it can be replaced .
Bracket filtering () : All keywords are enclosed in parentheses to replace space separation, as follows ,
normal :select * from user
Brackets :(select)*(from)(user)
url code : You can try this kind of encounter . use %20 Instead of a space or something else url code
%09、%0a、%0b、%0c、%0d 、%a0、%00
Enter to replace : Carriage return and line feed can also be used as a separation function instead of spaces .
Tab replace :Tab It can be used as a separation function .
Comment filtering
When we come across something we usually use --+ Comment filtering , We can substitute the following notes for :
#、;%00、-- ( Two minus signs and a space )
Close with other data :
select * from user where id='1'
||
V
select * from user where id='1' or '1' ='1'
Quote filtering
There are two full versions of quote filtering , One is that quotation marks cannot appear 、 One is that it will be escaped , The escape processing method has been mentioned in the previous article, which is the bypass of wide byte injection , If you can't use quotation marks, you have to use quotation marks , You can bind the value of a parameter with single or double quotation marks and convert it to 16 At last, the decimal number is added before the input 0x*****.
Comma filter
There are functions or instructions that require commas , Therefore, the method of bypassing commas varies from function to function or instruction .
substring()
Don't worry about functions ,substr And substring almost . You can see that the comma is used directly from the above to the following from……for Instead of .
If you need to use mid() function , There are also comma bypass methods and substring() identical , use from……for Replace commas .
limit 0,1
limit 0,1 Comma in , So if the comma is filtered, our alternative is to use offset, namely
Pay attention here , If used offset, The data before and after the comma should be exchanged with each other .
union
In joint injection, we need select 1,2,3,4……, And if you filter commas, how do you go around here ? This is actually quite interesting , The joint query select 1,2,3,4…… After testing, it can be written separately as follows
After parentheses a、b、c It is casually named and omitted as Writing , Why should I write this ? In this way, you can filter commas , We use offset Instead, you can get ,
So the comma bypass of joint query is to use join Instead of .
Equal sign filter
If only the equals sign is filtered, the following can be used instead
<> : Not equal to !=
regexp、like、rlike
Logical operator filtering
It's filtered out or、and、xor、not The corresponding characters can be used instead of :&&、||、| 、!
If you can't use it, you can consider using The cartesian product (^),
This can be used directly and or These connectors .
Code bypass
Coding bypasses the tradition of telling the truth and is rarely used , But sometimes his use is really unexpected , So let's find out .
Hexadecimal bypass
Substitution of similar functions
1)sleep() <-->benchmark()
2)ascii() <-–>hex()、bin(), After substitution, use the corresponding base conversion string that will do
3)group_concat() <–->concat_ws()
4)substr() <--> substring() <--> mid()
5)user() <--> @@user、datadir–>@@datadir
6)ord() <-–> ascii(): These two functions have the same effect when dealing with English , But the processing time of Chinese is inconsistent .
Reference resources :SQL Inject a bypass pose _ Really strong ! The blog of -CSDN Blog _sql Inject from Bypass
SQL Bypass of injection filtration _12622800 Technology blog _51CTO Blog
SQL Injection bypass - redglare - Blog Garden
https://www.csdn.net/tags/MtTaEgwsMTY0OTk1LWJsb2cO0O0O.html#2_12
边栏推荐
- 16 种企业架构策略
- Spannable and editable, spannablestring and spannablestring
- MySQL synchronous data configuration and shell script implementation
- 一个数学难题,难倒两位数学家
- Jincang database kingbasees plug-in identity_ pwdexp
- Network remote access using raspberry pie
- 基于OpenStreetMap+PostGIS的地理位置系统 论文文档+参考论文文献+项目源码及数据库文件
- June 24, 2022: golang multiple choice question, what does the following golang code output? A:1; B:3; C:4; D: Compilation failed. package main import ( “fmt“ ) func mai
- Previous string inversion topic
- Free access to the global human settlements layer (ghsl) dataset from Gee
猜你喜欢
scrapy+scrapyd+gerapy 爬虫调度框架
Netease's open source distributed storage system curve officially became the CNCF sandbox project
Apache ShenYu 入门
【文件包含漏洞-04】经典面试题:已知某网站仅存在本地文件包含漏洞时,如何GetShell?
SystemVerilog (XIII) - enumerate data types
Jincang KFS data centralized scenario (many to one) deployment
基于SSH的高校实验室物品管理信息系统的设计与实现 论文文档+项目源码及数据库文件
Nuxtjs actual combat case
COSCon'22 讲师征集令
[observation] objectscale: redefining the next generation of object storage, reconstruction and innovation of Dell Technology
随机推荐
Kingbasees plug-in DBMS of Jincang database_ session
JVM 原理简介
Open source invites you to participate in the openssf Open Source Security Online Seminar
Handling of NPM I installation problems
Oracle彻底卸载的完整步骤
Handler、Message、Looper、MessageQueue
Database Series: MySQL index optimization summary (comprehensive version)
看完这篇 教你玩转渗透测试靶机Vulnhub——DriftingBlues-7
Cdn+cos ultra detailed steps for drawing bed construction
Daily 3 questions (3) - check whether integers and their multiples exist
报名开启|飞桨黑客马拉松第三期如约而至,久等啦
FPGA displays characters and pictures based on VGA
Is it safe to open a securities account in changtou school by mobile phone?
2022 PMP project management examination agile knowledge points (2)
GaussDB 如何统计用户sql的响应时间
基於Minifilter框架的雙緩沖透明加解密驅動 課程論文+項目源碼
Shen Ying, China Academy of communications and communications: font open source protocol -- Introduction to ofl v1.1 and analysis of key points of compliance
龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书
Ouverture de l'inscription | le troisième marathon des hackers de pagaie est arrivé comme prévu.
Arrays. asList()