Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Imperial Journal of Interdisciplinary Research (IJIR)

Vol-3, Issue-3, 2017


ISSN: 2454-1362, http://www.onlinejournal.in

Threats and Attacks Based on


Smartphones Camera
Haider Ali Mohammed1 & Basheer Abdulmutalib Hassoon2
Huazhong University of Science and Technology

Abstract: Now days mobile smartphones become histories, location information, and private files.
very powerful, and many smartphone applications They may be surprised that the phone camera could
always use wireless multimedia communications. become a traitor; for example, attackers could
The security in Mobile phone is an important aspect stealthily take pictures and record videos by using
of security issues in wireless multimedia the phone camera. Nowadays, various types of
communications. As the many popular mobile camera-based applications have appeared in Android
operating system, Android security has been app markets (photography, barcode readers, social
extensively studied by researchers. However, few networking, etc.). Spy camera apps have also become
works have studied mobile phone multimedia quite popular. As for Google Play, there are nearly
security. In this work, we focus on security issues 100 spy camera apps, which allow phone users to
related to mobile phone cameras. Specifically, we take pictures or record videos of other people without
discover several new attacks that are based on the their permission. However, believe it or not, phone
use of phone cameras. We implement an attack on users themselves could also become victims.
real phones and explain the feasibility and Attackers can implement spy cameras in malicious
effectiveness of the attacks. Furthermore, we propose apps such that the phone camera is launched
a lightweight defence scheme that can effectively automatically without the device owner’s notice, and
detect these attacks. the captured photos and videos are sent out to these
remote attackers.
Keywords: Security, Attack, Malware, Camera, Spy.
2. Threats and benefits of spy camera
1. Introduction
The role a spy camera plays depends on the way it
Since 2007, Android operating system (OS) has is used and who is in control of it. In the following,
enjoyed an incredible rate of popularity. As of 2013, we discuss some threats and benefits of using a spy
Android OS holds 79.3 percent of global smartphone camera.
market shares.
Meanwhile, a number of Android security and 2.1 Leaking private information
privacy vulnerabilities have been exposed in the past
several years. Although the Android permission A spy camera works as a thief if it steals private
system gives users an opportunity to check the information from the phone. First, the malware finds
permission request of an application (app) before a way to infect the victim’s smartphone. For
installation, few users have knowledge of what all example, it appears to be a normal application with
these permission requests stand for; as a result, they legitimate use of a camera and the Internet. On one
fails to warn users of security risks. Meanwhile, an hand, it performs the function it claims. On the other
increasing number of apps specified to enhance hand, it runs a background service to secretly take
security and protect user privacy have appeared in pictures or record videos, and store the data with
Android app markets. Most large anti-virus software obscure names in a directory that is seldom visited.
companies have published their Android-version Then these data are sent out to the attacker when Wi-
security apps, and tried to provide a shield for \Fi (fast and usually unlimited) access or other
smartphones by detecting and blocking malicious connection is available.
apps. In addition, there are data protection apps that
provide users the capability to encrypt, decrypt, sign, 2.2 Anti-Thief
and verify signatures for private texts, emails, and
On the other hand, a spy camera could play a
files. However, mobile malware and privacy leakage
completely different role if it is used properly. When
remain a big threat to mobile phone security and
a user loses his/her phone, the spy camera could be
privacy. Generally, when talking about privacy
launched via remote control and capture what the
protection, most smartphone users pay attention to
thief looks like as well as the surrounding
the safety of SMS, emails, contact lists, calling
environment. Then the pictures or videos along with

Imperial Journal of Interdisciplinary Research (IJIR) Page 146


Imperial Journal of Interdisciplinary Research (IJIR)
Vol-3, Issue-3, 2017
ISSN: 2454-1362, http://www.onlinejournal.in

location information (GPS coordinates) can be sent TYPE_SYSTEM_OVERLAY, which makes the
back to the device owner so that the owner can preview window always stay on top of other apps;
pinpoint the thief and get the phone back. the other one is FLAG_NOT_FOCUSABLE, which
We want to discover possible attacks based on a disables the input focus of a spy camera app such
spy camera. The attacks should appear normal to that input values would be passed to the first
user experience. The main challenge is to make the focusable window underneath.
attacks run stealthily and silently so that they do not This would turn the camera preview into a
cause a user alert. Specifically, the attacks are floating and not focusable layer. Then the app
supposed to have a translucent view, make no sound changes the size of preview (SurfaceView) to the
or vibration, and check phone resource utilization minimum pixel (1 pixel), which human eyes cannot
before launching themselves. notice. This cannot be set directly through
setPreviewSize(). Instead, the app needs to get the
layout parameter of SurfaceViewby using
The general architecture should SurfaceView.getLayout- Params().
include the following six parts Noticethat the type of
SurfaceView.getLayoutParams() is ViewGroup.
Figure (1) shows the architecture of a basic spy LayoutParamsinstead of the aforementioned
camera attack. WindowManager. LayoutParams. Finally, the app
Step 1: To prevent the user from suspecting, the can add the hidden preview dynamically to the
malware should consider the current CPU, memory window by the addViewfunction.
usage, and battery status. Launching the attack when
CPU and memory usage are already high could make Step 4: After setting up the layout, the attack
a phone’s performance even worse. Users tend to be could be launched as follows: initialize the Surface
concerned about the unsmooth experience, and check Holder, choose which camera (front or back) is used,
if any app or service is running in the background. and open the camera to take pictures or record
Similar concern happens with energy videos. The photo/video data are supposed to be
consumption, especially when the phone’s battery is stored in disguises, including using confusing
low and is not being charged. A camera attack could filenames and seldom visited directories. The app
drain the battery faster than the user’s expectation releases the camera after the above actions.
and cause user suspicion about possible attacks.
Camera apps want to ensure that system resources Step 5: After the camera attack finishes, the app
are plentiful. For Android phones, memory usage sets the audio volume and vibration status back to its
could be obtained through the getMemoryInfo() original values. This way, the device owner would
function of Activity Manager, information related to not find any abnormality.
CPU utilization is available from “/proc/stat,” while
current battery level and charging status can be Step 6: The last step of the attack is to transmit
obtained by registering a Broadcast Receiver with the collected data to the outside. Since cellular
ACTION_BATTERY_CHANGED. network usage and MMS may cause extra fees, the
best choice is to wait until free Wi-Fi access is
Step 2: After ensuring sufficient resources for available. For example, it could use the javax.mail to
launching attacks, a malicious camera app can send the data as an email attachment. Most email
continue on the remaining actions. First, the app can systems limit the maximum size of attachments, so
turn off the phone’s sound and vibration, which can the length of a video should have an upper bound
be achieved by setting the system sound Audio specific to the email service.
Manager.

STREAM_SYSTEM to 0 and the flag to


FLAG_REMOVE_SOUND_ AND_VIBRATE.
The app can log the current volume level and
vibration status, and resume the parameters after the
attack.

Step 3: The difficult task is to hide the camera


preview. At the beginning, the layout containing the Figure (1) shows the basic camera attack
Surface View is inflated into a view via architecture
LayoutInflater.inflate(). Then the app can set the
view parameters by changing the attributes of
WindowManager.LayoutParams. Two important
attributes must be set:

Imperial Journal of Interdisciplinary Research (IJIR) Page 147


Imperial Journal of Interdisciplinary Research (IJIR)
Vol-3, Issue-3, 2017
ISSN: 2454-1362, http://www.onlinejournal.in

3. Type of attacks touching the wrong key.

3.1 The remote controlled real time Hence, when typing, users tend to keep a short
distance to the screen, which allows the phone (front)
monitoring attack
camera to have a clear view of a user’s eye
The basic camera attack can be further enhanced movements. A user’s eyes move along with the keys
for more aggressive attacks. For example, the being touched, which means that tracking the eye
attacker can remotely control the spy camera app movement could possibly tell what the user is
such that the time to launch and end the attack is entering. Thus, it is of great importance to investigate
under control. whether an attacker could obtain a phone user’s
The simplest way to implement the remote control passcode by tracking the eye movements.
is by socket. After the malicious app is downloaded As computer vision techniques are advancing and
and installed on a victim’s phone, it sends a “ready” becoming more accurate, an offline processing of the
message along with the IP address and port number video can extract the eye position in each frame and
to the attacker’s server. Then the attacker can control draw the path of eye movements, which means that
the app with orders like “launch” and “stop” or an attacker could infer the passcode based on the
specify a time schedule. video captured by a spy camera app. In this section,
There are many Android apps that turn the phone we discuss two types of camera attacks for inferring
into a security surveillance camera, such as Android passcodes. We also discuss the computer vision
Eye [6]. The spy camera can easily be extended to a techniques for eye tracking that can be utilized in the
stealthy real-time monitor based on the way an IP attacks.
camera is built. NanoHttpd [7] is a lightweight HTTP
server that can be installed on a phone. In our case, 3.2.1 The Application-Oriented attack
we can start an HTTP server at a given port which
supports dynamic file serving such that the captured The first type of attack is the application-oriented
videos can be played online upon requests from a attack, which aims at getting the credentials of
browser client. certain apps. Most apps (like Facebook) that require
Although the phone’s screen is showing its app authentication contain letters, which need a complete
menu, it actually captures videos through the front- virtual keyboard, pattern and PIN, which we discuss
face camera. Figure 2b is the view of the phone in detail later. Smart App Protector is a locker app by
camera, which is accessed from a PC browser. The which a user is able to lock apps. that need extra
address is the IP address of the phone and the port protection (i.e., Gallery, messaging, and dialing
number of the server. apps). For a successful passcode inference attack, the
In this section, we discuss the remote-controlled video must be captured during user authentication.
real-time monitoring attack, which could pose a big An effective way is to poll the running task list and
threat to a phone user’s privacy: daily activities and launch the attack as soon as the target app appears on
surrounding environment are all under the eye of the top of the list. Specifically, using the
attacker. getRunningTasks() function of Activity- Manager,
Camera-based attacks can be detected when we can get the name of the most recently launched
multiple apps request the camera device at the same app. Meanwhile, the detection service scans the
time or if the camera is being used by another app. running apps and resource utilization periodically.
But this can easily be avoided by selecting the time When attack conditions are met, it opens the camera
to launch attack. and secretly takes videos of the user’s face
The malicious camera app can periodically check (especially the eyes) with a front-face camera for a
the screen status and run the stealthy video recording time long enough to cover the entire authentication
only when the screen is off, which means that the process. There are several other factors we need to
user is not using the phone and the camera device is consider to ensure the attack is effective and
idle. The status of the phone screen can be obtained efficient. First, the detection service of a spy camera
by registering two broadcast receivers, ACTION_ app must be launched beforehand, by either tempting
SCREEN_ON and ACTION_ SCREEN_OFF. the user to run the app or registering an
ACTION_BOOT_COMPLETED receiver to launch
when booting is finished.
3.2 Video-Based passcode inference
The RECEIVE_BOOT_COMPLETED
attack permission is a commonly requested permission that
Since the virtual keyboard in a touch screen would not be considered dangerous. Second, polling
smartphone is much smaller than computer task lists frequently leads to extra consumption of
keyboards, the virtual keys are very close to each energy resource. To improve the efficiency of
other. Based on measurement of a Galaxy Nexus 4 scanning, the detection service is active only when a
phone, even an offset of 5 mm could result in user is using the phone. As mentioned before, this

Imperial Journal of Interdisciplinary Research (IJIR) Page 148


Imperial Journal of Interdisciplinary Research (IJIR)
Vol-3, Issue-3, 2017
ISSN: 2454-1362, http://www.onlinejournal.in

can be determined by screen status. The detection be connected in an ordered sequence. There are some
service will cease when the screen is off and rules for the combination of dots:
continue when the screen lights up again. Moreover, • The number of dots chosen must be at least 4
the scanning frequency should be set properly. In a and no more than 9.
phishing attack [8], a malicious app needs to poll the • Each dot can be used only once.
running task list every (5 Ms) to prevent the user A PIN is a pure-digit passcode with length
from noticing that a new window (the fake app) has ranging from 4 to 16, and repetition is allowed. Both
replaced the original one. In our phone camera alternatives are extensively used in screen unlocking
attack, the view is totally translucent to users, so that of Android phones. The relatively larger distance
worry is unnecessary. However, we still need to keep between adjacent keys effectively relieves a user’s
the frequency at around two scanning per second; eye fatigue problem. However, this also brings
otherwise, the attack may happen after the user starts vulnerability to video-based passcode inference
entering the passcode (which makes the attack attacks since the larger scale of eye movement makes
unsuccessful). the attack easier.

3.2.3 Video-Based eye tracking


3.2.2 The Screen Unlocking attack techniques
In this subsection, we discuss another type of In the eye tracking field, two types of imaging
attack. The attack is launched when a user is entering approaches are commonly used: visible and infrared
a screen unlocking passcode. We categorize this spectrum imaging. Visible spectrum imaging
scenario as a different attack model since it is passively utilizes the ambient light reflected from the
unnecessary to hide the camera preview under this eye, while infrared spectrum imaging is able to
circumstance. To achieve privacy, an Android eliminate uncontrolled specular reflection with active
system would not show the user interface until a infrared illumination.
visitor proves to be the device owner by entering the Although infrared spectrum eye tracking is more
correct credential. This accidentally provides a shield accurate, most smartphones today are not equipped
for spy camera attacks targeted at the screen with infrared cameras.
unlocking process. Users never know that the camera Hence, we focus on visible spectrum eye tracking.
is working, even though the camera preview is right For images captured by visible spectrum imaging,
beneath the unlocking interface. often the best feature to track is the contour between
We demonstrate the screen unlocking passcode iris and sclera known as the limbus [9].
inference attack. Its difference from the application- Li et al. [9] propose the Starburst eye tracking
oriented attack is the condition to launch the attack algorithm, which can track the limbus of the eye.
and the time to stop. Intuitively, the attack should they can locate where the eye is looking in a real-
start as soon as the screen turns on and should end time manner. However, Starburst requires calibration
immediately as the screen is unlocked. by manually mapping between eyeposition
coordinates and scene-image coordinates.
This can be achieved in two key steps: This can be performed only by the phone owner,
which makes it infeasible in spy camera attacks.
• Registering a Broadcast Receiver to receive Aldrian [10] presents a method to extract fixed
ACTION_SCREEN_ON when a user lights up feature points from a given face in visible spectrum,
the screen and begins the unlocking process which is based on the Viola Jones adaboosted
• Registering another Broadcast Receiver to algorithm for face detection. But it is able to track
Receive ACTION_USER_PRESENT when a pupil movement without scene image and
passcode is confirmed and the screen guard is gone calibration, we adopt this eye tracking algorithm in
the second step guarantees that the camera service our research to extract eyes from videos.
would stop recording and end itself immediately
when the user interface is switched on. In addition,
the attack should consider the situation with no 3.3 Implementation and evaluation
screen locking passcode. To avoid being exposed,
the spy camera app should check key guard manager We will discuss two attacks (remote-controlled
with the is Key guard Locked () function to make real-time monitoring and passcode inference attacks).
sure the screen is locked before launching the attack. We have implemented the remote-controlled real-
To simplify the screen unlocking process, the time monitoring and passcode inference attacks on
Android system provides alternative authentication real phones including the Nexus S4G (Android 4.1),
methods in addition to the conventional password: Galaxy Nexus (Android 4.2), and Nexus 4 (Android
pattern and PIN. A pattern is a graphical passcode 4.3 with Security Enhanced support). For passcode
composed of a subset of a 3 × 3 grid of dots that can inference attacks, a computer vision technique for

Imperial Journal of Interdisciplinary Research (IJIR) Page 149


Imperial Journal of Interdisciplinary Research (IJIR)
Vol-3, Issue-3, 2017
ISSN: 2454-1362, http://www.onlinejournal.in

eye tracking is used to process the captured video. experiments we choose a four-digit pattern/PIN for
The evaluation of the feasibility and effectiveness of testing.
the attacks is based on the experimental results.
3.3.3 Performance evaluation
3.3.1 Implementation We process videos containing user eye movement
with the aforementioned computer vision technique
Both camera-based attacks are successfully [10]. Due to the tight configuration of the virtual
implemented on Android phones equipped with a keyboard and limitation of visible spectrum imaging,
front-face camera. The spy camera appear the performance of inferring a conventional
completely translucent to phone users and work password is poor and unstable. However, the
without causing any abnormal experiences. When possibility of compromising patterns and PINs is
Wi-Fi access is enabled, the captured data is shown to be much higher. In our evaluation, 18
transmitted to the attacker via a local HTTP server or groups of 4-digit passcodes were tested, and the
email. To test the steal thinness of the attacks, we results are listed in Table 1.
install two popular antivirus apps: AVG antivirus In Table 1, each group consists of three
and Norton Mobile Security. Neither of the two components:
antivirus apps has reported warning during the entire real passcode (Real Psscd), eye movement, and
video capturing and transmission process. This possible passcodes (possible Psscds). Since the shape
demonstrates their resistance to mobile antivirus of the 9-dot pattern keypad and 10-digit PIN keypad
tools. is similar to a square, the results of eye movement
are drawn in a square. Therefore, position projection
3.3.2 Feature analysis of the passcode can be used to infer input keystrokes. We find that in
inference attack some cases, the correct passcode can be inferred
accurately, while in other cases, it is in a small group
An important feature that enhances the of possible passcodes.
effectiveness of a passcode inference attack is that it For example, from the first row in Table 1,
can be launched repeatedly, which allows certain passcode 1459 can be directly inferred, while 1687
passcodes to be “attacked” many times. In this way, and 1450 both have three candidates. The attacker
an attacker could get a set of possible passcode sand could further narrow down the possible passcode set
keep launching attacks until the correct one is found. by launching more attacks and finding out the
The passcode inference attack depends on the intersection. Furthermore, when the owner is not
victim’s eye movement instead of analyzing videos using the phone, the attacker may try different
containing the screen [4] or its reflection [5], which possible passcodes and see which one works.
makes it harder to achieve high and stable one-time
success rates. In addition, there are complex factors
that may influence its performance, such as the 3.4 Prevent attacks
distance between face and phone, lighting conditions,
velocity of eye movements, pause time on each key, In this section, we discuss possible counter
and head/device shaking when typing. Among these measures that can protect Android phones against
experimental conditions, only the lighting condition these spy camera attacks.
can be kept constant during our experiments. To test In an Android system, no application
the effectiveness of the passcode inference attacks programming interface (API) or log file is available
with different types of passcodes, we use the for user to check the usage of a camera device.
conventional password, pattern, and PIN in our Hence, detection of camera-based attacks requires
experiments. By comparing the rules of pattern and modification to the system. We make changes to the
PIN, we find that pattern combination is actually a Check Permission () function of Activity Manager
subset of PIN. In addition, the outlines of the two Service and write a light weight defines app such that
passcodes are similar (both are squares). Hence, we whenever a camera is being called by apps with
present their results and discuss their performance CAMERA permission, the defines app will be
together. Another consideration for experiments is informed along with the caller’s Application Package
the length of pattern and PIN. Name.
In fact, people rarely use long PINs and complex The Application Package Name is a unique
patterns since they are hard to memorize and identifier in Android, and third party apps cannot
impractical for frequent authentications such as reuse the name of built-in apps like a Camera
screen unlocking. (com.android.gallery3d).
This can be best illustrated by Apple iOS’s four- By looking at the app name, we are able to
digit PIN for screen unlocking. Hence, in our identify the built-in camera app (that is known to be
safe), and no alert will be generated. Then we design

Imperial Journal of Interdisciplinary Research (IJIR) Page 150


Imperial Journal of Interdisciplinary Research (IJIR)
Vol-3, Issue-3, 2017
ISSN: 2454-1362, http://www.onlinejournal.in

a further checking mechanism for third party camera- attacks. In the future, we will investigate the
based apps. Analysing activity pattern is an effective feasibility of performing spy camera attacks on other
approach in malware detection. For each type of spy mobile operating systems.
camera attack, we are able to extract a specific
feature from its activity pattern. The activity pattern References
of spy camera apps are totally different from [1] Y. Zhou and X. Jiang, “Dissecting Android Malware:
legitimate camera apps. To avoid collision in the use
Characterization and Evolution,” IEEE Symp. Security
of cameras, a remote-controlled real-time monitoring
attack runs when the screen is off. The application- and Privacy 2012, 2012, pp. 95–109.
oriented pass code inference attack launches [2] R. Schlegel et al., “Soundcomber: A Stealthy and
immediately after another app runs. The screen Context-
unlocking attack runs when the screen turns on but
remains locked. The defines app is able to decide the Aware Sound Trojan for Smartphones,” NDSS, 2011, pp.
dynamic launch pattern of camera related apps by 17–33.
polling the task list. If a camera app calls a camera in [3] N. Xuet al., “Stealthy Video Capturer: A New Video-
one of the above situations, the defines app gives
Based Spyware in 3g Smartphones,” Proc. 2nd ACM
warnings to the phone user.
There are three parts of warnings in our defines Conf. Wireless Network Security, 2009, pp. 69–78.
scheme. First, an alert dialog including the name of [4] F. Maggi, et al.,“A Fast Eavesdropping Attack against
the suspicious app is displayed. In case the warning
message cannot be seen immediately by the user Touchscreens,” 7th Int’l. Conf.Info. Assurance and
(e.g., the user is not using the phone), the defines app Security, 2011, pp. 320–25.
will also make sound and vibration to warn the user [5] R. Raguramet al., “ispy: Automatic Reconstruction of
of spy camera attacks. Besides, the detailed activity
Typed Input from Compromising Reflections,” Proc.
pattern of suspected apps are logged so that the user
can check later. The spy camera app named com . 18th ACM Conf. Computer and Commun. Security,2011,
Defines against spy camera attack. The defines app is pp. 527–36.
able to decide the dynamic launch pattern of camera [6] “Android-eye,” https://github.com/Teaonly/android-
related apps by polling the task list. eye, 2012.
If a camera app calls camera in one of the above
[7] “Nanohttpd,” https://github.com/NanoHttpd/ nanohttpd.
situations, the defense app would give warnings to
the phone user. IEEE Communications Magazine [8] A. P. Felt and D. Wagner, “Phishing on Mobile
•March 2014 87the camera as soon as Facebook is Devices,”
launched. This process is detected by the defense Proc. WEB 2.0 Security and Privacy, 2011.
app, and a warning message with its name is
displayed before the user enters his/her credentials. [9] D. Li, D. Winfield, and D. Parkhurst, “Starburst:
A Hybrid Algorithm for Video-Based Eye Tracking
Combining
4 Conclusion Feature-Based and Model-Based Approaches,”
In this article, we study camera-related IEEE Computer Soc. Conf. Computer Vision and Pattern
vulnerabilities in Android phones for mobile
Recognition — Workshops, 2005, p. 79.
multimedia applications. We discuss the roles a spy
camera can play to attack or benefit phone users. We [10] P. Aldrian, “Fast Eyetracking,”
discover several advanced spy camera attacks, http://www.mathworks.
including the remote-controlled real-time monitoring com/matlabcentral /fileexchange/25056-fast-eyetracking,
attack and two types of passcode inference attacks.
Meanwhile, we propose an effective defines scheme 2009.
to secure a smartphone from all these spy camera

Imperial Journal of Interdisciplinary Research (IJIR) Page 151


Imperial Journal of Interdisciplinary Research (IJIR)
Vol-3, Issue-3, 2017
ISSN: 2454-1362, http://www.onlinejournal.in

Table 1. Passcode inference results for four-digit passcodes

Imperial Journal of Interdisciplinary Research (IJIR) Page 152

You might also like