CNIT 128 6. Analyzing Android Applications (Part 1)

Sam Bowne
Sam BowneInstructor at CCSF
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
1 of 44

Recommended

1. Mobile Application (In)security by
1. Mobile Application (In)security1. Mobile Application (In)security
1. Mobile Application (In)securitySam Bowne
621 views17 slides
CNIT 126: Ch 2 & 3 by
CNIT 126: Ch 2 & 3CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3Sam Bowne
484 views45 slides
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018 by
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018devCAT Studio, NEXON
9.8K views66 slides
Kernel Module Programming by
Kernel Module ProgrammingKernel Module Programming
Kernel Module ProgrammingSaurabh Bangad
29.4K views26 slides
YAML Magic by
YAML MagicYAML Magic
YAML MagicJulien Pivotto
4.3K views20 slides
Porting Android by
Porting AndroidPorting Android
Porting AndroidOpersys inc.
4K views42 slides

More Related Content

What's hot

Introduction to Embedded Linux by
Introduction to Embedded LinuxIntroduction to Embedded Linux
Introduction to Embedded LinuxHossain Reja
2.1K views55 slides
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis by
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisSam Bowne
2.6K views46 slides
(Ab)Using GPOs for Active Directory Pwnage by
(Ab)Using GPOs for Active Directory Pwnage(Ab)Using GPOs for Active Directory Pwnage
(Ab)Using GPOs for Active Directory PwnagePetros Koutroumpis
574 views53 slides
Zend PHP 5.3 Demo Certification Test by
Zend PHP 5.3 Demo Certification TestZend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestCarlos Buenosvinos
154K views42 slides
Jenkins Automation by
Jenkins AutomationJenkins Automation
Jenkins AutomationJulien Pivotto
5.2K views104 slides
게임 프로그래밍 기초 공부법 by
게임 프로그래밍 기초 공부법게임 프로그래밍 기초 공부법
게임 프로그래밍 기초 공부법Chris Ohk
60.3K views61 slides

What's hot(20)

Introduction to Embedded Linux by Hossain Reja
Introduction to Embedded LinuxIntroduction to Embedded Linux
Introduction to Embedded Linux
Hossain Reja2.1K views
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis by Sam Bowne
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
Sam Bowne2.6K views
게임 프로그래밍 기초 공부법 by Chris Ohk
게임 프로그래밍 기초 공부법게임 프로그래밍 기초 공부법
게임 프로그래밍 기초 공부법
Chris Ohk60.3K views
Ooad Uml by Dang Tuan
Ooad UmlOoad Uml
Ooad Uml
Dang Tuan4.4K views
Webdriver io presentation by João Nabais
Webdriver io presentationWebdriver io presentation
Webdriver io presentation
João Nabais1.8K views
CNIT 127: 8: Windows overflows (Part 2) by Sam Bowne
CNIT 127: 8: Windows overflows (Part 2)CNIT 127: 8: Windows overflows (Part 2)
CNIT 127: 8: Windows overflows (Part 2)
Sam Bowne628 views
Quickboot on i.MX6 by Gary Bisson
Quickboot on i.MX6Quickboot on i.MX6
Quickboot on i.MX6
Gary Bisson4.8K views
Python과 Git으로 만드는 모바일 게임 패치 시스템 by Youngtaek Oh
Python과 Git으로 만드는 모바일 게임 패치 시스템Python과 Git으로 만드는 모바일 게임 패치 시스템
Python과 Git으로 만드는 모바일 게임 패치 시스템
Youngtaek Oh15.8K views
DCEU 18: Dockerfile Best Practices by Docker, Inc.
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
Docker, Inc.2.8K views
ABS 2012 - Android Device Porting Walkthrough by Benjamin Zores
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting Walkthrough
Benjamin Zores10.4K views
Multiplayer Game Sync Techniques through CAP theorem by Seungmo Koo
Multiplayer Game Sync Techniques through CAP theoremMultiplayer Game Sync Techniques through CAP theorem
Multiplayer Game Sync Techniques through CAP theorem
Seungmo Koo11.8K views
9: OllyDbg by Sam Bowne
9: OllyDbg9: OllyDbg
9: OllyDbg
Sam Bowne390 views
API Test Automation Tips and Tricks by testhive
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Tricks
testhive817 views
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques by Sam Bowne
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 Bowne6.3K views
Jenkins for java world by Ashok Kumar
Jenkins for java worldJenkins for java world
Jenkins for java world
Ashok Kumar2.9K views

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

Introduction to android sessions new by
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
2K views78 slides
3. Android Architecture.pptx by
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptxHarshiniB11
9 views27 slides
My androidpresentation by
My androidpresentationMy androidpresentation
My androidpresentationniteshnarayanlal
451 views42 slides
Android app development by abhi android by
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi androidsusijanny
392 views15 slides
Android app development by
Android app developmentAndroid app development
Android app developmentAbhishek Saini
207 views15 slides
Introduction to Android Development and Security by
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and SecurityKelwin Yang
11.7K views51 slides

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

Introduction to android sessions new by Joe Jacob
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
Joe Jacob2K views
3. Android Architecture.pptx by HarshiniB11
3. Android Architecture.pptx3. Android Architecture.pptx
3. Android Architecture.pptx
HarshiniB119 views
Android app development by abhi android by susijanny
Android app development by abhi androidAndroid app development by abhi android
Android app development by abhi android
susijanny392 views
Introduction to Android Development and Security by Kelwin Yang
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
Kelwin Yang11.7K views
Android village @nullcon 2012 by hakersinfo
Android village @nullcon 2012 Android village @nullcon 2012
Android village @nullcon 2012
hakersinfo814 views
Hacker Halted 2014 - Reverse Engineering the Android OS by EC-Council
Hacker Halted 2014 - Reverse Engineering the Android OSHacker Halted 2014 - Reverse Engineering the Android OS
Hacker Halted 2014 - Reverse Engineering the Android OS
EC-Council2.7K views
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013 by DuckMa
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
DuckMa665 views
Android System Architecture And  Pen-testing of Android applications by yavuzwb
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
yavuzwb2.4K views
Introduction of Android Architecture by Bin Yang
Introduction of Android ArchitectureIntroduction of Android Architecture
Introduction of Android Architecture
Bin Yang1.4K views
Android project architecture by Sourabh Sahu
Android project architectureAndroid project architecture
Android project architecture
Sourabh Sahu147 views
Rapid Android Application Security Testing by Nutan Kumar Panda
Rapid Android Application Security TestingRapid Android Application Security Testing
Rapid Android Application Security Testing
Nutan Kumar Panda1.1K views

More from Sam Bowne

Cyberwar by
CyberwarCyberwar
CyberwarSam Bowne
15 views22 slides
3: DNS vulnerabilities by
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
40 views40 slides
8. Software Development Security by
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
24 views85 slides
4 Mapping the Application by
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
62 views88 slides
3. Attacking iOS Applications (Part 2) by
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
33 views45 slides
12 Elliptic Curves by
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
54 views50 slides

More from Sam Bowne(20)

3: DNS vulnerabilities by Sam Bowne
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
Sam Bowne40 views
8. Software Development Security by Sam Bowne
8. Software Development Security8. Software Development Security
8. Software Development Security
Sam Bowne24 views
4 Mapping the Application by Sam Bowne
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
Sam Bowne62 views
3. Attacking iOS Applications (Part 2) by Sam Bowne
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
Sam Bowne33 views
12 Elliptic Curves by Sam Bowne
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
Sam Bowne54 views
11. Diffie-Hellman by Sam Bowne
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
Sam Bowne58 views
2a Analyzing iOS Apps Part 1 by Sam Bowne
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
Sam Bowne42 views
9 Writing Secure Android Applications by Sam Bowne
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
Sam Bowne31 views
12 Investigating Windows Systems (Part 2 of 3) by 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)
Sam Bowne30 views
12 Investigating Windows Systems (Part 1 of 3 by Sam Bowne
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne59 views
9. Hard Problems by Sam Bowne
9. Hard Problems9. Hard Problems
9. Hard Problems
Sam Bowne43 views
8 Android Implementation Issues (Part 1) by Sam Bowne
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
Sam Bowne23 views
11 Analysis Methodology by Sam Bowne
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
Sam Bowne12 views
8. Authenticated Encryption by Sam Bowne
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
Sam Bowne71 views
7. Attacking Android Applications (Part 2) by Sam Bowne
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
Sam Bowne35 views
7. Attacking Android Applications (Part 1) by Sam Bowne
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
Sam Bowne29 views
5. Stream Ciphers by Sam Bowne
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
Sam Bowne108 views
6 Scope & 7 Live Data Collection by Sam Bowne
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
Sam Bowne124 views

Recently uploaded

Nelson_RecordStore.pdf by
Nelson_RecordStore.pdfNelson_RecordStore.pdf
Nelson_RecordStore.pdfBrynNelson5
46 views10 slides
MercerJesse2.1Doc.pdf by
MercerJesse2.1Doc.pdfMercerJesse2.1Doc.pdf
MercerJesse2.1Doc.pdfjessemercerail
314 views5 slides
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 by
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37MysoreMuleSoftMeetup
50 views17 slides
INT-244 Topic 6b Confucianism by
INT-244 Topic 6b ConfucianismINT-244 Topic 6b Confucianism
INT-244 Topic 6b ConfucianismS Meyer
45 views77 slides
Meet the Bible by
Meet the BibleMeet the Bible
Meet the BibleSteve Thomason
78 views80 slides
Mineral nutrition and Fertilizer use of Cashew by
 Mineral nutrition and Fertilizer use of Cashew Mineral nutrition and Fertilizer use of Cashew
Mineral nutrition and Fertilizer use of CashewAruna Srikantha Jayawardana
56 views107 slides

Recently uploaded(20)

Nelson_RecordStore.pdf by BrynNelson5
Nelson_RecordStore.pdfNelson_RecordStore.pdf
Nelson_RecordStore.pdf
BrynNelson546 views
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37 by MysoreMuleSoftMeetup
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
Payment Integration using Braintree Connector | MuleSoft Mysore Meetup #37
INT-244 Topic 6b Confucianism by S Meyer
INT-244 Topic 6b ConfucianismINT-244 Topic 6b Confucianism
INT-244 Topic 6b Confucianism
S Meyer45 views
Pharmaceutical Analysis PPT (BP 102T) by yakshpharmacy009
Pharmaceutical Analysis PPT (BP 102T) Pharmaceutical Analysis PPT (BP 102T)
Pharmaceutical Analysis PPT (BP 102T)
yakshpharmacy009108 views
The Accursed House by Émile Gaboriau by DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta251 views
EILO EXCURSION PROGRAMME 2023 by info33492
EILO EXCURSION PROGRAMME 2023EILO EXCURSION PROGRAMME 2023
EILO EXCURSION PROGRAMME 2023
info33492202 views
NodeJS and ExpressJS.pdf by ArthyR3
NodeJS and ExpressJS.pdfNodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdf
ArthyR348 views
Creative Restart 2023: Leonard Savage - The Permanent Brief: Unearthing unobv... by Taste
Creative Restart 2023: Leonard Savage - The Permanent Brief: Unearthing unobv...Creative Restart 2023: Leonard Savage - The Permanent Brief: Unearthing unobv...
Creative Restart 2023: Leonard Savage - The Permanent Brief: Unearthing unobv...
Taste55 views

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