18 Mobile Malware
18 Mobile Malware
18 Mobile Malware
Mobile Malware
John Mitchell
Outline
• Mobile malware
• Identifying malware
– Detect at app store rather than on platform
• Classification study of mobile web apps
– Entire Google Play market as of 2014
– 85% of approx 1 million apps use web interface
• Target fragmentation in Android
– Out-of-date Apps may disable more recent
security platform patches
Malware Trends
W
Based on FairPlay vulnerability
http://www.androidcentral.com/top-free-antivirus-apps-android
• “Even security companies know the risk is low — that's why apps
are packaged with other selling points.” - AndroidCentral
• Kevin Haley, Symantec's Director of Symantec Security Response:
– "Symantec sees an important role to play in helping to protect
data and mobile devices from being exposed to risk," …
– "While Symantec sees its purpose in the mobile landscape as
providing security against malware, fraud and scams; we also
protect devices against loss and theft — loss of the device itself,
as well as the information on it. In addition, Symantec helps
businesses protect and manage their data being stored or
transmitted through the mobile devices of their employees."
http://www.androidcentral.com/antivirus-android-do-you-need-it
Android malware example
Install malicious “conference app”
Malware behavior triggered by C&C
server (Chuli)
Outline
• Mobile malware
• Identifying malware
– Detect at app store rather than on platform
• Classification study of mobile web apps
– Entire Google Play market as of 2014
– 85% of approx 1 million apps use web interface
• Target fragmentation in Android
– Out-of-date Apps may disable more recent
security platform patches
STAMP Admission System
Static Analysis
More behaviors,
fewer details
Static
STAMP
Source: sendSMS()
getLoc() Sink: SMS
Location
• Source-to-sink flows
o Sources: Location, Calendar, Contacts, Device ID etc.
o Sinks: Internet, SMS, Disk, etc.
Data Flow Analysis in Action
• Malware/Greyware Analysis
o Data flow summaries enable enterprise-specific policies
• API Misuse and Data Theft Detection
Source: Send
FB API Sink: Internet
FB_Data Internet
• Vulnerability Discovery
Phone Number
Address
Source:
Web SQL Stmt Sink: SQL
Untrusted_Data
Challenges
• Android is 3.4M+ lines of complex code
o Uses reflection, callbacks, native code
OS
HW
Building Models
• 30k+ methods in Java/Android API
o 5 mins x 30k = 2500 hours
@STAMP(
SRC ="$GET_PHONE_STATE.deviceid",
SINK ="@return"
)
Data We Track (Sources)
• Account data
• Audio
• Calendar
• Call log 30+ types of
• Camera sensitive data
• Contacts
• Device Id
• Location
• Photos (Geotags)
• SD card data
• SMS
Data Destinations (Sinks)
• Internet (socket)
• SMS
• Email 10+ types of
• System Logs exit points
• Webview/Browser
• File System
• Broadcast Message
Currently Detectable Flow Types
Description:
This application allows you to synchronize
your Facebook contacts on Android.
IMPORTANT:
* "Facebook does not allow [sic] to export phone
numbers or emails. Only names, pictures and
statuses are synced."
* "Facebook users have the option to block one or all
apps. If they opt for that, they will be EXCLUDED
from your friends list."
READ_SYNC_SETTINGS
WRITE_SETTINGS
READ_SYNC_STATS WRITE_CONTACTS
GET_ACCOUNTS WRITE_SECURE_SETTINGS
INTERNET WRITE_SETTINGS
Expected Flows
Sources Sinks
READ_CONTACTS INTERNET
READ_SYNC_SETTINGS
WRITE_SETTINGS
READ_SYNC_STATS WRITE_CONTACTS
GET_ACCOUNTS WRITE_SECURE_SETTINGS
INTERNET WRITE_SETTINGS
Observed Flows
Read Source:
Send Internet Sink: Internet
Contacts Contacts
Outline
• Mobile malware
• Identifying malware
– Detect at app store rather than on platform
• Classification study of mobile web apps
– Entire Google Play market as of 2014
– 85% of approx 1 million apps use web interface
• Target fragmentation in Android
– Out-of-date Apps may disable more recent
security platform patches
A Large-Scale Study of
Mobile Web App Security
Patrick Mutchler, Adam Doupe,
John Mitchell, Chris Kruegel, Giovanni Vigna
Mobile Apps
Mobile Apps
Mobile Apps
Mobile Web Apps
Java
JavaScript
JavaScript Bridge
f.bar();
Java
JavaScript
Why?
– Everyone
Isolated in Browser
No origin distinction in WebView
f.bar();
Java
JavaScript
Static Analysis
- Facebook
“…only loading content from trusted
sources into WebView will help protect
users.”
}
public boolean shouldOverrideUrlLoading(
WebView view, String url){
Bridge
content
Use HTTPS?
• 152,706 apps with partially computed URLs
• 87,968 apps (57%) with HTTP URLs
Handling SSL Errors
onReceivedSslError
1. handler.proceed()
2. handler.cancel()
3. view.loadUrl(...)
Mishandling SSL Errors
• 117,974 apps implement
onReceivedSslError
• 29,652 apps (25%) must ignore errors
Primary results
Unsafe Nav 15 34
HTTP 40 56
Unsafe HTTPS 27 29
Popularity
Outdated Apps
Libraries
Security consequences
Roadmap
Security consequences
“If the device is running Android 6.0 or higher… [the app] must
request each dangerous permission that it needs while the app is
running.
Security consequences
Dataset
Outdatedness
Security consequences
Fragment Injection
Vulnerable App
Malicious Intent
PreferenceActivity
Extra.SHOW_FRAGMENT
“Attacked Fragment”
Extra.SHOW_FRAG_ARG
Attacked
Fragment
Other
Data
Extras
securityintelligence.com/new-vulnerability-android-framework-fragm ent-injection/
Fragment Injection
Vulnerable if:
- Targets 4.3 or lower (31%)
- Some class inherits from PreferenceActivity (4.8%)
- That class is exported (1.1%)
- That class does not override isValidFragment (0.55%)