SlideShare a Scribd company logo
SESSION ID:
#RSAC
Christopher Kruegel
Finding Triggered Malice in
Android Apps
MBS-W04
Chief Scientist
Lastline, Inc.
#RSAC
Who am I?
2
Professor in Computer Science at UC Santa Barbara
many systems security papers in academic conferences
started malware research in about 2004
built and released practical systems (Anubis, Wepawet, …)
Co-founder and Chief Scientist at Lastline, Inc.
Lastline offers protection against zero-day threats and advanced
malware
effort to commercialize our research
#RSAC
What are we talking about?
Android applications (apps) and mobile malware
Power of static code analysis in the context of Android apps
Tricky malware that uses triggers to evade detection
Triggers and triggered malware in the wild
3
#RSAC
Mobile devices (apps) dominate …
4
#RSAC
… and Android is leading the pack
5
#RSAC
Android Malware on the rise!
Where are the differences to desktop applications?
centralized control
vet applications before they enter store
can remotely remove installed applications
carriers might have more complete picture of users and traffic
apps are much easier to analyze statically
use of Dalvik bytecode instead of x86
interesting GUI issues
6
#RSAC
Static Analysis for Android Apps
Precise, scalable static analysis of Android apps
Analysis over bytecode
Minimal a priori assumptions regarding app design
Cannot ignore difficult cases and adversarial behavior
Do not consider apps in isolation (intents, user interaction, …)
Scalability from the start
7
#RSAC
Dalvik Static Analysis
Front-end
APK unpacker
DEX parser
Androguard, dexlib
produces custom IR
Back-end
operates on IR
points-to, CFA, backwards slicing,…
trigger analysis
8
#RSAC
Static Analysis
9
Tracking data flows is at the core of our analysis
Analysis must handle not only data flows, but also values
apps request permissions, but they are very coarse-grained
string, value-range analysis
#RSAC
Static Analysis
10
Analysis must handle user interaction, activities, and intents
otherwise, data flows can be “broken”
Analysis must handle complex data structures
standard collection classes
key-value stores for intent parameters
Whole system analysis
#RSAC
String Analysis
11
Robust and precise string modeling is a fundamental capability
many interesting flows are parameterized by strings
e.g., * ⇝ loadUrl
symbolic strings are interesting and problematic
String constraint solver tailored to common string operations in
Android applications
append, substring, reverse, charAt, delete, …
STP as the backend SMT solver
#RSAC
Implicit Flow Reconstruction
Android applications written as collections of event-driven or
asynchronous components
Activity, Service, BroadcastReceiver
AsyncTask, Thread, Runnable, Callable
requestLocationUpdates ⇝ onLocationChanged
takePicture ⇝ onPictureTaken
Analyzer models implicit flows through framework
linking explicit handler registrations is straightforward
implicit flow recovery through dynamic analysis
12
#RSAC
Implicit Flow Recovery
13
Identify previously unknown implicit flows
increase coverage while preserving data flow precision
Enabled by combination of instrumentation and Clicker
tracing code injected, dynamic analysis driven by Clicker
records exit points from application code
records entry points into framework
trace events binned by thread
#RSAC
Implicit Flow Recovery
14
Several classes of flows discovered
explicit callback registration
registration of callback groups
“implicit” registration
#RSAC
(Some) Interesting Applications
15
Detection of triggered malware
Finding GUI confusion attacks
Finding dynamic code loading vulnerabilities
Locate incorrect use of cryptography
#RSAC
(Some) Interesting Applications
16
Detection of triggered malware
Finding GUI confusion attacks
Finding dynamic code loading vulnerabilities
Locate incorrect use of cryptography
We focus on
this one today!
#RSAC
Evasion and Triggers
Malware authors are not sleeping
they got the news that sandboxes are all the rage now
since the code is executed, malware authors have options ..
Evasion
develop code that exhibits no malicious
behavior in sandbox, but that infects the
intended target
17
#RSAC
Evasion and Triggers
18
One key evasive technique relies on checking for specific
values in the environment or inputs – these checks are
called triggers
Other evasive techniques used against sandbox
technology
exploit limited context
avoid analysis (sleep, stalling)
avoid analysis (move to kernel, for example, rootkits)
#RSAC
Trigger Analysis
Data flow captures many important classes of malicious behaviors
however, some behaviors are difficult to reason about purely through
data flow
1. Analysis to find interesting checks that exhibit characteristics of
triggering behavior
adversaries often want to predicate their attack based on environmental
conditions
analysis identifies usage of predicates based on environmental data
(e.g., location, time, SMS)
2. Then determine whether these checks guard “interesting”
behaviors
19
#RSAC
Find Interesting Checks (1/2)
Find conditionals that depend on interesting input
location, date, time, SMS input …
Use data flow analysis to determine where interesting input
flows to, and what operations the program performs on these
inputs
Propagate constraints on input values along program paths
we call these path predicates
20
#RSAC
Find Interesting Checks (2/2)
Check for characteristics of triggering behavior
checks might be very specific
do the predicates significantly constrain the value domain?
are there many checks applied to an input?
program performs unusual operations on certain inputs
do we see unusual operations / operands for certain inputs?
These are heuristics, and we need to know something about the
numbers and types of checks that benign programs perform on
certain types of input
21
#RSAC
Find Interesting Checks
22
Example – Malicious application
void onCreate(Bundle savedInstanceState) {
currentTime = new Time(Time.getCurrentTimezone());
currentTime.setToNow();
newSiteAvailable =
(currentTime.month > 4 && currentTime.month < 8) &&
currentTime.year >= 2013;
How unusual is this?
#RSAC
Find Interesting Checks
23
Analysis of 3K apps yields
Checks in malicious app yield a score of 3.7
#RSAC
Find Checks That Guard Behavior
24
Analysis can point human to suspicious checks
support manual review
Maybe we can do better
check whether trigger-like check guards sensitive operation
Easier approach
check for sensitive operations directly on path guarded by check
More complete approach
check whether check can influence sensitive operation anywhere in
the program
#RSAC
Find Checks That Guard Behavior
25
boolean onOptionsItemSelected(MenuItem item) {
String updateUrl = "";
if(newSiteAvailable) {
url = "http://www.evil.com";
updateUrl = getUpdatedUrl();
startIntent(url, updateUrl);
else {
startIntent(url);
}
#RSAC
What did we find?
Dataset of ~10K apps from the Google market
Collection of triggered malware
DARPA apps developed by Red Team
Holy Colbert Trojan (backdoor in legitimate app)
Zitmo (Zeus-In-The-MOile)
RCSAndroid (Hacking Team)
26
#RSAC
Google Market
Dataset of ~10K apps from the Google market
27
Domain # Apps # Apps w/
Checks
# Suspicious
Checks
# Guarded
Behavior
# Post-
processed
Time 4,950 1,026 302 30 10
Location 3,430 137 71 23 8
SMS 1,138 223 89 64 17
#RSAC
Processing Time
28
#RSAC
Time Triggers
Benign triggers
to check for updates
to implement countdown functionality
29
#RSAC
Time Triggers
30
#RSAC
Location Triggers
Benign triggers
based on user-defined areas
one interesting trigger for specific Japanese train station
31
#RSAC
Location Triggers
32
#RSAC
SMS Triggers
Mostly benign triggers
apps check for sender, sender’s phone, or content to check if they need
to process SMS for regular app functionality
Two suspicious examples found
tw.nicky.LockMyPhoneTrial (RemoteLock)
com.innovationdroid.myremotephone
(MyRemotePhone)
33
#RSAC
SMS Triggers
RemoteLock (removed ~2013 from PlayStore)
checks whether the incoming SMS matches with a long, hardcoded
string (“adf…yhytdfsw”). If that is the case, the application unlocks the
phone!
MyRemotePhone (still available on PlayStore)
checks whether the incoming SMS contains the following two strings:
MPS: and gps (now mrp: gps). If that is the case, the application
automatically sends an SMS to the original sender containing the
current GPS coordinates!
34
#RSAC
Malware Samples
DARPA Red Team apps
deliberately developed to bypass dynamic analysis
5 time triggers (hardcoded dates and times)
1 location trigger [ based on Location.distanceBetween() ]
5 SMS triggers (contents of messages)
malicious activity were data leaks and integrity violations
35
#RSAC
Malware Samples
Zitmo
checks for content in SMS to steal mTANs for banks
SMS used to implement command and control
Holy Colbert
time trigger based on SimpleDateFormat API
36
#RSAC
Malware Samples
RCSAndroid
remote control app written by HackingTeam
SMS-based trigger (comparison with values from a file)
behaviors range from data leakage (send conversations, device
information) to capture of screenshots and voice calls
37
#RSAC
RCSAndroid
SMS-based check (comparison with values from a file)
38
#RSAC
RCSAndroid
Based on the checks, an action is triggered …
39
#RSAC
(Some) Interesting Applications
40
Detection of triggered malware
Finding GUI confusion attacks
Finding dynamic code loading vulnerabilities
Locate incorrect use of cryptography
#RSAC
Dynamic Code Loading
Apps can load code dynamically at runtime
download code from the Internet or local files
various ways (DexClassLoader, CreatePackageContext, …)
41
#RSAC
Dynamic Code Loading Vulnerabilities
Insecure downloads
load code over HTTP
Unprotected storage
downloaded code is stored in location accessible to other apps
Improper use of package names
load code from other apps, specifying only package names
42
#RSAC
Dynamic Code Loading Vulnerabilities
Top 50 free apps around end of 2013
43
#RSAC
Finding Incorrect Use of Crypto
Finding apps that use broken crypto
developers are not security experts
AES/ECBAES/CBCPlaintext
44
#RSAC
Finding Incorrect Use of Crypto
Almost 12K apps that use crypto
31% use known key
65% use ECB
16% use known IV for CBC
45
#RSAC
Lessons Learned
46
Understand that mobile threats are real
Google Bouncer not enough
Understand that fighting mobile malware is fundamentally
different than fighting Windows malware
ask your vendor how they detect mobile malware
demand certain protection guarantees
Vulnerabilities are real and widespread
how to manage app installation, patching, … ?
#RSAC
Conclusions
47
Smartphones and apps increasingly popular and
important
Interesting differences between apps and traditional
desktop programs allow for important security
improvements
easier static analysis
Using static analysis to identify triggers and
environmental checks in malicious Android apps

More Related Content

PDF
Hacking Exposed: The Mac Attack
PDF
Android Serialization Vulnerabilities Revisited
PDF
How to Analyze an Android Bot
PDF
BlueHat v18 || Protecting the protector, hardening machine learning defenses ...
PDF
The Log4Shell Vulnerability – explained: how to stay secure
PDF
HackInBo2k16 - Threat Intelligence and Malware Analysis
PDF
.NET for hackers
PDF
Wtf is happening_inside_my_android_phone_public
Hacking Exposed: The Mac Attack
Android Serialization Vulnerabilities Revisited
How to Analyze an Android Bot
BlueHat v18 || Protecting the protector, hardening machine learning defenses ...
The Log4Shell Vulnerability – explained: how to stay secure
HackInBo2k16 - Threat Intelligence and Malware Analysis
.NET for hackers
Wtf is happening_inside_my_android_phone_public

What's hot (20)

PDF
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014
PPTX
Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016
PPTX
Bypass Security Checking with Frida
PDF
BlueHat v18 || A turla gift - popping calc.exe by sending an email
PDF
Automatic tool for static analysis
ODP
Tracking vulnerable JARs
PDF
The day I ruled the world (RootedCON 2020)
PPTX
Securing your web applications a pragmatic approach
ODP
OpenDaylight Brisbane User Group - OpenDaylight Security
PDF
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
PDF
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
PDF
Extending Zeek for ICS Defense
PDF
CSW2017 Enrico branca What if encrypted communications are not as secure as w...
PPTX
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
PDF
Building world-class security response and secure development processes
PDF
The Art of defence: How vulnerabilites help shape security features and mitig...
PPTX
AusCERT 2016: CVE and alternatives
PDF
OWASP Poland Day 2018 - Amir Shladovsky - Crypto-mining
DOCX
Kl 031.30 eng_class_setup_guide_1.2
PDF
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Hacking ios-on-the-run-using-cycript-viaforensics-rsa-conference-2014
Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016
Bypass Security Checking with Frida
BlueHat v18 || A turla gift - popping calc.exe by sending an email
Automatic tool for static analysis
Tracking vulnerable JARs
The day I ruled the world (RootedCON 2020)
Securing your web applications a pragmatic approach
OpenDaylight Brisbane User Group - OpenDaylight Security
From Thousands of Hours to a Couple of Minutes: Automating Exploit Generation...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Extending Zeek for ICS Defense
CSW2017 Enrico branca What if encrypted communications are not as secure as w...
Abusing Adobe Reader’s JavaScript APIs by Abdul-Aziz Hariri & Brian Gorenc - ...
Building world-class security response and secure development processes
The Art of defence: How vulnerabilites help shape security features and mitig...
AusCERT 2016: CVE and alternatives
OWASP Poland Day 2018 - Amir Shladovsky - Crypto-mining
Kl 031.30 eng_class_setup_guide_1.2
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Ad

Similar to Finding Triggered Malice in Android Apps (20)

PDF
Attacks on Critical Infrastructure: Insights from the “Big Board”
PDF
Keeping Up with the Adversary: Creating a Threat-Based Cyber Team
PDF
Autonomous Hacking: The New Frontiers of Attack and Defense
PDF
TriggerScope: Towards Detecting Logic Bombs in Android Applications
PDF
Creating Your Own Threat Intel Through Hunting & Visualization
PPTX
RSA 2018: Recon For the Defender - You know nothing (about your assets)
PDF
Recon for the Defender: You Know Nothing (about Your Assets), Jon Snow
PDF
Mobile analysis-kung-fu-santoku-style-viaforensics-rsa-conference-2014
PDF
Implementing An Automated Incident Response Architecture
PDF
csmalware_malware
DOCX
JPD1424 A System for Denial-of-Service Attack Detection Based on Multivariat...
PDF
Replay of Malicious Traffic in Network Testbeds
PPTX
The Trellix NDR presentations for beginner
DOCX
a system for denial-of-service attack detection based on multivariate correla...
PPTX
FALCON.pptx
PDF
Ransomware Attack Detection based on Pertinent System Calls Using Machine Lea...
PDF
Ransomware Attack Detection Based on Pertinent System Calls Using Machine Lea...
PPTX
Cybersecurity - Jim Butterworth
PDF
Transfer Learning: Repurposing ML Algorithms from Different Domains to Cloud ...
PPTX
The-Vulnerabldde-Algorithm-Hit-List.pptx
Attacks on Critical Infrastructure: Insights from the “Big Board”
Keeping Up with the Adversary: Creating a Threat-Based Cyber Team
Autonomous Hacking: The New Frontiers of Attack and Defense
TriggerScope: Towards Detecting Logic Bombs in Android Applications
Creating Your Own Threat Intel Through Hunting & Visualization
RSA 2018: Recon For the Defender - You know nothing (about your assets)
Recon for the Defender: You Know Nothing (about Your Assets), Jon Snow
Mobile analysis-kung-fu-santoku-style-viaforensics-rsa-conference-2014
Implementing An Automated Incident Response Architecture
csmalware_malware
JPD1424 A System for Denial-of-Service Attack Detection Based on Multivariat...
Replay of Malicious Traffic in Network Testbeds
The Trellix NDR presentations for beginner
a system for denial-of-service attack detection based on multivariate correla...
FALCON.pptx
Ransomware Attack Detection based on Pertinent System Calls Using Machine Lea...
Ransomware Attack Detection Based on Pertinent System Calls Using Machine Lea...
Cybersecurity - Jim Butterworth
Transfer Learning: Repurposing ML Algorithms from Different Domains to Cloud ...
The-Vulnerabldde-Algorithm-Hit-List.pptx
Ad

More from Priyanka Aash (20)

PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
PDF
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
PDF
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
PDF
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
PDF
Lessons Learned from Developing Secure AI Workflows.pdf
PDF
Cyber Defense Matrix Workshop - RSA Conference
PDF
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
PDF
Securing AI - There Is No Try, Only Do!.pdf
PDF
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
PDF
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
PDF
10 Key Challenges for AI within the EU Data Protection Framework.pdf
PDF
Techniques for Automatic Device Identification and Network Assignment.pdf
PDF
Keynote : Presentation on SASE Technology
PDF
Keynote : AI & Future Of Offensive Security
PDF
Redefining Cybersecurity with AI Capabilities
PDF
Demystifying Neural Networks And Building Cybersecurity Applications
PDF
Finetuning GenAI For Hacking and Defending
PDF
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
PDF
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
PDF
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
From Chatbot to Destroyer of Endpoints - Can ChatGPT Automate EDR Bypasses (1...
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Oh, the Possibilities - Balancing Innovation and Risk with Generative AI.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Cyber Defense Matrix Workshop - RSA Conference
A Constitutional Quagmire - Ethical Minefields of AI, Cyber, and Privacy.pdf
Securing AI - There Is No Try, Only Do!.pdf
GenAI Opportunities and Challenges - Where 370 Enterprises Are Focusing Now.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
10 Key Challenges for AI within the EU Data Protection Framework.pdf
Techniques for Automatic Device Identification and Network Assignment.pdf
Keynote : Presentation on SASE Technology
Keynote : AI & Future Of Offensive Security
Redefining Cybersecurity with AI Capabilities
Demystifying Neural Networks And Building Cybersecurity Applications
Finetuning GenAI For Hacking and Defending
(CISOPlatform Summit & SACON 2024) Kids Cyber Security .pdf
(CISOPlatform Summit & SACON 2024) Regulation & Response In Banks.pdf
(CISOPlatform Summit & SACON 2024) Cyber Insurance & Risk Quantification.pdf

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Programs and apps: productivity, graphics, security and other tools
PPT
Teaching material agriculture food technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Cloud computing and distributed systems.
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Programs and apps: productivity, graphics, security and other tools
Teaching material agriculture food technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Network Security Unit 5.pdf for BCA BBA.
Chapter 3 Spatial Domain Image Processing.pdf
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
The AUB Centre for AI in Media Proposal.docx
Cloud computing and distributed systems.
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
MYSQL Presentation for SQL database connectivity
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx
Big Data Technologies - Introduction.pptx

Finding Triggered Malice in Android Apps

  • 1. SESSION ID: #RSAC Christopher Kruegel Finding Triggered Malice in Android Apps MBS-W04 Chief Scientist Lastline, Inc.
  • 2. #RSAC Who am I? 2 Professor in Computer Science at UC Santa Barbara many systems security papers in academic conferences started malware research in about 2004 built and released practical systems (Anubis, Wepawet, …) Co-founder and Chief Scientist at Lastline, Inc. Lastline offers protection against zero-day threats and advanced malware effort to commercialize our research
  • 3. #RSAC What are we talking about? Android applications (apps) and mobile malware Power of static code analysis in the context of Android apps Tricky malware that uses triggers to evade detection Triggers and triggered malware in the wild 3
  • 5. #RSAC … and Android is leading the pack 5
  • 6. #RSAC Android Malware on the rise! Where are the differences to desktop applications? centralized control vet applications before they enter store can remotely remove installed applications carriers might have more complete picture of users and traffic apps are much easier to analyze statically use of Dalvik bytecode instead of x86 interesting GUI issues 6
  • 7. #RSAC Static Analysis for Android Apps Precise, scalable static analysis of Android apps Analysis over bytecode Minimal a priori assumptions regarding app design Cannot ignore difficult cases and adversarial behavior Do not consider apps in isolation (intents, user interaction, …) Scalability from the start 7
  • 8. #RSAC Dalvik Static Analysis Front-end APK unpacker DEX parser Androguard, dexlib produces custom IR Back-end operates on IR points-to, CFA, backwards slicing,… trigger analysis 8
  • 9. #RSAC Static Analysis 9 Tracking data flows is at the core of our analysis Analysis must handle not only data flows, but also values apps request permissions, but they are very coarse-grained string, value-range analysis
  • 10. #RSAC Static Analysis 10 Analysis must handle user interaction, activities, and intents otherwise, data flows can be “broken” Analysis must handle complex data structures standard collection classes key-value stores for intent parameters Whole system analysis
  • 11. #RSAC String Analysis 11 Robust and precise string modeling is a fundamental capability many interesting flows are parameterized by strings e.g., * ⇝ loadUrl symbolic strings are interesting and problematic String constraint solver tailored to common string operations in Android applications append, substring, reverse, charAt, delete, … STP as the backend SMT solver
  • 12. #RSAC Implicit Flow Reconstruction Android applications written as collections of event-driven or asynchronous components Activity, Service, BroadcastReceiver AsyncTask, Thread, Runnable, Callable requestLocationUpdates ⇝ onLocationChanged takePicture ⇝ onPictureTaken Analyzer models implicit flows through framework linking explicit handler registrations is straightforward implicit flow recovery through dynamic analysis 12
  • 13. #RSAC Implicit Flow Recovery 13 Identify previously unknown implicit flows increase coverage while preserving data flow precision Enabled by combination of instrumentation and Clicker tracing code injected, dynamic analysis driven by Clicker records exit points from application code records entry points into framework trace events binned by thread
  • 14. #RSAC Implicit Flow Recovery 14 Several classes of flows discovered explicit callback registration registration of callback groups “implicit” registration
  • 15. #RSAC (Some) Interesting Applications 15 Detection of triggered malware Finding GUI confusion attacks Finding dynamic code loading vulnerabilities Locate incorrect use of cryptography
  • 16. #RSAC (Some) Interesting Applications 16 Detection of triggered malware Finding GUI confusion attacks Finding dynamic code loading vulnerabilities Locate incorrect use of cryptography We focus on this one today!
  • 17. #RSAC Evasion and Triggers Malware authors are not sleeping they got the news that sandboxes are all the rage now since the code is executed, malware authors have options .. Evasion develop code that exhibits no malicious behavior in sandbox, but that infects the intended target 17
  • 18. #RSAC Evasion and Triggers 18 One key evasive technique relies on checking for specific values in the environment or inputs – these checks are called triggers Other evasive techniques used against sandbox technology exploit limited context avoid analysis (sleep, stalling) avoid analysis (move to kernel, for example, rootkits)
  • 19. #RSAC Trigger Analysis Data flow captures many important classes of malicious behaviors however, some behaviors are difficult to reason about purely through data flow 1. Analysis to find interesting checks that exhibit characteristics of triggering behavior adversaries often want to predicate their attack based on environmental conditions analysis identifies usage of predicates based on environmental data (e.g., location, time, SMS) 2. Then determine whether these checks guard “interesting” behaviors 19
  • 20. #RSAC Find Interesting Checks (1/2) Find conditionals that depend on interesting input location, date, time, SMS input … Use data flow analysis to determine where interesting input flows to, and what operations the program performs on these inputs Propagate constraints on input values along program paths we call these path predicates 20
  • 21. #RSAC Find Interesting Checks (2/2) Check for characteristics of triggering behavior checks might be very specific do the predicates significantly constrain the value domain? are there many checks applied to an input? program performs unusual operations on certain inputs do we see unusual operations / operands for certain inputs? These are heuristics, and we need to know something about the numbers and types of checks that benign programs perform on certain types of input 21
  • 22. #RSAC Find Interesting Checks 22 Example – Malicious application void onCreate(Bundle savedInstanceState) { currentTime = new Time(Time.getCurrentTimezone()); currentTime.setToNow(); newSiteAvailable = (currentTime.month > 4 && currentTime.month < 8) && currentTime.year >= 2013; How unusual is this?
  • 23. #RSAC Find Interesting Checks 23 Analysis of 3K apps yields Checks in malicious app yield a score of 3.7
  • 24. #RSAC Find Checks That Guard Behavior 24 Analysis can point human to suspicious checks support manual review Maybe we can do better check whether trigger-like check guards sensitive operation Easier approach check for sensitive operations directly on path guarded by check More complete approach check whether check can influence sensitive operation anywhere in the program
  • 25. #RSAC Find Checks That Guard Behavior 25 boolean onOptionsItemSelected(MenuItem item) { String updateUrl = ""; if(newSiteAvailable) { url = "http://www.evil.com"; updateUrl = getUpdatedUrl(); startIntent(url, updateUrl); else { startIntent(url); }
  • 26. #RSAC What did we find? Dataset of ~10K apps from the Google market Collection of triggered malware DARPA apps developed by Red Team Holy Colbert Trojan (backdoor in legitimate app) Zitmo (Zeus-In-The-MOile) RCSAndroid (Hacking Team) 26
  • 27. #RSAC Google Market Dataset of ~10K apps from the Google market 27 Domain # Apps # Apps w/ Checks # Suspicious Checks # Guarded Behavior # Post- processed Time 4,950 1,026 302 30 10 Location 3,430 137 71 23 8 SMS 1,138 223 89 64 17
  • 29. #RSAC Time Triggers Benign triggers to check for updates to implement countdown functionality 29
  • 31. #RSAC Location Triggers Benign triggers based on user-defined areas one interesting trigger for specific Japanese train station 31
  • 33. #RSAC SMS Triggers Mostly benign triggers apps check for sender, sender’s phone, or content to check if they need to process SMS for regular app functionality Two suspicious examples found tw.nicky.LockMyPhoneTrial (RemoteLock) com.innovationdroid.myremotephone (MyRemotePhone) 33
  • 34. #RSAC SMS Triggers RemoteLock (removed ~2013 from PlayStore) checks whether the incoming SMS matches with a long, hardcoded string (“adf…yhytdfsw”). If that is the case, the application unlocks the phone! MyRemotePhone (still available on PlayStore) checks whether the incoming SMS contains the following two strings: MPS: and gps (now mrp: gps). If that is the case, the application automatically sends an SMS to the original sender containing the current GPS coordinates! 34
  • 35. #RSAC Malware Samples DARPA Red Team apps deliberately developed to bypass dynamic analysis 5 time triggers (hardcoded dates and times) 1 location trigger [ based on Location.distanceBetween() ] 5 SMS triggers (contents of messages) malicious activity were data leaks and integrity violations 35
  • 36. #RSAC Malware Samples Zitmo checks for content in SMS to steal mTANs for banks SMS used to implement command and control Holy Colbert time trigger based on SimpleDateFormat API 36
  • 37. #RSAC Malware Samples RCSAndroid remote control app written by HackingTeam SMS-based trigger (comparison with values from a file) behaviors range from data leakage (send conversations, device information) to capture of screenshots and voice calls 37
  • 38. #RSAC RCSAndroid SMS-based check (comparison with values from a file) 38
  • 39. #RSAC RCSAndroid Based on the checks, an action is triggered … 39
  • 40. #RSAC (Some) Interesting Applications 40 Detection of triggered malware Finding GUI confusion attacks Finding dynamic code loading vulnerabilities Locate incorrect use of cryptography
  • 41. #RSAC Dynamic Code Loading Apps can load code dynamically at runtime download code from the Internet or local files various ways (DexClassLoader, CreatePackageContext, …) 41
  • 42. #RSAC Dynamic Code Loading Vulnerabilities Insecure downloads load code over HTTP Unprotected storage downloaded code is stored in location accessible to other apps Improper use of package names load code from other apps, specifying only package names 42
  • 43. #RSAC Dynamic Code Loading Vulnerabilities Top 50 free apps around end of 2013 43
  • 44. #RSAC Finding Incorrect Use of Crypto Finding apps that use broken crypto developers are not security experts AES/ECBAES/CBCPlaintext 44
  • 45. #RSAC Finding Incorrect Use of Crypto Almost 12K apps that use crypto 31% use known key 65% use ECB 16% use known IV for CBC 45
  • 46. #RSAC Lessons Learned 46 Understand that mobile threats are real Google Bouncer not enough Understand that fighting mobile malware is fundamentally different than fighting Windows malware ask your vendor how they detect mobile malware demand certain protection guarantees Vulnerabilities are real and widespread how to manage app installation, patching, … ?
  • 47. #RSAC Conclusions 47 Smartphones and apps increasingly popular and important Interesting differences between apps and traditional desktop programs allow for important security improvements easier static analysis Using static analysis to identify triggers and environmental checks in malicious Android apps