Rapid7 Vulnerability & Exploit Database

elFinder PHP Connector exiftran Command Injection

Back to Search

elFinder PHP Connector exiftran Command Injection

Disclosed
02/26/2019
Created
03/19/2019

Description

This module exploits a command injection vulnerability in elFinder versions prior to 2.1.48. The PHP connector component allows unauthenticated users to upload files and perform file modification operations, such as resizing and rotation of an image. The file name of uploaded files is not validated, allowing shell metacharacters. When performing image operations on JPEG files, the filename is passed to the `exiftran` utility without appropriate sanitization, causing shell commands in the file name to be executed, resulting in remote command injection as the web server user. The PHP connector is not enabled by default. The system must have `exiftran` installed and in `$PATH`. This module has been tested successfully on elFinder versions 2.1.47, 2.1.20 and 2.1.16 on Ubuntu.

Author(s)

  • Thomas Chauchefoin
  • q3rv0
  • bcoles <bcoles@gmail.com>

Platform

PHP

Architectures

php

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/unix/webapp/elfinder_php_connector_exiftran_cmd_injection
msf exploit(elfinder_php_connector_exiftran_cmd_injection) > show targets
    ...targets...
msf exploit(elfinder_php_connector_exiftran_cmd_injection) > set TARGET < target-id >
msf exploit(elfinder_php_connector_exiftran_cmd_injection) > show options
    ...show and set options...
msf exploit(elfinder_php_connector_exiftran_cmd_injection) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;