SlideShare a Scribd company logo
Introduction to Mobile Security
Dominic Chen
ddchen@cmu.edu
Carnegie Mellon University
Goals
• What’s different about mobile security?
– Non-homogeneous hardware architecture
– Device capabilities
– Attacker goals
– Software ecosystems
2
Processor Architecture
3
Device Capabilities
4
• Connectivity
– GPS
– Cellular Network (GSM/CDMA)
– WiFi
– NFC
• Sensors
– Accelerometer
– Gyroscope
– Ambient Light
– Compass
– Barometer
– Fingerprint sensor
• Battery-powered
Malware Types
5
57.08%
21.52%
7.37%
3.44%
2.72%
2.54%
1.98%
1.62% 0.59% 0.50%
0.64%
Trojan (SMS)
RiskTool
Adware
Trojan
Monitor
Backdoor
Trojan (Financial)
Exploit
HackTool
Trojan (Downloader)
Others
Software Ecosystem
7
• Resource-limited devices
– Compute
– Power
• Event-driven programming
– No main() method
– State transitions via callbacks
• Well-defined interfaces
– Application lifecycle
– Access to user data
• Centralized software distribution
– Can only download applications from a single source
– Vendor takes responsibility for filtering content
Overview
• Architectural complexity
– New attack vectors
• Mobile operating systems
– Operating system safety protections
– Software development and distribution model
• Common problems with real-world software
– Cryptographic misuse
– Personal information leakage
• Current research techniques
8
Block Diagram (Nexus 5)
9
Block Diagram (Baseband)
10
Baseband Processor
11
• Separate processor or core that manages
radio functionality (why?)
• Typically runs a proprietary real-time
operating system
– Apple iPhone: Nucleus RTOS, ThreadX
– Qualcomm: Advanced Mobile Subscriber
Software (AMSS/REX OS)
• L4A Pistachio microkernel
Boot Process
12
ARM TrustZone
13
ARM TrustZone
14
• Provides a separate hardware-enforced
execution environment
– x86 protection rings (0, 3)
• Applications
– Digital rights management
– Secure key storage
– Mobile payments
– Secure boot management (Q-Fuses)
– Kernel integrity monitoring
ARM TrustZone
15
• Qualcomm Secure Execution Environment
(QSEE)
– Contains separate kernel with separate memory
space
– Has privileged access to all hardware and the
non-secure world
– Interfaces with the non-secure world via the
privileged Secure Monitor Call (SMC) instruction
Case Studies
16
• Baseband Attacks: Remote Exploitation of
Memory Corruptions in Cellular Protocol Stacks,
Ralf-Philpp Weinmann (WOOT 2012)
– Memory corruption in various baseband stacks led
to injection/execution of arbitrary code
• Reflections on Trusting TrustZone, Dan
Rosenberg (BlackHat 2014)
– Integer overflow vulnerability led to arbitrary write
of secure memory
• TrustNone, Sean Beaupre (11/28/15)
– Signed comparison on unsigned user input led to
arbitrary read/write of secure memory
Overview
• Architectural complexity
– New attack vectors
• Mobile operating systems
– Operating system safety protections
– Software development and distribution model
• Common problems with real-world software
– Cryptographic misuse
– Personal information leakage
• Current research techniques
17
Introduction: Android
• Originally developed by startup in 2003
– Bought out by Google in 2005
– Publicly released in 2007
• Mostly released under open source license
– Proprietary device-specific drivers distributed in
binary form
– Access to Play Store and Google applications
requires licensing agreement
• Fire OS, Baidu, Yandex.Store, etc
18
Version History
19
Security Model
• Utilizes a modified version of the Linux kernel
– Changes are slowly being merged back upstream
• UNIX permission model for applications
– Mandatory sandbox as separate users (distinct UID)
• Limited interface for inter-process
communication
• Applications are cryptographically signed and
verified
20
Architecture: Android
21
Safety Enhancements
• Android 1.5+
– Stack overflow protection (-fstack-protector)
– Safe integer operations (-lsafe_iop)
– Double free protection
– Memory allocation integer overflow protection
• Android 2.3+
– Format-string protections (-Wformat-security)
– Data execution protection (DEP)
– NULL pointer dereference protection
(vm.mmap_min_addr)
• Android 4.0+
– Address Space Layout Randomization (ASLR)
22
Safety Enhancements
• Android 4.1+
– Position Independent Executables (PIE)
– Read-only relocations (-Wl,-z,relro –Wl,-z,now)
• Android 5.0+
– Default full disk encryption
– Mandatory PIE
– SELinux
• Android 6.0+
– Verified boot
– USB access control
– Monthly security patches
23
Permission Model
• Capability-based access control model
• Categorized into various functional groups
– Bluetooth
– Camera
– Location (fine/coarse-grained)
– Network/data connection
– SMS/MMS
– Telephony
• User receives permission prompt at install-time
– All-or-nothing
24
Permission Model
25
Permission Model
26
Permission Model
• Starting with Android 6.0 (Marshmallow),
permissions are queried at run-time
– Allows users to deny individual permissions
– Was briefly available for Android 4.4.0 – 4.4.2
• 3rd party solutions
– Xposed Framework (requires root)
27
Application Structure
• Written in Java
– Interpreted by Dalvik bytecode virtual machine
• Uses just-in-time (JIT) techniques to compile native
code
– Replaced with Android Runtime (ART) in 5.0+
• Introduces ahead-of-time (AOT) compilation instead
of JIT
• Can also call into native code
– Uses Java Native Interface (JNI) to interface with
C/C++ libraries
28
Application Structure
• Activity
– Portions of the application’s user interface
• Login window, registration interface, etc.
• Service
– Performs background processing
• Download a file, play music, etc.
• Broadcast Receiver
– Handlers for global messages
• Boot completed, power disconnected, etc.
• Content Provider
– Manages access to structured data
• User calendar, contacts, etc.
29
Case Studies
• Stagefright, Zimperium (2015)
– Integer overflow vulnerabilities in system
multimedia library leads to remote code
execution
• Fixed in November monthly security patch
• Master Key, Bluebox Security (2013)
– Structure of Android application packages
allows manipulation of contents without
invalidating digital signatures
30
Introduction: iOS
• Originally developed in 2005
– Publicly released in 2007
• Based off of the Macintosh XNU kernel
– Supports memory-protection features
• ASLR, DEP, etc.
– UNIX-like
31
Security Model
• All applications must be signed by Apple
– Unless system is jailbroken to remove checks
• Individual applications are encrypted and
sandboxed from one another
• Code integrity is verified during execution
– Makes injection of shellcode difficult
32
Architecture: iOS
33
Application Structure
• Written in Objective-C or Swift
– Compiled by Clang/LLVM into native code
– Adds automatic reference counting for garbage
collection in Swift
• Transitioning to open source later this year
• Uses Model-View-Controller (MVC) design
paradigm
– Applications objects are model, view, or
controller
– Abstracts data from logic and presentation
34
Application Approvals
• Applications are typically submitted by
developers to App Store for inclusion
• These undergo a review process for unwanted
behavior or policy violations
– Objectionable content
– Game emulators
– Internal API’s
• Techniques
– Static analysis
– Manual review
35
Enterprise Provisioning
• Enterprise developer certificates allow
bypass of the App Store
– Designed for deployment of internal applications
to employees
• Historically, have also been used to bypass
platform security
– Game emulators
– Jailbreaking
– Malware
36
Case Studies
• XcodeGhost, Alibaba (2015)
– Modified version of Xcode uploaded to a Chinese file
sharing service inserted malicious code into binaries
• Pangu8, Pangu Team (2015)
– Heap overflow in kernel battery gauge service for
iOS 8 led to arbitrary writes of kernel memory
• limera1n, George Hotz (2010)
– Heap overflow in bootloader USB protocol
implementation led to arbitrary writes of memory
37
Overview
• Architectural complexity
– New attack vectors
• Mobile operating systems
– Operating system safety protections
– Software development and distribution model
• Common problems with real-world software
– Cryptographic misuse
– Personal information leakage
• Current research techniques
38
Common Problems
• Developers are not experts in implementing
or using cryptography
– Tendency to copy-paste “template” code
– Need to disable certain cryptographic features
for ease of debugging
• Developers tend to inadvertently or
maliciously request extraneous permissions
– Can use user information for advertising or
analytics
39
Cryptographic Misuse
1. Usage of ECB mode for encryption
2. Usage of static IV’s in CBC mode
3. Usage of hardcoded symmetric encryption
keys
4. Usage of low iterations for password-based
encryption
5. Bad seeding of random-number generators
40
Cryptographic Misuse
• CryptoLint, Manuel Egele et al. (CCS 2013)
1. Extract a control flow graph of an application
2. Identify calls to sensitive cryptographic API’s
3. Perform static backward slicing to evaluate
security rules
• Allows for automatic detection of
cryptographic misuse
41
Case Study
42
Password Manager (2010)
private String encrypt(byte [] key, String clear) {
byte [] encrypted;
byte [] salt = new byte[2];
...
Random rnd = new Random();
//Cipher cipher = Cipher.getInstance("AES");
Cipher cipher =
Cipher.getInstance("AES/ECB/PKCS7Padding", "BC");
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
rnd.nextBytes(salt);
cipher.update(salt);
encrypted = cipher.doFinal(clear.getBytes());
43
Password Manager (+6 days)
private String encrypt(byte [] key, String clear) {
byte [] encrypted;
byte [] salt = new byte[2];
...
Random rnd = new Random();
Cipher cipher =
Cipher.getInstance("AES/CBC/PKCS7Padding", "BC");
byte [] iv = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
IvParameterSpec ivSpec = new IvParameterSpec(iv);
cipher.init(Cipher.ENCRYPT_MODE, skeySpec, ivSpec);
rnd.nextBytes(salt);
cipher.update(salt);
encrypted = cipher.doFinal(clear.getBytes());
44
Password Manager (+2yrs, 5mo)
private String encrypt(byte [] key, String clear) {
...
Random rnd = new Random();
Cipher cipher =
Cipher.getInstance("AES/CBC/PKCS7Padding", "BC");
byte [] iv = new byte[16];
rnd.nextBytes(iv);
IvParameterSpec ivSpec = new IvParameterSpec(iv);
cipher.init(Cipher.ENCRYPT_MODE,skeySpec,ivSpec);
encrypted = cipher.doFinal(clear.getBytes());
...
45
Password Manager (key)
public static byte []
hmacFromPassword(String password) {
byte [] key = null;
...
Mac hmac = Mac.getInstance("HmacSHA256");
hmac.init (new SecretKeySpec
("notverysecretiv".getBytes("UTF-8"), "RAW"));
hmac.update(password.getBytes("UTF-8"));
key = hmac.doFinal();
...
return key;
46
Developer Education
47
48
Case Study
• TaintDroid, William Enck et al. (OSDI 2010)
– Dataset of 30 randomly selected popular
applications
– Flagged 105 TCP connections for containing
tainted privacy-sensitive information
• Leakage of device IMEI
• Leakage of device location
49
Overview
• Architectural complexity
– New attack vectors
• Mobile operating systems
– Operating system safety protections
– Software development and distribution model
• Common problems with real-world software
– Cryptographic misuse
– Personal information leakage
• Current research techniques
50
Program Analysis
• Taint Analysis
– Mechanism for identifying data flows in an
application
• Concepts:
– Basic Blocks
– Control Flow Graphs
– Call Graphs
51
Basic Block
• Sequence of instructions executed
consecutively
– Only the first instruction can be reached from
outside the block
– Only the last instruction may transition outside
the block
52
Basic Block
53
1. x = y + z
2. z = t + i
3. x = y + z
4. z = t + i
5. jmp 1
6. jmp 3
3 basic blocks
Control Flow Graph
54
• Each vertex is a basic block
• There is an edge between two vertexes if
there may be a transfer of control between
the blocks
• Typically limited to a single function or
procedure (intraprocedural)
Control Flow Graph
55
a = readline()
x = 0
if (a > 5) {
t = “gt”
x = 42
} else {
t = “lte”
x = 7
}
print(“input was ” +
t + “ 5”)
a = readline();
x = 0
if (a > 5)
print( … )
t = “lte”
x = 7
t = “gt”
x = 42
Call Graph
56
• Each node is a function
• There is an edge between nodes if a function
calls another
Call Graph
57
void orange()
{
green();
red();
}
void red()
{
...
}
void green()
{
green();
orange();
}
orange red green
Taint Analysis
• Technique or identifying movement of data
in an application
– Sources: Originations of privacy sensitive
information, e.g. address book API
– Sinks: Destinations of network communication,
e.g. socket API
• Determine what flows occur between
sources and sinks
58
Challenges
• Object-oriented languages encapsulate data as
objects in memory
– Callbacks and local functions are used to transfer
data
– Need to perform and propagate type recovery
• Class hierarchy
– Determine relationships between parent and child
classes
– Identify overridden and virtual functions
• Handle dynamic object introspection
– e.g. Reflection
59
Backward/Forward Slicing
• Identify all instructions that may influence a
given variable
– Program point
– Variable
• Can be performed in both directions
60
Backward/Forward Slicing
int main() {
int x, y, z;
x = 5 + 2 * 6;
y = getchar();
z = 8 + 10 % 3;
y = x + z * 5;
if (z > 9) {
x = 2 * z + 1;
} else {
x = 4 * z - 1;
}
y = 10 * y + 3;
return foo(x);
}
61
61
Usage
• Identify sources of data that is used in
cryptographic API’s
– Constant values
– Uninitialized data
• Identify sinks of data that originate from
user data
– Address book
– Calendar
– IMEI
62
Conclusion
• Architectural complexity
– New attack vectors
• Mobile operating systems
– Operating system safety protections
– Software development and distribution model
• Common problems with real-world software
– Cryptographic misuse
– Personal information leakage
• Current research techniques
63
64
Questions?
END

More Related Content

Similar to 19-f15-mobile-security.pptx

501 ch 7 advanced attacks
501 ch 7 advanced attacks501 ch 7 advanced attacks
501 ch 7 advanced attacks
gocybersec
 
VMI based malware detection in virtual environment
VMI based malware detection in virtual environmentVMI based malware detection in virtual environment
VMI based malware detection in virtual environment
Ayush Gargya
 
2 Security Architecture+Design
2 Security Architecture+Design2 Security Architecture+Design
2 Security Architecture+Design
Alfred Ouyang
 
ch03Threat Modeling - Locking the Door to Vulnerabilities.ppt
ch03Threat Modeling - Locking the Door to Vulnerabilities.pptch03Threat Modeling - Locking the Door to Vulnerabilities.ppt
ch03Threat Modeling - Locking the Door to Vulnerabilities.ppt
gealehegn
 
UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...
UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...
UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...
Vincent Giersch
 
chap-1 : Vulnerabilities in Information Systems
chap-1 : Vulnerabilities in Information Systemschap-1 : Vulnerabilities in Information Systems
chap-1 : Vulnerabilities in Information Systems
KashfUlHuda1
 
Osd diksha presentation
Osd diksha presentationOsd diksha presentation
Osd diksha presentation
dikshagupta111
 
CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
Sam Bowne
 
Ch 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden ThreatCh 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden Threat
Sam Bowne
 
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden ThreatCNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
Sam Bowne
 
System-level Threats: Dangerous Assumptions in modern Product Security
System-level Threats: Dangerous Assumptions in modern Product SecuritySystem-level Threats: Dangerous Assumptions in modern Product Security
System-level Threats: Dangerous Assumptions in modern Product Security
Cristofaro Mune
 
Offensive cyber security engineer pragram course agenda
Offensive cyber security engineer pragram course agendaOffensive cyber security engineer pragram course agenda
Offensive cyber security engineer pragram course agenda
ShivamSharma909
 
Offensive cyber security engineer updated
Offensive cyber security engineer updatedOffensive cyber security engineer updated
Offensive cyber security engineer updated
InfosecTrain
 
Offensive cyber security engineer
Offensive cyber security engineerOffensive cyber security engineer
Offensive cyber security engineer
ShivamSharma909
 
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...Lastline, Inc.
 
Secure IOT Gateway
Secure IOT GatewaySecure IOT Gateway
Secure IOT Gateway
LF Events
 
QNX Sales Engineering Presentation
QNX Sales Engineering PresentationQNX Sales Engineering Presentation
QNX Sales Engineering Presentation
Robert-Emmanuel Mayssat
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
RohitGautam261127
 
Protecting Against Web Attacks
Protecting Against Web AttacksProtecting Against Web Attacks
Protecting Against Web Attacks
Alert Logic
 
Application Explosion How to Manage Productivity vs Security
Application Explosion How to Manage Productivity vs SecurityApplication Explosion How to Manage Productivity vs Security
Application Explosion How to Manage Productivity vs Security
Lumension
 

Similar to 19-f15-mobile-security.pptx (20)

501 ch 7 advanced attacks
501 ch 7 advanced attacks501 ch 7 advanced attacks
501 ch 7 advanced attacks
 
VMI based malware detection in virtual environment
VMI based malware detection in virtual environmentVMI based malware detection in virtual environment
VMI based malware detection in virtual environment
 
2 Security Architecture+Design
2 Security Architecture+Design2 Security Architecture+Design
2 Security Architecture+Design
 
ch03Threat Modeling - Locking the Door to Vulnerabilities.ppt
ch03Threat Modeling - Locking the Door to Vulnerabilities.pptch03Threat Modeling - Locking the Door to Vulnerabilities.ppt
ch03Threat Modeling - Locking the Door to Vulnerabilities.ppt
 
UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...
UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...
UKC - Feb 2013 - Analyzing the security of Windows 7 and Linux for cloud comp...
 
chap-1 : Vulnerabilities in Information Systems
chap-1 : Vulnerabilities in Information Systemschap-1 : Vulnerabilities in Information Systems
chap-1 : Vulnerabilities in Information Systems
 
Osd diksha presentation
Osd diksha presentationOsd diksha presentation
Osd diksha presentation
 
CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
 
Ch 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden ThreatCh 9: Embedded Operating Systems: The Hidden Threat
Ch 9: Embedded Operating Systems: The Hidden Threat
 
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden ThreatCNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
CNIT 123: Ch 9: Embedded Operating Systems: The Hidden Threat
 
System-level Threats: Dangerous Assumptions in modern Product Security
System-level Threats: Dangerous Assumptions in modern Product SecuritySystem-level Threats: Dangerous Assumptions in modern Product Security
System-level Threats: Dangerous Assumptions in modern Product Security
 
Offensive cyber security engineer pragram course agenda
Offensive cyber security engineer pragram course agendaOffensive cyber security engineer pragram course agenda
Offensive cyber security engineer pragram course agenda
 
Offensive cyber security engineer updated
Offensive cyber security engineer updatedOffensive cyber security engineer updated
Offensive cyber security engineer updated
 
Offensive cyber security engineer
Offensive cyber security engineerOffensive cyber security engineer
Offensive cyber security engineer
 
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...
Full-System Emulation Achieving Successful Automated Dynamic Analysis of Evas...
 
Secure IOT Gateway
Secure IOT GatewaySecure IOT Gateway
Secure IOT Gateway
 
QNX Sales Engineering Presentation
QNX Sales Engineering PresentationQNX Sales Engineering Presentation
QNX Sales Engineering Presentation
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
 
Protecting Against Web Attacks
Protecting Against Web AttacksProtecting Against Web Attacks
Protecting Against Web Attacks
 
Application Explosion How to Manage Productivity vs Security
Application Explosion How to Manage Productivity vs SecurityApplication Explosion How to Manage Productivity vs Security
Application Explosion How to Manage Productivity vs Security
 

Recently uploaded

Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 

Recently uploaded (20)

Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 

19-f15-mobile-security.pptx

  • 1. Introduction to Mobile Security Dominic Chen ddchen@cmu.edu Carnegie Mellon University
  • 2. Goals • What’s different about mobile security? – Non-homogeneous hardware architecture – Device capabilities – Attacker goals – Software ecosystems 2
  • 4. Device Capabilities 4 • Connectivity – GPS – Cellular Network (GSM/CDMA) – WiFi – NFC • Sensors – Accelerometer – Gyroscope – Ambient Light – Compass – Barometer – Fingerprint sensor • Battery-powered
  • 5. Malware Types 5 57.08% 21.52% 7.37% 3.44% 2.72% 2.54% 1.98% 1.62% 0.59% 0.50% 0.64% Trojan (SMS) RiskTool Adware Trojan Monitor Backdoor Trojan (Financial) Exploit HackTool Trojan (Downloader) Others
  • 6. Software Ecosystem 7 • Resource-limited devices – Compute – Power • Event-driven programming – No main() method – State transitions via callbacks • Well-defined interfaces – Application lifecycle – Access to user data • Centralized software distribution – Can only download applications from a single source – Vendor takes responsibility for filtering content
  • 7. Overview • Architectural complexity – New attack vectors • Mobile operating systems – Operating system safety protections – Software development and distribution model • Common problems with real-world software – Cryptographic misuse – Personal information leakage • Current research techniques 8
  • 10. Baseband Processor 11 • Separate processor or core that manages radio functionality (why?) • Typically runs a proprietary real-time operating system – Apple iPhone: Nucleus RTOS, ThreadX – Qualcomm: Advanced Mobile Subscriber Software (AMSS/REX OS) • L4A Pistachio microkernel
  • 13. ARM TrustZone 14 • Provides a separate hardware-enforced execution environment – x86 protection rings (0, 3) • Applications – Digital rights management – Secure key storage – Mobile payments – Secure boot management (Q-Fuses) – Kernel integrity monitoring
  • 14. ARM TrustZone 15 • Qualcomm Secure Execution Environment (QSEE) – Contains separate kernel with separate memory space – Has privileged access to all hardware and the non-secure world – Interfaces with the non-secure world via the privileged Secure Monitor Call (SMC) instruction
  • 15. Case Studies 16 • Baseband Attacks: Remote Exploitation of Memory Corruptions in Cellular Protocol Stacks, Ralf-Philpp Weinmann (WOOT 2012) – Memory corruption in various baseband stacks led to injection/execution of arbitrary code • Reflections on Trusting TrustZone, Dan Rosenberg (BlackHat 2014) – Integer overflow vulnerability led to arbitrary write of secure memory • TrustNone, Sean Beaupre (11/28/15) – Signed comparison on unsigned user input led to arbitrary read/write of secure memory
  • 16. Overview • Architectural complexity – New attack vectors • Mobile operating systems – Operating system safety protections – Software development and distribution model • Common problems with real-world software – Cryptographic misuse – Personal information leakage • Current research techniques 17
  • 17. Introduction: Android • Originally developed by startup in 2003 – Bought out by Google in 2005 – Publicly released in 2007 • Mostly released under open source license – Proprietary device-specific drivers distributed in binary form – Access to Play Store and Google applications requires licensing agreement • Fire OS, Baidu, Yandex.Store, etc 18
  • 19. Security Model • Utilizes a modified version of the Linux kernel – Changes are slowly being merged back upstream • UNIX permission model for applications – Mandatory sandbox as separate users (distinct UID) • Limited interface for inter-process communication • Applications are cryptographically signed and verified 20
  • 21. Safety Enhancements • Android 1.5+ – Stack overflow protection (-fstack-protector) – Safe integer operations (-lsafe_iop) – Double free protection – Memory allocation integer overflow protection • Android 2.3+ – Format-string protections (-Wformat-security) – Data execution protection (DEP) – NULL pointer dereference protection (vm.mmap_min_addr) • Android 4.0+ – Address Space Layout Randomization (ASLR) 22
  • 22. Safety Enhancements • Android 4.1+ – Position Independent Executables (PIE) – Read-only relocations (-Wl,-z,relro –Wl,-z,now) • Android 5.0+ – Default full disk encryption – Mandatory PIE – SELinux • Android 6.0+ – Verified boot – USB access control – Monthly security patches 23
  • 23. Permission Model • Capability-based access control model • Categorized into various functional groups – Bluetooth – Camera – Location (fine/coarse-grained) – Network/data connection – SMS/MMS – Telephony • User receives permission prompt at install-time – All-or-nothing 24
  • 26. Permission Model • Starting with Android 6.0 (Marshmallow), permissions are queried at run-time – Allows users to deny individual permissions – Was briefly available for Android 4.4.0 – 4.4.2 • 3rd party solutions – Xposed Framework (requires root) 27
  • 27. Application Structure • Written in Java – Interpreted by Dalvik bytecode virtual machine • Uses just-in-time (JIT) techniques to compile native code – Replaced with Android Runtime (ART) in 5.0+ • Introduces ahead-of-time (AOT) compilation instead of JIT • Can also call into native code – Uses Java Native Interface (JNI) to interface with C/C++ libraries 28
  • 28. Application Structure • Activity – Portions of the application’s user interface • Login window, registration interface, etc. • Service – Performs background processing • Download a file, play music, etc. • Broadcast Receiver – Handlers for global messages • Boot completed, power disconnected, etc. • Content Provider – Manages access to structured data • User calendar, contacts, etc. 29
  • 29. Case Studies • Stagefright, Zimperium (2015) – Integer overflow vulnerabilities in system multimedia library leads to remote code execution • Fixed in November monthly security patch • Master Key, Bluebox Security (2013) – Structure of Android application packages allows manipulation of contents without invalidating digital signatures 30
  • 30. Introduction: iOS • Originally developed in 2005 – Publicly released in 2007 • Based off of the Macintosh XNU kernel – Supports memory-protection features • ASLR, DEP, etc. – UNIX-like 31
  • 31. Security Model • All applications must be signed by Apple – Unless system is jailbroken to remove checks • Individual applications are encrypted and sandboxed from one another • Code integrity is verified during execution – Makes injection of shellcode difficult 32
  • 33. Application Structure • Written in Objective-C or Swift – Compiled by Clang/LLVM into native code – Adds automatic reference counting for garbage collection in Swift • Transitioning to open source later this year • Uses Model-View-Controller (MVC) design paradigm – Applications objects are model, view, or controller – Abstracts data from logic and presentation 34
  • 34. Application Approvals • Applications are typically submitted by developers to App Store for inclusion • These undergo a review process for unwanted behavior or policy violations – Objectionable content – Game emulators – Internal API’s • Techniques – Static analysis – Manual review 35
  • 35. Enterprise Provisioning • Enterprise developer certificates allow bypass of the App Store – Designed for deployment of internal applications to employees • Historically, have also been used to bypass platform security – Game emulators – Jailbreaking – Malware 36
  • 36. Case Studies • XcodeGhost, Alibaba (2015) – Modified version of Xcode uploaded to a Chinese file sharing service inserted malicious code into binaries • Pangu8, Pangu Team (2015) – Heap overflow in kernel battery gauge service for iOS 8 led to arbitrary writes of kernel memory • limera1n, George Hotz (2010) – Heap overflow in bootloader USB protocol implementation led to arbitrary writes of memory 37
  • 37. Overview • Architectural complexity – New attack vectors • Mobile operating systems – Operating system safety protections – Software development and distribution model • Common problems with real-world software – Cryptographic misuse – Personal information leakage • Current research techniques 38
  • 38. Common Problems • Developers are not experts in implementing or using cryptography – Tendency to copy-paste “template” code – Need to disable certain cryptographic features for ease of debugging • Developers tend to inadvertently or maliciously request extraneous permissions – Can use user information for advertising or analytics 39
  • 39. Cryptographic Misuse 1. Usage of ECB mode for encryption 2. Usage of static IV’s in CBC mode 3. Usage of hardcoded symmetric encryption keys 4. Usage of low iterations for password-based encryption 5. Bad seeding of random-number generators 40
  • 40. Cryptographic Misuse • CryptoLint, Manuel Egele et al. (CCS 2013) 1. Extract a control flow graph of an application 2. Identify calls to sensitive cryptographic API’s 3. Perform static backward slicing to evaluate security rules • Allows for automatic detection of cryptographic misuse 41
  • 42. Password Manager (2010) private String encrypt(byte [] key, String clear) { byte [] encrypted; byte [] salt = new byte[2]; ... Random rnd = new Random(); //Cipher cipher = Cipher.getInstance("AES"); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding", "BC"); cipher.init(Cipher.ENCRYPT_MODE, skeySpec); rnd.nextBytes(salt); cipher.update(salt); encrypted = cipher.doFinal(clear.getBytes()); 43
  • 43. Password Manager (+6 days) private String encrypt(byte [] key, String clear) { byte [] encrypted; byte [] salt = new byte[2]; ... Random rnd = new Random(); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding", "BC"); byte [] iv = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; IvParameterSpec ivSpec = new IvParameterSpec(iv); cipher.init(Cipher.ENCRYPT_MODE, skeySpec, ivSpec); rnd.nextBytes(salt); cipher.update(salt); encrypted = cipher.doFinal(clear.getBytes()); 44
  • 44. Password Manager (+2yrs, 5mo) private String encrypt(byte [] key, String clear) { ... Random rnd = new Random(); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS7Padding", "BC"); byte [] iv = new byte[16]; rnd.nextBytes(iv); IvParameterSpec ivSpec = new IvParameterSpec(iv); cipher.init(Cipher.ENCRYPT_MODE,skeySpec,ivSpec); encrypted = cipher.doFinal(clear.getBytes()); ... 45
  • 45. Password Manager (key) public static byte [] hmacFromPassword(String password) { byte [] key = null; ... Mac hmac = Mac.getInstance("HmacSHA256"); hmac.init (new SecretKeySpec ("notverysecretiv".getBytes("UTF-8"), "RAW")); hmac.update(password.getBytes("UTF-8")); key = hmac.doFinal(); ... return key; 46
  • 47. 48
  • 48. Case Study • TaintDroid, William Enck et al. (OSDI 2010) – Dataset of 30 randomly selected popular applications – Flagged 105 TCP connections for containing tainted privacy-sensitive information • Leakage of device IMEI • Leakage of device location 49
  • 49. Overview • Architectural complexity – New attack vectors • Mobile operating systems – Operating system safety protections – Software development and distribution model • Common problems with real-world software – Cryptographic misuse – Personal information leakage • Current research techniques 50
  • 50. Program Analysis • Taint Analysis – Mechanism for identifying data flows in an application • Concepts: – Basic Blocks – Control Flow Graphs – Call Graphs 51
  • 51. Basic Block • Sequence of instructions executed consecutively – Only the first instruction can be reached from outside the block – Only the last instruction may transition outside the block 52
  • 52. Basic Block 53 1. x = y + z 2. z = t + i 3. x = y + z 4. z = t + i 5. jmp 1 6. jmp 3 3 basic blocks
  • 53. Control Flow Graph 54 • Each vertex is a basic block • There is an edge between two vertexes if there may be a transfer of control between the blocks • Typically limited to a single function or procedure (intraprocedural)
  • 54. Control Flow Graph 55 a = readline() x = 0 if (a > 5) { t = “gt” x = 42 } else { t = “lte” x = 7 } print(“input was ” + t + “ 5”) a = readline(); x = 0 if (a > 5) print( … ) t = “lte” x = 7 t = “gt” x = 42
  • 55. Call Graph 56 • Each node is a function • There is an edge between nodes if a function calls another
  • 56. Call Graph 57 void orange() { green(); red(); } void red() { ... } void green() { green(); orange(); } orange red green
  • 57. Taint Analysis • Technique or identifying movement of data in an application – Sources: Originations of privacy sensitive information, e.g. address book API – Sinks: Destinations of network communication, e.g. socket API • Determine what flows occur between sources and sinks 58
  • 58. Challenges • Object-oriented languages encapsulate data as objects in memory – Callbacks and local functions are used to transfer data – Need to perform and propagate type recovery • Class hierarchy – Determine relationships between parent and child classes – Identify overridden and virtual functions • Handle dynamic object introspection – e.g. Reflection 59
  • 59. Backward/Forward Slicing • Identify all instructions that may influence a given variable – Program point – Variable • Can be performed in both directions 60
  • 60. Backward/Forward Slicing int main() { int x, y, z; x = 5 + 2 * 6; y = getchar(); z = 8 + 10 % 3; y = x + z * 5; if (z > 9) { x = 2 * z + 1; } else { x = 4 * z - 1; } y = 10 * y + 3; return foo(x); } 61 61
  • 61. Usage • Identify sources of data that is used in cryptographic API’s – Constant values – Uninitialized data • Identify sinks of data that originate from user data – Address book – Calendar – IMEI 62
  • 62. Conclusion • Architectural complexity – New attack vectors • Mobile operating systems – Operating system safety protections – Software development and distribution model • Common problems with real-world software – Cryptographic misuse – Personal information leakage • Current research techniques 63
  • 64. END

Editor's Notes

  1. http://www.bdti.com/InsideDSP/2012/06/21/Qualcomm
  2. http://media.kaspersky.com/pdf/Kaspersky-Lab-KSN-Report-mobile-cyberthreats-web.pdf
  3. https://www.idc.com/prodserv/smartphone-os-market-share.jsp
  4. https://www.idc.com/prodserv/smartphone-os-market-share.jsp
  5. https://docs.google.com/file/d/0B7VNhP6LbXNmdl9wZG1OSTBnVUE/edit?pli=1
  6. http://www.androidauthority.com/smartphones-have-a-second-os-317800/
  7. Reasons: Timing-dependent, certification of entire radio software stack
  8. http://forum.xda-developers.com/showpost.php?p=30055671 http://forum.xda-developers.com/showpost.php?p=63862650&postcount=158
  9. http://www.arm.com/products/processors/technologies/trustzone/tee-smc.php
  10. https://www.blackhat.com/docs/us-14/materials/us-14-Rosenberg-Reflections-On-Trusting-TrustZone-WP.pdf
  11. https://www.usenix.org/system/files/conference/woot12/woot12-final24.pdf https://www.blackhat.com/docs/us-14/materials/us-14-Rosenberg-Reflections-on-Trusting-TrustZone.pdf http://theroot.ninja/disclosures/TRUSTNONE_1.0-11282015.pdf
  12. https://commons.wikimedia.org/wiki/File:Android_historical_version_distribution_-_vector.svg
  13. https://source.android.com/security/overview/kernel-security.html
  14. http://androidteam.googlecode.com/files/Anatomy-Physiology-of-an-Android.pdf
  15. https://www.duosecurity.com/blog/exploit-mitigations-in-android-jelly-bean-4-1 https://source.android.com/security/enhancements/enhancements50.html https://source.android.com/security/enhancements/enhancements60.html
  16. https://www.duosecurity.com/blog/exploit-mitigations-in-android-jelly-bean-4-1
  17. https://www.internetsafetyproject.org/wiki/android-permissions
  18. http://www.snoopwall.com/threat-reports-10-01-2014/
  19. http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=4768655
  20. http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=4768655
  21. https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/OSX_Technology_Overview/MediaLayer/MediaLayer.html
  22. https://developer.apple.com/library/ios/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html