Exploit-DB #33627
Description: NG WifiTransfer Pro 1.1 - Local File Inclusion
Type: webapps
Platform: ios
Date: 2014-06-03
Author: Vulnerability-Lab

Exploit:
Document Title:
===============
NG WifiTransfer Pro 1.1 - File Include Vulnerability


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1260


Release Date:
=============
2014-04-28


Vulnerability Laboratory ID (VL-ID):
====================================
1260


Common Vulnerability Scoring System:
====================================
6.5


Product & Service Introduction:
===============================
The easiest way to transfer files between iPhones or with computers! WifiTransfer enables fast wireless file transfer between 
iPhones or with computers with a simple scan. WifiTransfer enables simple and ultra fast file transfer between iPhones over 
Wi-Fi networks. Without any additional setup, just a QRCode scan will do. The target iPhone doesn`t have to install WifiTransfer. 
An iPhone with an ARBITRARY scanner will do. (However, with WifiTransfer installed on the target iPhone, you will have better 
control on the transfer process.)  In addition to transfer files between iPhone/iPad, you can also remotely manage files on your 
iPhone right from your desktop computer. Supported browsers: Safari, Chrome, FireFox, Internet Explorer.

(Copy of the Homepage: https://itunes.apple.com/us/app/wifitransfer-pro-instant-file/id802094784 )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered multiple vulnerabilities in the official Notable Group WifiTransfer Pro v1.1 iOS mobile web-application.


Vulnerability Disclosure Timeline:
==================================
2014-04-28:	Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
Notable Group
Product: WifiTransfer Pro - iOS Mobile Application 1.1


Exploitation Technique:
=======================
Local


Severity Level:
===============
High


Technical Details & Description:
================================
A local file include web vulnerability has been discovered in the official Notable Group WifiTransfer Pro v1.1 iOS mobile web-application. 
The local file include web vulnerability allows remote attackers to unauthorized include local file/path requests or system specific path 
commands to compromise the mobile web-application.

The web vulnerability is located in the `filename` value of the `upload` module. Remote attackers are able to inject own files with malicious 
`filename` values in the `upload` POST method request to compromise the mobile web-application. The local file/path include execution occcurs 
in the `WifiTransfer File Management` listing context. The attacker is able to inject the local file include request by usage of the 
`wifi interface` or by a local privileged application user account via `file sync`(app).

Remote attackers are also able to exploit the filename validation issue in combination with persistent injected script codes to execute different 
local malicious attacks requests. The attack vector is on the application-side of the wifi service and the request method to inject is POST. The security 
risk of the local file include web vulnerability is estimated as high with a cvss (common vulnerability scoring system) count of 6.5.

Exploitation of the local file include web vulnerability requires no user interaction but a privileged web-application user account with low user auth. 
Successful exploitation of the local file include web vulnerability results in mobile application or connected device component compromise.

Request Method(s):
				[+] [POST] - Remote
				[+] [SYNC] - Local

Vulnerable Module(s):
				[+] WifiTransfer File Management (UI)

Vulnerable Function(s):
				[+] Upload

Vulnerable Parameter(s):
				[+] filename

Affected Module(s):
				[+] Index File Dir Listing (http://localhost:8080/)


Proof of Concept (PoC):
=======================
The local file include web vulnerability can be exploited by attackers without privileged application user account and low user interaction.
For security demonstration or to reproduce the file include web vulnerability follow the provided information and steps below to continue.

Manual steps to reproduce the vulnerability ...

1. Install the vulnerable wifi ios software app (https://itunes.apple.com/us/app/wifitransfer-pro-instant-file/id802094784)
2. Start the server and activate the localhost wifi server
3. Open the wifi interface in a browser or console > http://localhost:8080/
4. The the directory button to choose a file for a upload
5. Activate a session tamper to capture the request information to intercept
6. Click the upload button and inject your own path/file request inside of the filename value
7. Open the interface in the browser and the execution occurs in the file dir item listing context
8. Successful reproduce of the security vulnerability via wifi user interface!

Note: The inject is also possible via sync

1. Add a file in the device app interface
2. Inject the path request as payload in combination with script code and save
3. Activate the localhost wifi interface (web-server)
4. Open the interface in the browser and the execution occurs in the file dir item listing context
5. Successful reproduce of the security vulnerability via app sync!


PoC: 
<table class="table table-hover" cellpadding="0" cellspacing="0" border="0">
                    <thead>
                        <tr><th>Name</th><th class="del">Action</th></tr>
                    </thead>
                    <tbody id="filelist">
                    <tr><td><a href="/files/%3C./-[LOCAL FILE INCLUDE VULNERABILITY!].png" class="file"><img src="img/image.png" style="vertical-align:middle;"><span><./-[LOCAL FILE INCLUDE VULNERABILITY!].png.png</span></a></td><td class='del'><div><a href='/files/%3C./-[LOCAL FILE INCLUDE VULNERABILITY!].png' class='btn btn-info btn-