Exploit-DB #34305
Description: Easy FTP Pro 4.2 iOS - Command Injection
Type: webapps
Platform: ios
Date: 2014-08-09
Author: Vulnerability-Lab

Exploit:
Document Title:
===============
Easy FTP Pro v4.2 iOS - Command Inject Vulnerabilities


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1291


Release Date:
=============
2014-08-06


Vulnerability Laboratory ID (VL-ID):
====================================
1291


Common Vulnerability Scoring System:
====================================
5.7


Product & Service Introduction:
===============================
The Best FTP and SFTP client for iPhone and iPad! Easy FTP is an FTP (File Transfer Protocol) and SFTP client for 
iPhone/iPod Touch. Easy FTP offer all the features of a desktop client. Also includes a web browser that allow to 
download files, audio player, mp4, avi,... video player, Dropbox, also helps you to access files on your remote 
computer (Mac, Windows, Linux), NAS Servers, and more.

( Copy of the Homepage: https://itunes.apple.com/en/app/easy-ftp-pro/id429071149 )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered two command injection web vulnerabilities in the official Easy FTP Pro v4.2 iOS mobile application.


Vulnerability Disclosure Timeline:
==================================
2014-08-06: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
Juan Ramon Rivero
Product: Easy FTP Pro - iOS Mobile Web Application 4.2


Exploitation Technique:
=======================
Remote


Severity Level:
===============
Medium


Technical Details & Description:
================================
Two local command inject web vulnerabilities has been discovered in the official Easy FTP Pro v4.2 iOS mobile application.
The vulnerability allows remote attackers to inject own commands by usage of misconfigured stored system/device values to 
compromise the apple mobile iOS application.

The first vulnerability is located in the vulnerable `foldername` value of the `easy ftp wifi` module. Local attackers are 
able to inject own malicious system specific commands or path value requests in the vulnerable `foldername` input value. 
The execution of the command occurs in the `File Dir Index Listing` module of the easy ftp pro v4.2 mobile application. 
The attacker is able to manipulate the local device values with physical or restricted acccess to compromise the mobile 
application by preparing to change the foldername. The encoding of the vulnerable values in the `File Dir Index Listing` 
module is broken.

The second vulnerability is also located in the `�asy ftp wifi` module. The same attack like on changing a foldername can 
be exploited by attacker through the regular filename validation. The attacker is able to manipulate the local device values 
with physical or restricted acccess to compromise the mobile application by preparing to change the filename.

The attack vector is located on the application-side and the injection requires physical device access or a local low 
privileged device user account. Local attackers are also able to exploit the albumname validation issue in combination 
with persistent injected script codes.

The security risk of the local command/path inject vulnerability is estimated as medium with a cvss (common vulnerability 
scoring system) count of 5.7. Exploitation of the command/path inject vulnerability requires a low privileged iOS device 
account with restricted access and no user interaction. Successful exploitation of the vulnerability results in unauthorized 
execution of system specific commands and unauthorized path value requests to compromise the mobile iOS application or the 
connected device components.


Request Method(s):
				[+] [Sync]

Vulnerable Module(s):
				[+] Add File & Rename File + Import
				[+] Add Folder & Rename Folder + Import

Vulnerable Parameter(s):
				[+] foldername
				[+] filename

Affected Module(s):
				[+] File Dir Index Listing


Proof of Concept (PoC):
=======================
The local command inject web vulnerabilities can be exploited by local attackers with low privileged or restricted device user account 
with physical access and without user interaction. For security demonstration or to reproduce the vulnerability follow the provided 
information and steps below to continue.


PoC #1:
--- PoC Session Logs [GET] (Execution) ---
Status: pending[]
GET http://localhost:8080/[LOCAL COMMAND INJECT VULNERABILITY!] Load Flags[VALIDATE_ALWAYS ] Gr��e des Inhalts[unknown] Mime Type[unknown]
   Request Header:
      Host[localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0]
      Accept[image/png,image/*;q=0.8,*/*;q=0.5]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Referer[http://localhost:8080/]


12:26:56.763[0ms][total 0ms] 

Status: 200[OK]
 GET http://localhost:8080/index Load Flags[LOAD_DOCUMENT_URI  ] Gr��e des Inhalts[unknown] Mime Type[unknown]
   Request Header:
      Host[localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
      Referer[http://localhost:8080/]


12:27:11.166[0ms][total 0ms] Status: Aus dem Cache geladen[Aus dem Cache geladen]
GET http://localhost:8080/# Load Flags[LOAD_FROM_CACHE  ] Gr��e des Inhalts[-1] Mime Type[unbekannt]
   Request Header:
      Host[localhost:8080]
      User-Agent[Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0]
      Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
      Accept-Language[de,en-US;q=0.7,en;q=0.3]
      Accept-Encoding[gzip, deflate]
  


PoC: Source Foldername - Fi