sqli-labs lesson 24-25a

less 24:

  Note unable to return or jump page, then log on after the start because of the start-extracting file when sqli-labs

  logged-in.php file the same name as the file in question is incorrect.

  Direct re-extract all the while to replace all files.

  

  This clearance is injected secondary sorting paradigm. Sort secondary injection, also known as storage-type injection, is likely to lead to character sql injection

  First stored in the database when calling this character malformed again, it can trigger the sql injection.

 Ideas:

1. The request data packet, the data submitted in the form of construction of a browser or other software in HTTP request packets to the server for processing, submission may contain a hacker structure of the SQL statement or command.

The main role of the data information of the data information server 2. The application will be submitted hacker storage, usually stored in a database, save that provide the raw input data and respond to client requests to perform other functions for the application.

3. The hacker sends a second non-identical with the first information request data to the server.

4. After the server receives the second request message submitted by a hacker, in order to process the request, the server queries a database data already stored and processed, resulting in an SQL statement configured hackers first request or command executed in the server environment.

5. The data processing result information returned from the server performed by a hacker determination result data returned by the secondary injection exploits successful.

 

 

For example: to register an admin '# account, then log in to the account to change the password, then modify the password is admin user's password.

Sql statement becomes UPDATE users SET passwd = "New_Pass" WHERE username = 'admin' # 'AND password =', which is performed UPDATE users SET passwd = "New_Pass" WHERE username = 'admin'  

 

Let us assume that a known user name and password is admin admin.

First create an admin '# 123456 for the user and password

 

 Five seconds after the page automatically jump, log in with registered good account, and change the password for the 135 246

 

 

 

 

logout return to the main page, the admin user login with 135,246:

login successful! Situation and we said above principle the same, because there is a limit to this off length of the input string, it does not demonstrate the implementation of other commands

 

 

 

less 25: About WAF bypass

WAF (Web Application Firewall) web application firewall

In less 23 we are using; 00% instead of # or - + which are due to be replaced spaces

In less 25 is the same we look at the source code:

 

Here we can see and case-insensitive on or carried out and replace, replace all spaces.

So when we type with or and and fields to note here is the replacement function, there are two kinds of solutions:

1. double wrote:

  For example: orderby changed oorrder by, password changed passwoorrd, information changed infoorrmation

2. Alternatively or and and Symbols

  For example: or (given for basic injection) with && and || with

The following presentation: double write method WAF bypass injection (where # is a comment not seem so using - or +; 00%)

Determine echo fields:

 

 The remaining payload almost all the same, pay attention to the string with a double or written to directly attach the following results:

?id=0'union select 1,2,group_concat(concat('-',username,passwoorrd) from users) --+

 

 

Error injection method presentation:

Here || or replaced to, or use updatexml function:

?id=1' || updatexml(1,concat(0x7e,(select username from users limit 0,1),0x7e),1) --+

 

执行:?id=0' || updatexml(1,concat(0x7e,(select passwoorrd from users limit 0,1),0x7e),1) --+

 

 

 

less 25a

  Observation source:

 

 

 

 id parameter is not wrapped; the same is replaced by a space or and and case-insensitive.

And then the difference is not less 25 not closed in front of the 'payload can be constructed directly

 

Guess you like

Origin www.cnblogs.com/Zh1z3ven/p/12450997.html