Framing Attacks On Smart Phones and Dumb Routers: Tap-Jacking and Geo-Localization Attacks
Framing Attacks On Smart Phones and Dumb Routers: Tap-Jacking and Geo-Localization Attacks
Gustav Rydstedt
Abstract
page places frames on top of the victim page), drag-anddrop attacks [13], and scrolling attacks [13]. We discuss
these attacks in more detail later on in the paper.
The standard defense against framing attacks, called
frame busting, refers to code or annotation in a web page
intended to prevent the web page from being loaded in a
sub-frame [11]. The following simple frame busting code
is a commonly used:
if (top.location != location)
top.location = self.location;
A recent survey of clickjacking defenses on popular
sites [11] shows that only 14% of Alexa Top-500 implement some variant of frame busting. The survey also
shows that current methods can be easily circumvented
and proposes better frame busting methods.
In this paper we study framing attacks on mobile sites
and framing attacks on sites embedded in consumer electronics, specifically routers. We develop attacks showing that smartphones and routers are highly vulnerable
to framing attacks, much more so than regular browsers
and public web sites. Despite these significant vulnerabilities very few mobile and embedded sites defend themselves against framing. We also show that some framing
defenses, such as those employed by Facebook, prevent
standard clickjacking but can leak private user information.
Introduction
by NSF.
frame busts on the main site but not on the mobile site,
an attacker can frame the mobile site on a desktop client
and mount a framing attack of its choice on the site. For
example, if a user is logged into a web mail site on the
desktop, an attacker on the desktop browser can frame the
mobile version of the web mail site and use the users credential from the main site to send mail on behalf of the
user.
Clearly mobile sites should frame bust if the user agent
indicates a phone that supports frame busting. If this is
not possible for some reason then at the very least sites
should not share sessions between the main site and the
mobile site.
Framing Facebook. Facebook deploys an interesting
frame busting defense when framed the site places a
dark transparent div over the page (see Figure 3). This
div lets the user see the page contents, but any click on
the div causes the top window to navigate to Facebooks
main site. We show in Section 3 that although this frame
busting defense may protect against traditional clickjacking attacks, an attacker can still learn private information
about the users Facebook profile. Our approach makes
use of Stones scrolling technique [13]. We use specific
hashtags on the framed page to expose private information on the page (despite the same origin policy). We give
the details in Section 3.
Framing attacks on routers. We show that many popular wifi routers are vulnerable to framing and XSS attacks
that can be used to steal the routers WPA secret key and
to accurately locate the router on a map. Our attacks make
use of new same origin bugs in current versions of Firefox and Chrome. We were able to carry this out as an
automated attack on eight different brands of routers using a default password: Belkin, Netgear, D-link, Linksys,
Buffalo Zyxtel, SMC, TrendNet. The end result is that an
attacker can create an accurate world map of WPA keys
needed to access private wifi networks where wifi is available.
Phone TapJacking
In this section we introduce TapJacking a clickjacking attack that leverages the accessibility features implemented in mobile browsers. TapJacking illustrates the im2
2.1
The iPhone Safari browser supports all the basic functionality to pull off a classic clickjacking attack: transparency
and IFRAMEs. Transparency is supported through the
CSS opacity attribute in Safari Mobile. However, extra
features of the iPhone make the attack far more dangerous.
Zooming. On desktop browsers an attacker can ensure that the user clicks at the right place in the victim IFRAME. One approach is to consistently move the
IFRAME into place after a MouseMove event is detected
so that the mouse always points to the button that the
attacker wants clicked. Since this method is more difficult to pull off on the iPhone we instead use the iPhones
zooming functionality.
Recall that scaling on smart-phones is often done via
the viewport meta tag:
address bar point to a legitimate-looking URL. This problem is not an issue with TapJacking since on the phone an
attacker can cause the address bar to disappear. The following code hides the URL bar out of sight as soon as the
site is loaded by scrolling the URL navigation bar out of
the visible window:
<body onload="setTimeout(function()
{ window.scrollTo(0, 1) }, 100);">
</body>
An attacker can embed a picture of a fake URL address
bar in the framing page thereby making the page appear
to come from a legitimate site. Figure 2 gives an example.
The left figure shows the fake address bar under the real one. The middle figure
shows the fake URL replacing the real one. The right figure shows no URL bar.
Figure 2: Faking the URL bar
click either Close or Reply upon receiving a text message notification, they click without a second thought. In
Figure 1 clicking will not acknowledge the text message
but instead publish a tweet.
the attacker since sessions lay dormant for possible clickjacking attacks. A malicious link can be sent to the user
in an e-mail causing the browser to load a live session.
While analyzing the Alexa Top 100 top sites, we noted
that some mobile cookies expire further in the future
than their desktop counterparts. Presumably this is designed to minimize the number of times that the user
needs to login on a cell phone. Again, these longer lived
sessions help the attacker.
function touchMove(event) {
event.preventDefault();
}
Furthermore it is possible to dynamically position
the viewport by using the standard JavaScript function
window.scrollTo(x,y). This helps the attacker dynamically position the viewport window just above the
targeted button.
2.2
Session handling. Without a session to hijack clickjacking attacks are not very interesting. Sessions identifiers are often stored in session cookies. On desktop browsers, these session cookies expire when the user
closes the browser. This is not true on the iPhone as the
session persists when Safari Mobile is closed. This helps
Opera Mini. Opera Mini uses a proxy-rendering system to display webpages faster. Although Opera Mini has
growing JavaScript and CSS support we conclude that a
traditional clickjacking attack is not possible on the Opera
Mini (we tested on version 5.0.5 on the iPhone). Although
IFRAMEs are supported, changing their opacity and size
reliably is not. This makes the classic approach to clickjacking difficult since we cannot effectively redress clickable UI of the target page.
Framing Facebook
Router attacks
attacker uses Mozillas Location-Aware Browsing protocol [8] to geo-localize the router.
A video of our attack that implements all the steps
above in an automated fashion is available at http:
//ly.tl/v1. We tested feasibility of these attacks
on routers from Belkin, Netgear, D-link, Linksys, Buffalo
Zyxtel, SMC, TrendNet. All are vulnerable to drag and
drop framing attacks and at least 4 can be exploited directly by XSS.
Attacker
Victim
Router
4.1
4.2
To locate a router, our port scanner looks for all the probable IP addresses in the 192.168.* range. More precisely
our proof of concept scans the addresses in 192.168.*.1
and 192.168.*.254. We can easily extend this to all the
other private IP address ranges defined in RFC 1918, but
routers use a limited set of default IP addresses. When
XHRs (XMLHTTPRequests) are used to scan the network
we take advantage of their asynchronous nature to span
the 512 requests at once.
On IE, the port scanning is performed by spanning 512
invisible images and timing how long it takes before each
image event handler onerror is triggered. Every router
tested takes less than 3 seconds to answer whereas the
image timeout is 12 seconds which makes this technique
1 Since these bugs are still under review by Mozilla, we do not include
Firefox. (FF) is currently the best browser for attacking all the details here.
6
4.3
and hashtag only available while logged in. If the scrollbar is present the user is logged in, otherwise not. Note
that this attack works on every router since none of them
deploy frame busting defenses.
When an IP is found, we perform a series of tests to identify the type of router. This tells us what default passwords to try. We start first by scanning the router to see
if ports other than the web interface(80) are open. Due
to the Firefox bug mentioned earlier we have the ability
to conveniently tell if a router is using HTTP Basic authentication and if a candidate password succeeded. In
Chrome we take the conservative approach of brute forcing the HTTP authentication with all known default passwords before testing to see if it succeeded. We can do so
by sending authentication requests which will not notify
the user of a failed attempt by exploiting a bug in Chrome.
4.4
4.5
Once we are logged into the router, there are two options
of acquiring needed WIFI keys: a drag-and-drop framing
attack or an XSS injection attack.
XSS injection. If the router is vulnerable to XSS attacks,
the most straightforward way to steal the Wifi keys is to
inject code via a CSRF and capture information. The XSS
payload will do the following: First, open an iframe to
a page containing WPA key or MAC address (or other
useful information). Since the payload operates in the
same origin as the framed page it can freely read script
and DOM data from it. This data is then sent back to the
attacker using a cross-domain form request.
4.6
Geolocalization
Related Work
References
[1] H. Bojinov, E. Bursztein, and D. Boneh. XCS: cross channel scripting and its impact on web applications. In CCS
09: Proceedings of the 16th ACM conference on Computer and communications security, pages 420431. ACM,
2009.
[2] A. Bortz, D. Boneh, and P. Nandy. Exposing private information by timing web applications. In Proc. of WWW07,
pages 621628, 2007.
[3] S. Dalili. ross site url hijacking by using error object in
mozilla firefox. http://packetstormsecurity.
org/papers/general/xsuh-firefox.pdf,
May 2010.
[4] Gnucitzien.
More advanced clickjacking ui redress attacks.
www.gnucitizen.org/blog/
more-advanced-clickjacking-ui-redress-attacks/,
2008.
[5] R. Hansen. Clickjacking. ha.ckers.org/blog/
20080915/clickjacking.
This paper discusses a significant vulnerability in mobile web sites that is easily corrected by including frame
busting in these sites. Mobile web sites that do not use
frame busting are vulnerable to tap-jacking and expose
their users to unnecessary risk. We hope that our discussion of tap-jacking will encourage more sites to embed
frame busting in their web pages.
Beyond mobile sites, we studied the effectiveness of
overlay-based frame busting as used by Facebook. We
showed that while this defense may prevent traditional
click-jacking, it can result in exposure of private user information. When possible it is much safer to use traditional frame busting [11] that prevents user content from
rendering in a sub-frame of an unknown domain.
We also showed that web vulnerabilities, including
framing and XSS, can result in theft of a wifis WPA key
in routers that use a default password. As an added twist
we noted that Mozillas location-aware browsing protocol
can help the attacker determine the exact location of the
victims wifi network. While conceptually simple, getting
these attacks to work in practice took considerable effort.
The complexity of the attack may suggest that browsers
are getting better at protecting users from basic web exploits, however several holes such as drag-and-drop attacks still remain.