Popular Science 1 in mysql brute-force and error Injection

Source: Internet
Author: User

Two examples of the old SQL Injection Vulnerabilities of uchome were extracted. The vulnerabilities were published a long time ago. Both of them are in the personal data update process:

 

The content of the code KEY that registers the variable directly enters the $ inserts array.

Foreach ($ _ POST ['friend'] as $ key => $ value ){

$ Value = intval ($ value );

$ Inserts [] = "('base', '$ key',' $ space [uid] ',' $ value ')";

}

Directly go to the VALUES of the INSERT statement.

If ($ inserts ){

$ _ SGLOBAL ['db']-> query ("delete from ". tname ('spaceinfo '). "WHERE uid = '$ space [uid]' AND type = 'base '");

$ _ SGLOBAL ['db']-> query ("insert into". tname ('spaceinfo'). "(type, subtype, uid, friend)

VALUES ". implode (',', $ inserts ));

 

.................

 

The content of the code KEY that registers the variable directly enters the $ inserts array.

Foreach ($ _ POST ['info'] as $ key => $ value ){

$ Value = getstr ($ value, 500, 1, 1 );

$ Friend = intval ($ _ POST ['info _ friend'] [$ key]);

$ Inserts [] = "('$ space [uid]', 'info', '$ key',' $ value', '$ friend ')";

}

Directly go to the VALUES of the INSERT statement.

If ($ inserts ){

$ _ SGLOBAL ['db']-> query ("delete from ". tname ('spaceinfo '). "WHERE uid = '$ space [uid]' $ _ SGLOBAL ['db']-> query (" insert ". tname ('spaceinfo ')."

(Uid, type, subtype, title, friend)

VALUES ". implode (',', $ inserts ));

 

 

After analyzing the code, we can find that there are two INSERT-type SQL Injection statements, and the $ key-registered variables can construct SQL statement injection, but this will be affected by GPC, however, keys of super global variables such as $ _ POST in earlier versions of PHP are not affected by GPC.

 

Here I use the HTTP Editor and HTTP Sniffer of Acunetix Web Vulnerability plugin.

 

 

As uchome continues some of discuz's security measures, the submitted requests verify formhash. We need formhash to construct the request, use HTTP Sniffer to capture the request package on the personal settings page, and right-click to edit the package.

According to the context analysis of the code, we need to construct

Request URL: cp. php? Ac = profile & op = info

Request Parameter profilesubmit formhash info

After these variables and conditions are met, you can enter the SQL injection vulnerability code segment of the program.

 

From: black box of RAyh4c

Popular Science 2 http://www.bkjia.com/Article/201108/100723.html of mysql brute-force Injection
Popular Science 3 http://www.bkjia.com/Article/201108/100724.html of mysql brute-force Injection

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.