SlideShare a Scribd company logo
CNIT 128
Hacking Mobile Devices
6. Analyzing Android Applications

Part 1
Topics
• Part 1
• Creating Your First Android Environment
• Understanding Android Applications
• Part 2
• Understanding the Security Model
• Reverse-Engineering Applications
Creating Your First Android
Environment
Android SDK
• Android Studio: complete app IDE
• Integrated Development Environment
• Command line tools only
Host OS
• Mac or Linux is best
• Windows causes many problems
• Bluestacks is best emulator for Windows
• We'll use Kali Linux
• Android tools already installed
Android SDK Tools
• adb
• The main tool you'll use
• Install apps
• Pull files off the device
• Get a shell
• Read logs
Android SDK Tools
• monitor
• See running processes
• android
• Manage Android emulators
• aapt
• Used by apktool to package source code
into binary form when building apps
Emulators
• Genymotion has 133 of them available
Emulator Restrictions
• Have root access
• No physical USB, headphones, Wi-Fi,
Bluetooth
• Cannot make phone calls
• Can simulate calls and SMS
Popular Emulators
• Virtualbox running Android x86
• BlueStacks, YouWave, Windows Android
• All run on Windows
Understanding Android
Applications
Android OS Basics
• Modified Linux kernel
• Virtual machine that runs Java-like apps
• Dalvik Virtual Machine
User Accounts
• On Linux, every app a user launches runs with
the same user ID (UID)
• This is the same as Windows
CNIT 128 6. Analyzing Android Applications (Part 1)
Android UIDs
• Each app runs under a different UID
• Unless a developer chooses to set several
apps with the same signature share a UID
Android UIDs
• adb shell
• ps -A
• Each app has an account starting u0_
• There are also special accounts like system and
root
/data/data
• Home directory for apps
Android Packages
• APK file
• Zipped archive
• Contains code, resources, and metadata
APK Packaging Process
• aapt converts XML resource files to binary
form
• aidl converts .aidl files to .java
• All source code and output from aapt and aidl
compiled into .class files by Java compiler
• dx converts .class files to a single
classes.dex file
APK Packaging Process
• apkbuilder combines all compiles resources,
images, and DEX file into an APK file
• jarsigner signs the APK
Structure of an APK
• /assets
• /res
• /lib
• /META-INF
• AndroidManifest.xml
• classes.dex
• resources.rsrc
Structure of an APK
• /assets
• Files developer wants to include
• /res
• Layouts, images, etc, in raw subdirectory
• /lib
• Libraries, in subdirectories x86, ARM, MIPS
Structure of an APK
• /META-INF
• Certificate of application, file inventory with
hashes
• AndroidManifest.xml
• Configuration of application and security
parameters
AndroidManifest.xml
Structure of an APK
• classes.dex
• Executable file containing Dalvik bytecode
• resources.rsrc
• Application strings
• Resources the developer chose to place
here instead of /res
Installing Packages
• GTalkService
• Maintains a connection to Google via pinned
SSL
• Fetches apps from Google Play
• Alternative apps stores are available
• Amazon, Samsung, GetJar, etc.
• Often even less safe
adb Commands
• adb install -- installs an app
• adb shell -- opens command shell
• adb push -- pushes file onto device
• adb pull -- pulls file from device
• adb forward -- forwards a TCP port
• adb logcat -- shows the syslog
Busybox
• A single binary with many useful Linux tools,
including:
• chmod, cp, echo, grep, ifconfig, mv, nc,
netstat, pwd, rm
Standard Android Tools
• pm -- Package Manager
• pm list packages -- show all packages
• pm path -- find stored APK for an app
• pm install
• pm uninstall
Standard Android Tools
• logcat -- view system logs
• getprop -- show system properties
• dumpsys -- status of system services
Drozer
• Security assessment tool
• Finds vulnerabilities
• Develops exploits
• Community edition is free
• Pro version costs money
How Drozer Works
• Agent
• App on device, a Remote Administration Tool
• Console
• Command-line tool on your computer
• Interacts with the Agent
• Server
• Routes sessions between Agent and
Console
Agent and Console
Binder
• Kernel module for Inter-Process
Communication (IPC)
• A character device at /dev /binder
Application Components
• Activities
• Visual screens of an app
• Services
• Components with no GUI
• Broadcast receivers
• Can detect events like an incoming SMS
• Content providers
• Data storehouses, often SQLite
Running

Services
• On Genymotion
• Settings
• System
• Advanced
• Developer
Options
• Running
services
AndroidManifest.xml
• Lists all
components
usable in
application
• Except
broadcast
receivers
• Lists permissions
Intents
• An object used for messaging between apps
• Works by calling binder
• This intent opens google.com in a browser
Implicit Intent
• The code on the last slide does not specify the
target app
• Any app that can respond to a VIEW action
on a URL is eligible to receive the intent
• If only one app can handle it, it goes there
• Otherwise an application picker appears
Intent Filters
• An app with this filter can diplay Web pages
Explicit Intent
• Sends URL specifically to the Android browser
Running an App
• When OS boots, a single VM starts
• A zygote process listens for app launch
requests
• Each app that launches causes a fork()
• Core libraries are shared between VMs
CNIT 128 6. Analyzing Android Applications (Part 1)
Demonstrations
Ad

More Related Content

What's hot (20)

Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Practical Malware Analysis Ch13
Practical Malware Analysis Ch13
Sam Bowne
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware BehaviorCNIT 126 11. Malware Behavior
CNIT 126 11. Malware Behavior
Sam Bowne
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application Technologies
Sam Bowne
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
Sam Bowne
 
Forensics Analysis and Validation
Forensics Analysis and Validation  Forensics Analysis and Validation
Forensics Analysis and Validation
Jyothishmathi Institute of Technology and Science Karimnagar
 
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
Sam Bowne
 
Disk forensics
Disk forensicsDisk forensics
Disk forensics
Chiawei Wang
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesCNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Sam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
Sam Bowne
 
Windows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseWindows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCase
Takahiro Haruyama
 
Linux forensics
Linux forensicsLinux forensics
Linux forensics
Santosh Khadsare
 
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Sam Bowne
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Sam Bowne
 
CNIT 121: 8 Forensic Duplication
CNIT 121: 8 Forensic DuplicationCNIT 121: 8 Forensic Duplication
CNIT 121: 8 Forensic Duplication
Sam Bowne
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA ProCNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro
Sam Bowne
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
Maarten Smeets
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
Sander Demeester
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Sam Bowne
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
Naveen Kumar Singh
 
Computer Forensics & Windows Registry
Computer Forensics & Windows RegistryComputer Forensics & Windows Registry
Computer Forensics & Windows Registry
aradhanalaw
 
Practical Malware Analysis Ch13
Practical Malware Analysis Ch13Practical Malware Analysis Ch13
Practical Malware Analysis Ch13
Sam Bowne
 
CNIT 126 11. Malware Behavior
CNIT 126 11. Malware BehaviorCNIT 126 11. Malware Behavior
CNIT 126 11. Malware Behavior
Sam Bowne
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application Technologies
Sam Bowne
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
Sam Bowne
 
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
Sam Bowne
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesCNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Sam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
Sam Bowne
 
Windows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCaseWindows Memory Forensic Analysis using EnCase
Windows Memory Forensic Analysis using EnCase
Takahiro Haruyama
 
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Sam Bowne
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Sam Bowne
 
CNIT 121: 8 Forensic Duplication
CNIT 121: 8 Forensic DuplicationCNIT 121: 8 Forensic Duplication
CNIT 121: 8 Forensic Duplication
Sam Bowne
 
CNIT 126 5: IDA Pro
CNIT 126 5: IDA ProCNIT 126 5: IDA Pro
CNIT 126 5: IDA Pro
Sam Bowne
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
Maarten Smeets
 
Process injection - Malware style
Process injection - Malware styleProcess injection - Malware style
Process injection - Malware style
Sander Demeester
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Sam Bowne
 
Agile Testing and Test Automation
Agile Testing and Test AutomationAgile Testing and Test Automation
Agile Testing and Test Automation
Naveen Kumar Singh
 
Computer Forensics & Windows Registry
Computer Forensics & Windows RegistryComputer Forensics & Windows Registry
Computer Forensics & Windows Registry
aradhanalaw
 

Similar to CNIT 128 6. Analyzing Android Applications (Part 1) (20)

Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
3. Android Architecture.pptx
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptx
HarshiniB11
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
niteshnarayanlal
 
Android app development
Android app developmentAndroid app development
Android app development
Abhishek Saini
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
susijanny
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
Kelwin Yang
 
Android village @nullcon 2012
Android village @nullcon 2012 Android village @nullcon 2012
Android village @nullcon 2012
hakersinfo
 
Hacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OSHacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
Android App Development..
Android App Development..Android App Development..
Android App Development..
ITM University
 
Chapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt plChapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt pl
ENBAKOMZAWUGA
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
DuckMa
 
Bluestacks ANDROID
Bluestacks ANDROIDBluestacks ANDROID
Bluestacks ANDROID
SUNIL KUMAR MAURYA
 
Android System Architecture And  Pen-testing of Android applications
Android System Architecture  And  Pen-testing of Android applications Android System Architecture  And  Pen-testing of Android applications
Android System Architecture And  Pen-testing of Android applications
yavuzwb
 
Introduction of Android Architecture
Introduction of Android ArchitectureIntroduction of Android Architecture
Introduction of Android Architecture
Bin Yang
 
Session 2 beccse
Session 2 beccseSession 2 beccse
Session 2 beccse
vin123456gangal
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Aravindharamanan S
 
Overview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxOverview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptx
debasish duarah
 
Android project architecture
Android project architectureAndroid project architecture
Android project architecture
Sourabh Sahu
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
Pasi Manninen
 
Mobile Application Slide Chapter 2 - Make First App
Mobile Application Slide Chapter 2 - Make First AppMobile Application Slide Chapter 2 - Make First App
Mobile Application Slide Chapter 2 - Make First App
sesam37434
 
Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob
 
3. Android Architecture.pptx
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptx
HarshiniB11
 
Android app development
Android app developmentAndroid app development
Android app development
Abhishek Saini
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
susijanny
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
Kelwin Yang
 
Android village @nullcon 2012
Android village @nullcon 2012 Android village @nullcon 2012
Android village @nullcon 2012
hakersinfo
 
Hacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OSHacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council
 
Android App Development..
Android App Development..Android App Development..
Android App Development..
ITM University
 
Chapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt plChapter 1 Introduction to android.ppt pl
Chapter 1 Introduction to android.ppt pl
ENBAKOMZAWUGA
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
DuckMa
 
Android System Architecture And  Pen-testing of Android applications
Android System Architecture  And  Pen-testing of Android applications Android System Architecture  And  Pen-testing of Android applications
Android System Architecture And  Pen-testing of Android applications
yavuzwb
 
Introduction of Android Architecture
Introduction of Android ArchitectureIntroduction of Android Architecture
Introduction of Android Architecture
Bin Yang
 
Overview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxOverview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptx
debasish duarah
 
Android project architecture
Android project architectureAndroid project architecture
Android project architecture
Sourabh Sahu
 
Mobile Application Slide Chapter 2 - Make First App
Mobile Application Slide Chapter 2 - Make First AppMobile Application Slide Chapter 2 - Make First App
Mobile Application Slide Chapter 2 - Make First App
sesam37434
 
Ad

More from Sam Bowne (20)

Introduction to the Class & CISSP Certification
Introduction to the Class & CISSP CertificationIntroduction to the Class & CISSP Certification
Introduction to the Class & CISSP Certification
Sam Bowne
 
Cyberwar
CyberwarCyberwar
Cyberwar
Sam Bowne
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
Sam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
Sam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
Sam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
Sam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
Sam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
10 RSA
10 RSA10 RSA
10 RSA
Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
Sam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
Sam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
Sam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
Sam Bowne
 
Introduction to the Class & CISSP Certification
Introduction to the Class & CISSP CertificationIntroduction to the Class & CISSP Certification
Introduction to the Class & CISSP Certification
Sam Bowne
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
Sam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
Sam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
Sam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
Sam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
Sam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
Sam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
Sam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
Sam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
Sam Bowne
 
Ad

Recently uploaded (20)

All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
The History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptxThe History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
Module 1: Foundations of Research
Module 1: Foundations of ResearchModule 1: Foundations of Research
Module 1: Foundations of Research
drroxannekemp
 
CNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscessCNS infections (encephalitis, meningitis & Brain abscess
CNS infections (encephalitis, meningitis & Brain abscess
Mohamed Rizk Khodair
 
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptxTERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
TERMINOLOGIES,GRIEF PROCESS AND LOSS AMD ITS TYPES .pptx
PoojaSen20
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFAMEDICAL BIOLOGY MCQS  BY. DR NASIR MUSTAFA
MEDICAL BIOLOGY MCQS BY. DR NASIR MUSTAFA
Dr. Nasir Mustafa
 
Search Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo SlidesSearch Matching Applicants in Odoo 18 - Odoo Slides
Search Matching Applicants in Odoo 18 - Odoo Slides
Celine George
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Botany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic ExcellenceBotany Assignment Help Guide - Academic Excellence
Botany Assignment Help Guide - Academic Excellence
online college homework help
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
Ajanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of HistoryAjanta Paintings: Study as a Source of History
Ajanta Paintings: Study as a Source of History
Virag Sontakke
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living WorkshopLDMMIA Reiki Yoga S5 Daily Living Workshop
LDMMIA Reiki Yoga S5 Daily Living Workshop
LDM Mia eStudios
 
How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18How to Configure Public Holidays & Mandatory Days in Odoo 18
How to Configure Public Holidays & Mandatory Days in Odoo 18
Celine George
 
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and GuestsLDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDMMIA Reiki News Ed3 Vol1 For Team and Guests
LDM Mia eStudios
 
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales moduleHow To Maximize Sales Performance using Odoo 18 Diverse views in sales module
How To Maximize Sales Performance using Odoo 18 Diverse views in sales module
Celine George
 
Cultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptxCultivation Practice of Garlic in Nepal.pptx
Cultivation Practice of Garlic in Nepal.pptx
UmeshTimilsina1
 

CNIT 128 6. Analyzing Android Applications (Part 1)

  • 1. CNIT 128 Hacking Mobile Devices 6. Analyzing Android Applications Part 1
  • 2. Topics • Part 1 • Creating Your First Android Environment • Understanding Android Applications • Part 2 • Understanding the Security Model • Reverse-Engineering Applications
  • 3. Creating Your First Android Environment
  • 4. Android SDK • Android Studio: complete app IDE • Integrated Development Environment • Command line tools only
  • 5. Host OS • Mac or Linux is best • Windows causes many problems • Bluestacks is best emulator for Windows • We'll use Kali Linux • Android tools already installed
  • 6. Android SDK Tools • adb • The main tool you'll use • Install apps • Pull files off the device • Get a shell • Read logs
  • 7. Android SDK Tools • monitor • See running processes • android • Manage Android emulators • aapt • Used by apktool to package source code into binary form when building apps
  • 8. Emulators • Genymotion has 133 of them available
  • 9. Emulator Restrictions • Have root access • No physical USB, headphones, Wi-Fi, Bluetooth • Cannot make phone calls • Can simulate calls and SMS
  • 10. Popular Emulators • Virtualbox running Android x86 • BlueStacks, YouWave, Windows Android • All run on Windows
  • 12. Android OS Basics • Modified Linux kernel • Virtual machine that runs Java-like apps • Dalvik Virtual Machine
  • 13. User Accounts • On Linux, every app a user launches runs with the same user ID (UID) • This is the same as Windows
  • 15. Android UIDs • Each app runs under a different UID • Unless a developer chooses to set several apps with the same signature share a UID
  • 16. Android UIDs • adb shell • ps -A • Each app has an account starting u0_ • There are also special accounts like system and root
  • 18. Android Packages • APK file • Zipped archive • Contains code, resources, and metadata
  • 19. APK Packaging Process • aapt converts XML resource files to binary form • aidl converts .aidl files to .java • All source code and output from aapt and aidl compiled into .class files by Java compiler • dx converts .class files to a single classes.dex file
  • 20. APK Packaging Process • apkbuilder combines all compiles resources, images, and DEX file into an APK file • jarsigner signs the APK
  • 21. Structure of an APK • /assets • /res • /lib • /META-INF • AndroidManifest.xml • classes.dex • resources.rsrc
  • 22. Structure of an APK • /assets • Files developer wants to include • /res • Layouts, images, etc, in raw subdirectory • /lib • Libraries, in subdirectories x86, ARM, MIPS
  • 23. Structure of an APK • /META-INF • Certificate of application, file inventory with hashes • AndroidManifest.xml • Configuration of application and security parameters
  • 25. Structure of an APK • classes.dex • Executable file containing Dalvik bytecode • resources.rsrc • Application strings • Resources the developer chose to place here instead of /res
  • 26. Installing Packages • GTalkService • Maintains a connection to Google via pinned SSL • Fetches apps from Google Play • Alternative apps stores are available • Amazon, Samsung, GetJar, etc. • Often even less safe
  • 27. adb Commands • adb install -- installs an app • adb shell -- opens command shell • adb push -- pushes file onto device • adb pull -- pulls file from device • adb forward -- forwards a TCP port • adb logcat -- shows the syslog
  • 28. Busybox • A single binary with many useful Linux tools, including: • chmod, cp, echo, grep, ifconfig, mv, nc, netstat, pwd, rm
  • 29. Standard Android Tools • pm -- Package Manager • pm list packages -- show all packages • pm path -- find stored APK for an app • pm install • pm uninstall
  • 30. Standard Android Tools • logcat -- view system logs • getprop -- show system properties • dumpsys -- status of system services
  • 31. Drozer • Security assessment tool • Finds vulnerabilities • Develops exploits • Community edition is free • Pro version costs money
  • 32. How Drozer Works • Agent • App on device, a Remote Administration Tool • Console • Command-line tool on your computer • Interacts with the Agent • Server • Routes sessions between Agent and Console
  • 34. Binder • Kernel module for Inter-Process Communication (IPC) • A character device at /dev /binder
  • 35. Application Components • Activities • Visual screens of an app • Services • Components with no GUI • Broadcast receivers • Can detect events like an incoming SMS • Content providers • Data storehouses, often SQLite
  • 36. Running
 Services • On Genymotion • Settings • System • Advanced • Developer Options • Running services
  • 37. AndroidManifest.xml • Lists all components usable in application • Except broadcast receivers • Lists permissions
  • 38. Intents • An object used for messaging between apps • Works by calling binder • This intent opens google.com in a browser
  • 39. Implicit Intent • The code on the last slide does not specify the target app • Any app that can respond to a VIEW action on a URL is eligible to receive the intent • If only one app can handle it, it goes there • Otherwise an application picker appears
  • 40. Intent Filters • An app with this filter can diplay Web pages
  • 41. Explicit Intent • Sends URL specifically to the Android browser
  • 42. Running an App • When OS boots, a single VM starts • A zygote process listens for app launch requests • Each app that launches causes a fork() • Core libraries are shared between VMs
  翻译: