SQL injection bypass means (study notes)

A case filter
column, such as: the filtration and, order by character and the like
can change the case AnD 1 = 1 OrdER be bypassed

Write double bypass
If the keyword appears after the program replacement is empty, SQL injection does not occur, for this filtering policies can be used to bypass the double write

For example, there is a keyword union is replaced by empty, we can use double the bypass UNIunionON

Bypassing coding
using URl network line coding, filtering mechanism to bypass SQL injection
http://tool.chinaz.com/Tools/URLEncode.aspx?qq-pf-to=pcqq.temporaryc2c
Here Insert Picture Description
within the chain bypassed comment
/ * union select * / comment will not be executed inside the content
/ *! union select * / will execute the contents inside

Sql comment character removed bypassing injection
mysql comment character:

  1. Single-line comments: - + or - spaces or #
  2. Multi-line comments: / ** /

In the Notes SQL injection process, play closed, double quotes single quotation marks, parentheses single, multi-functional bracket

Filter function
preg_replace (mixed $ pattern, mixed $ replacement, mixed $ subject); performing a regular expression search and replace

$ pattern: pattern to search for, can be a string or an array of strings
$ replacement: The replacement string or array of strings
$ subject: To search target character string or an array of alternative

For example:
preg_replace (SELECT, 1, select456) appears to select select456 replace 1 becomes 1456

See section filtering code, the input # id parameter passing in - will be replaced with nothing, can not be used to annotate these two
Here Insert Picture Descriptionwe can use or '1' = '1 comes close bypass single quote

Open Range Input '- + can be seen being given, the content did not commented later
Here Insert Picture Descriptionuse' or '1' = '1 successfully bypass
Here Insert Picture Descriptioncan be injected
/ sqli-labs-master / Less -23 / id? = -1 'union select 1, database ()' 3
Here Insert Picture Descriptionfrom bypassing the filter and SQL injection and or
view the code, and will be replaced and the empty or
Here Insert Picture Descriptionbecause later added a i, represents a case insensitive, bypassing sensitive exclude

Can be written using a double bypass oorr, two sensitive words add a comment to a / ** / nd, instead of using the symbols
and - && or- ||

Open Range normal injection, error or no
http://192.168.127.128/sqli-labs-master/Less-25/?id=1%27%20or%201=1%20-+
Here Insert Picture Descriptionuse || successful bypass
Here Insert Picture Description
around SQL injection by removing spaces
to view source code range, a lot of SQL injection filter to use characters, symbols and spaces
Here Insert Picture Descriptionto bypass the space strategy
encoding: hex, urlencode space URL encoding% 0a% 09 TAB key
% 0a create a new row
% 0c new page
% 0d return function
% 0b TAB construction (vertical)

Open range
input, the filter can be seen
Here Insert Picture Descriptionreplacing the space is replaced by% 0d or bypassing || success
/ sqli-labs-master / Less -26 /? Id = 1 '% 0d ||' 1
Here Insert Picture Descriptionbypass the union removed SQL injection and select
to view the source range, s tabular case sensitive, and there is no filtering and or
Here Insert Picture Descriptionsensitive bypassed
Here Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture Description

Published 15 original articles · won praise 0 · Views 150

Guess you like

Origin blog.csdn.net/weixin_45291045/article/details/105282378