SlideShare a Scribd company logo
1 of 44
Download to read offline
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
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
Demonstrations

More Related Content

What's hot

Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentTeymur Kheirkhabarov
 
Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.VodqaBLR
 
Derbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryWill Schroeder
 
Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...Ajin Abraham
 
Penetration testing & Ethical Hacking
Penetration testing & Ethical HackingPenetration testing & Ethical Hacking
Penetration testing & Ethical HackingS.E. CTS CERT-GOV-MD
 
PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)Will Schroeder
 
Reverse engineering android apps
Reverse engineering android appsReverse engineering android apps
Reverse engineering android appsPranay Airan
 
Windows Operating System Archaeology
Windows Operating System ArchaeologyWindows Operating System Archaeology
Windows Operating System Archaeologyenigma0x3
 
Windows logging cheat sheet
Windows logging cheat sheetWindows logging cheat sheet
Windows logging cheat sheetMichael Gough
 
Trusted Platform Module (TPM)
Trusted Platform Module (TPM)Trusted Platform Module (TPM)
Trusted Platform Module (TPM)k33a
 
Android application penetration testing
Android application penetration testingAndroid application penetration testing
Android application penetration testingRoshan Kumar Gami
 
Smart phone and mobile device security
Smart phone and mobile device securitySmart phone and mobile device security
Smart phone and mobile device securityCAS
 
Beginner's Guide to SIEM
Beginner's Guide to SIEM Beginner's Guide to SIEM
Beginner's Guide to SIEM AlienVault
 
Forensic artifacts in modern linux systems
Forensic artifacts in modern linux systemsForensic artifacts in modern linux systems
Forensic artifacts in modern linux systemsGol D Roger
 
PHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabPHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabTeymur Kheirkhabarov
 

What's hot (20)

Hunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows EnvironmentHunting for Credentials Dumping in Windows Environment
Hunting for Credentials Dumping in Windows Environment
 
Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.Dynamic Security Analysis & Static Security Analysis for Android Apps.
Dynamic Security Analysis & Static Security Analysis for Android Apps.
 
Derbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active Directory
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...Automated Security Analysis of Android & iOS Applications with Mobile Securit...
Automated Security Analysis of Android & iOS Applications with Mobile Securit...
 
Incident response process
Incident response processIncident response process
Incident response process
 
IBM Security QRadar
 IBM Security QRadar IBM Security QRadar
IBM Security QRadar
 
Penetration testing & Ethical Hacking
Penetration testing & Ethical HackingPenetration testing & Ethical Hacking
Penetration testing & Ethical Hacking
 
PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)PSConfEU - Offensive Active Directory (With PowerShell!)
PSConfEU - Offensive Active Directory (With PowerShell!)
 
Reverse engineering android apps
Reverse engineering android appsReverse engineering android apps
Reverse engineering android apps
 
Windows Operating System Archaeology
Windows Operating System ArchaeologyWindows Operating System Archaeology
Windows Operating System Archaeology
 
Windows logging cheat sheet
Windows logging cheat sheetWindows logging cheat sheet
Windows logging cheat sheet
 
Trusted Platform Module (TPM)
Trusted Platform Module (TPM)Trusted Platform Module (TPM)
Trusted Platform Module (TPM)
 
Android application penetration testing
Android application penetration testingAndroid application penetration testing
Android application penetration testing
 
Smart phone and mobile device security
Smart phone and mobile device securitySmart phone and mobile device security
Smart phone and mobile device security
 
Beginner's Guide to SIEM
Beginner's Guide to SIEM Beginner's Guide to SIEM
Beginner's Guide to SIEM
 
Android sandbox
Android sandboxAndroid sandbox
Android sandbox
 
Forensic artifacts in modern linux systems
Forensic artifacts in modern linux systemsForensic artifacts in modern linux systems
Forensic artifacts in modern linux systems
 
MITRE ATT&CK Framework
MITRE ATT&CK FrameworkMITRE ATT&CK Framework
MITRE ATT&CK Framework
 
PHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabPHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On Lab
 

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

Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
3. Android Architecture.pptx
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptxHarshiniB11
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi androidsusijanny
 
Android app development
Android app developmentAndroid app development
Android app developmentAbhishek Saini
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and SecurityKelwin 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 OSEC-Council
 
Android App Development..
Android App Development..Android App Development..
Android App Development..ITM University
 
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 2013DuckMa
 
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 ArchitectureBin Yang
 
Overview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxOverview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxdebasish duarah
 
Android project architecture
Android project architectureAndroid project architecture
Android project architectureSourabh Sahu
 
Rapid Android Application Security Testing
Rapid Android Application Security TestingRapid Android Application Security Testing
Rapid Android Application Security TestingNutan Kumar Panda
 

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
 
3. Android Architecture.pptx
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptx
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
Android app development by abhi android
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
 
Android app development
Android app developmentAndroid app development
Android app development
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
 
Android village @nullcon 2012
Android village @nullcon 2012 Android village @nullcon 2012
Android village @nullcon 2012
 
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
 
Android App Development..
Android App Development..Android App Development..
Android App Development..
 
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
 
Bluestacks ANDROID
Bluestacks ANDROIDBluestacks ANDROID
Bluestacks ANDROID
 
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
 
Introduction of Android Architecture
Introduction of Android ArchitectureIntroduction of Android Architecture
Introduction of Android Architecture
 
Session 2 beccse
Session 2 beccseSession 2 beccse
Session 2 beccse
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Overview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptxOverview of Adroid Architecture.pptx
Overview of Adroid Architecture.pptx
 
Android project architecture
Android project architectureAndroid project architecture
Android project architecture
 
Android Programming
Android ProgrammingAndroid Programming
Android Programming
 
Rapid Android Application Security Testing
Rapid Android Application Security TestingRapid Android Application Security Testing
Rapid Android Application Security Testing
 
Android app devolopment
Android app devolopmentAndroid app devolopment
Android app devolopment
 

More from 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 SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam 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 CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam 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 3Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam 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 MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam 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 CiphersSam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
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)
 
10 RSA
10 RSA10 RSA
10 RSA
 
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
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 

Recently uploaded

Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 

Recently uploaded (20)

Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 

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
  • 14.
  • 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
  • 43.