SlideShare a Scribd company logo
An Introduction to Android
         Development and Security




Kun Yang
kelwya@gmail.com
Android & Me
• I’m a first-year graduate student.
• I developed my first Android APP——BloGeo
  two years ago.
• I’ve been an Android user for two years.
• Now I’ve just started to learn Android security.
Outline
• Introduction to Android
   – Brief history
   – Architecture
• Android Development
   –   Environment
   –   Programming framework
   –   Building and running process
   –   Case Study
• Overview of Android Security Feature
• Android Security Lab (by Security Compass)
• My Future Study
Brief History
•   Written by Andy Rubin(founder of Android Inc.)
•   Acquired by Google in 2005
•   Android 1.0 released in 2007
•   Android 4.0 released in 2011
•   52.5% of global mobile users
Brief Introduction
• First complete, open and free mobile
  platform
• Operating System
  – Mobile device optimized Linux kernel 2.6
• Application framework
  – Mainly Java-based
  – Running on Dalvik virtual machine featuring JIT
    compilation
• Key applications
  – Gmail, Maps, Contacts, Market and etc.
Architecture
Developing Environment
• Totally free-of-charge
  – Open source
  – Eclipse with ADT plugin
  – SDK tools with an emulator
  – Android market
• Dev guide
  – http://developer.android.com
Android SDK Updater & AVD
Android emulator
Dalvik Debug Monitor
Application Framework Overview
• Components
  – Activities
  – Views
  – Intents
  – Services
  – Content providers
  – Broadcast receivers
• Resources
• Manifest File
Activities
• An activity is a single, focused thing that the
  user can do
• Typically correspond to one UI screen
• Activities are stacked like a deck of cards
• Active activity is placed on top
Activity
      Lifecycle
• 4 states
  –   Active
  –   Paused(visible, not active)
  –   Stopped(invisible)
  –   Destroyed
• Call back functions
  – onCreate & onDestroy
  – onStart & onStop & onRestart
  – onResume & onPause
Hello World Activity
Views
• Views are GUI controls(E.g. TextView, EditText, Button)
• Activity windows consist of views and viewgroups
• Organized as trees to build up GUIs
• Operations we can perform on views
   –   Set properties: Use function or define in the XML layout files to load.
   –   Set focus
   –   Set up listener
   –   Set visibility
   –   Draw anything we like
• We can use Layout to help place views
   – E.g. LinearLayout, TableLayout, AbsoluteLayout
   – Use function or define in the XML layout files
Hello World using Layout XML Files
Example Views
Intents
• Intents are used to exchange data between
  Activities or Applications
• Think of Intents as a verb and object; a
  description of what you want done
  – E.g. VIEW, CALL, PLAY etc..
• Describes what the application wants
• Provides late runtime binding
Services
• Services run in the background
• Don’t interact with the user
• Run on the main thread of the process
Content Providers
• Content providers store and retrieve data and make
  it accessible to all applications
• It is the only way to share data across packages
• The backend is SQLite
• They are linked to clients
• Data exposed as a unique URI
Resources
• Resources are images , strings and etc.
• Externalize resources from application code
• SDK will generate codes to map a resource to
  an id, we can use static class R to get
  resources
• Layout xml files are also resources
Manifest File
• Control file that tells the system what to do
  and how the top-level components are related
• It’s the “glue” that actually specifies which
  intents your activities receive
• Specifies permissions
Building and Running
• Android package format
  – Bundle a few files into a file(.apk)
  – Just a zip file
  – Classes.dex is core file – compiled java classes
  – Use ‘DX’ tool to convert Java *.class to Dalvik
    bytecode *.dex
Building and Running
Building and Running
• DEX process flow
Building and Running
• Simplified Process Diagram
Developing Process
•   Create your own android project
•   Design the UI
•   Externalize resources
•   React to events
•   Run the application
BloGeo
Android Security Overview
• Goals
  – Protect user data
  – Protect system resources (including the network)
  – Provide application isolation
• Android security features provided
  – Robust security at the OS level through the Linux
    kernel
  – Mandatory application sandbox for all applications
  – Secure interprocess communication
  – Application signing
  – Application-defined and user-granted permissions
Android Security Overview(cont.)
• Application Sandbox: Kernel Level
  – Each Application has a user ID(UID) to run
• Interprocess Communication
  – Binder
     • A lightweight capability-based remote procedure call mechanism
       designed for high performance when performing in-process and
       cross-process calls.
   – Intents
   – ContentProviders
• Application signing
Android Security Overview(cont.)
• Application-defined and user-granted permissions
   – Camera functions
   – Location data (GPS)
   – Bluetooth functions
   – Telephony functions
   – SMS/MMS functions
   – Network
ExploitMe Mobile Android Labs
• By Security Compass
  – information security consulting firm
  – specializing in secure software development and
    training
• An open source project demonstrating
  Android mobile hacking
• A bank transfer mobile client
• Server written in python(http/https)
• 8 Labs
Lab 1: Secure connections




• python app.py
• emulator.exe -avd emu -tcpdump
  test.cap
• Solution: python app.py --ssl --port 8443
Lab 2 - Parameter Manipulation
• emulator @YOUR_AVD_NAME --http-proxy
  localhost:8008

• http post

Solution:
Lab 3 - Insecure file storage




            File creation mode: the default mode, where the created file can only be
Solution:   accessed by the calling application (or all applications sharing the same
            user ID).
Lab 4 - Secure Logging
                        Solution:
• adb logcat
                            Be aware of what you
                            are logging and only log
                            non-sensitive
                            information.
Lab 5 - Basic Encryption
Lab 5 - Basic Encryption(cont.)
Lab 6 - Advanced Encryption
• apktool
  – It is a tool for reengineering 3rd party, closed,
    binary Android apps.
  – It can decode resources to nearly original form
    and rebuild them after making some
    modifications.
Lab 6 - Advanced Encryption(cont.)
• apktool d BasicEncryptionSolution.apk export
Lab 6 - Advanced Encryption(cont.)
Lab 6 - Advanced Encryption(cont.)
• Smali
  – Smali is an assembler for the dex format used by
    dalvik
Lab 6 - Advanced Encryption(cont.)
Lab 7 - Memory Protection
Lab 7 - Memory Protection
• hprof-conv source dest
  – Convert dex memory dump format to Java format
• Use MAT(memory analyzer tool) to browse it
Lab 7 - Memory Protection(cont.)
Lab 7 - Memory Protection(cont.)
Lab 8 - Client-side Password
         complexity
Future Study

          Android Reverse Engineering!

I hope I can show you some more hacking examples next time.
Thanks!
 Q&A

More Related Content

What's hot

Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
Marakana Inc.
 
Understanding Android Security
Understanding Android SecurityUnderstanding Android Security
Understanding Android Security
Asanka Dilruk
 
Permission in Android Security: Threats and solution
Permission in Android Security: Threats and solutionPermission in Android Security: Threats and solution
Permission in Android Security: Threats and solution
Tandhy Simanjuntak
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
Sperasoft
 
2015.04.24 Updated > Android Security Development - Part 1: App Development
2015.04.24 Updated > Android Security Development - Part 1: App Development 2015.04.24 Updated > Android Security Development - Part 1: App Development
2015.04.24 Updated > Android Security Development - Part 1: App Development
Cheng-Yi Yu
 
Android Security Overview and Safe Practices for Web-Based Android Applications
Android Security Overview and Safe Practices for Web-Based Android ApplicationsAndroid Security Overview and Safe Practices for Web-Based Android Applications
Android Security Overview and Safe Practices for Web-Based Android Applications
h4oxer
 
Android Security
Android SecurityAndroid Security
Android Security
Mehrnaz Amoon
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Development
hackstuff
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthinkspa
 
Android Security - Common Security Pitfalls in Android Applications
Android Security - Common Security Pitfalls in Android ApplicationsAndroid Security - Common Security Pitfalls in Android Applications
Android Security - Common Security Pitfalls in Android Applications
BlrDroid
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration Testing
Subho Halder
 
Bypassing the Android Permission Model
Bypassing the Android Permission ModelBypassing the Android Permission Model
Bypassing the Android Permission ModelGeorgia Weidman
 
Android Device Hardening
Android Device HardeningAndroid Device Hardening
Android Device Hardening
anupriti
 
Смирнов Александр, Security in Android Application
Смирнов Александр, Security in Android ApplicationСмирнов Александр, Security in Android Application
Смирнов Александр, Security in Android Application
SECON
 
[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop
OWASP
 
Getting started with Android pentesting
Getting started with Android pentestingGetting started with Android pentesting
Getting started with Android pentesting
Minali Arora
 
6. Analyzing Android Applications Part 2
6. Analyzing Android Applications Part 26. Analyzing Android Applications Part 2
6. Analyzing Android Applications Part 2
Sam Bowne
 
Andriod Pentesting and Malware Analysis
Andriod Pentesting and Malware AnalysisAndriod Pentesting and Malware Analysis
Andriod Pentesting and Malware Analysis
n|u - The Open Security Community
 

What's hot (20)

Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Understanding Android Security
Understanding Android SecurityUnderstanding Android Security
Understanding Android Security
 
Permission in Android Security: Threats and solution
Permission in Android Security: Threats and solutionPermission in Android Security: Threats and solution
Permission in Android Security: Threats and solution
 
Sperasoft talks: Android Security Threats
Sperasoft talks: Android Security ThreatsSperasoft talks: Android Security Threats
Sperasoft talks: Android Security Threats
 
Android sandbox
Android sandboxAndroid sandbox
Android sandbox
 
2015.04.24 Updated > Android Security Development - Part 1: App Development
2015.04.24 Updated > Android Security Development - Part 1: App Development 2015.04.24 Updated > Android Security Development - Part 1: App Development
2015.04.24 Updated > Android Security Development - Part 1: App Development
 
Android Security Overview and Safe Practices for Web-Based Android Applications
Android Security Overview and Safe Practices for Web-Based Android ApplicationsAndroid Security Overview and Safe Practices for Web-Based Android Applications
Android Security Overview and Safe Practices for Web-Based Android Applications
 
Android Security
Android SecurityAndroid Security
Android Security
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Development
 
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...Consulthink @ GDG Meets U -  L'Aquila2014  - Codelab: Android Security -Il ke...
Consulthink @ GDG Meets U - L'Aquila2014 - Codelab: Android Security -Il ke...
 
Android Security - Common Security Pitfalls in Android Applications
Android Security - Common Security Pitfalls in Android ApplicationsAndroid Security - Common Security Pitfalls in Android Applications
Android Security - Common Security Pitfalls in Android Applications
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration Testing
 
Bypassing the Android Permission Model
Bypassing the Android Permission ModelBypassing the Android Permission Model
Bypassing the Android Permission Model
 
Android Device Hardening
Android Device HardeningAndroid Device Hardening
Android Device Hardening
 
Смирнов Александр, Security in Android Application
Смирнов Александр, Security in Android ApplicationСмирнов Александр, Security in Android Application
Смирнов Александр, Security in Android Application
 
[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop
 
Getting started with Android pentesting
Getting started with Android pentestingGetting started with Android pentesting
Getting started with Android pentesting
 
6. Analyzing Android Applications Part 2
6. Analyzing Android Applications Part 26. Analyzing Android Applications Part 2
6. Analyzing Android Applications Part 2
 
Andriod Pentesting and Malware Analysis
Andriod Pentesting and Malware AnalysisAndriod Pentesting and Malware Analysis
Andriod Pentesting and Malware Analysis
 
Android security
Android securityAndroid security
Android security
 

Viewers also liked

Android Secure Coding
Android Secure CodingAndroid Secure Coding
Android Secure Coding
JPCERT Coordination Center
 
Cryptography
CryptographyCryptography
Cryptography
Sidharth Mohapatra
 
OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...
OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...
OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...
Logicaltrust pl
 
Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015
Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015
Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015
Sina Manavi
 
Android verysimplebook... أندرويد ببساطة
Android verysimplebook... أندرويد ببساطةAndroid verysimplebook... أندرويد ببساطة
Android verysimplebook... أندرويد ببساطة
Ahmed Ismail
 
How iOS and Android Handle Security Webinar
How iOS and Android Handle Security WebinarHow iOS and Android Handle Security Webinar
How iOS and Android Handle Security Webinar
Denim Group
 
Testing Android Security
Testing Android SecurityTesting Android Security
Testing Android Security
Jose Manuel Ortega Candel
 
Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1
Ibnu Sina Wardy
 
Android permission system
Android permission systemAndroid permission system
Android permission system
Shivang Goel
 
Anatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shopAnatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shop
Abhinav Mishra
 
Android training day 4
Android training day 4Android training day 4
Android training day 4
Vivek Bhusal
 
Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009
sullis
 
Android permission system
Android permission systemAndroid permission system
Android permission system
Shivang Goel
 
Security threats in Android OS + App Permissions
Security threats in Android OS + App PermissionsSecurity threats in Android OS + App Permissions
Security threats in Android OS + App Permissions
Hariharan Ganesan
 
Sandbox Introduction
Sandbox IntroductionSandbox Introduction
Sandbox Introductionmsimkin
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
Bin Yang
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change
彥彬 洪
 
Json Tutorial
Json TutorialJson Tutorial
Json Tutorial
Napendra Singh
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
Perfect APK
 

Viewers also liked (20)

Android Secure Coding
Android Secure CodingAndroid Secure Coding
Android Secure Coding
 
Cryptography
CryptographyCryptography
Cryptography
 
OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...
OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...
OWASP Mobile TOP 10 na przykładzie aplikacji bankowych - Semafor 2016 - Mateu...
 
Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015
Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015
Android Application Security Awareness Talk, OWASP MEETUP Q3, 2015
 
Android verysimplebook... أندرويد ببساطة
Android verysimplebook... أندرويد ببساطةAndroid verysimplebook... أندرويد ببساطة
Android verysimplebook... أندرويد ببساطة
 
How iOS and Android Handle Security Webinar
How iOS and Android Handle Security WebinarHow iOS and Android Handle Security Webinar
How iOS and Android Handle Security Webinar
 
Testing Android Security
Testing Android SecurityTesting Android Security
Testing Android Security
 
Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1Tips dan Third Party Library untuk Android - Part 1
Tips dan Third Party Library untuk Android - Part 1
 
Android permission system
Android permission systemAndroid permission system
Android permission system
 
Anatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shopAnatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shop
 
Android training day 4
Android training day 4Android training day 4
Android training day 4
 
Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009Web Services and Android - OSSPAC 2009
Web Services and Android - OSSPAC 2009
 
Android permission system
Android permission systemAndroid permission system
Android permission system
 
Android(1)
Android(1)Android(1)
Android(1)
 
Security threats in Android OS + App Permissions
Security threats in Android OS + App PermissionsSecurity threats in Android OS + App Permissions
Security threats in Android OS + App Permissions
 
Sandbox Introduction
Sandbox IntroductionSandbox Introduction
Sandbox Introduction
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change
 
Json Tutorial
Json TutorialJson Tutorial
Json Tutorial
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
 

Similar to Introduction to Android Development and Security

Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions newJoe Jacob
 
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 fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersBoom Shukla
 
Introduction to Android (before 2015)
Introduction to Android (before 2015)Introduction to Android (before 2015)
Introduction to Android (before 2015)
Chien-Ming Chou
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
dineshkumar periyasamy
 
Android Development
Android DevelopmentAndroid Development
Android Development
mclougm4
 
Android application development fundamentals
Android application development fundamentalsAndroid application development fundamentals
Android application development fundamentals
indiangarg
 
Android Workshop_1
Android Workshop_1Android Workshop_1
Android Workshop_1
Purvik Rana
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
Can Elmas
 
Introduction to android basics
Introduction to android basicsIntroduction to android basics
Introduction to android basics
Hasam Panezai
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Aravindharamanan S
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for Beginners
RyanISI
 
Android pen test basics
Android pen test basicsAndroid pen test basics
Android pen test basics
OWASPKerala
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
Jawad Mohmand
 
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 Programming
Android ProgrammingAndroid Programming
Android Programming
Pasi Manninen
 
Thick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdfThick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdf
SouvikRoy114738
 

Similar to Introduction to Android Development and Security (20)

Introduction to android sessions new
Introduction to android   sessions newIntroduction to android   sessions new
Introduction to android sessions new
 
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
 
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
 
Android fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginnersAndroid fundamentals and tutorial for beginners
Android fundamentals and tutorial for beginners
 
My androidpresentation
My androidpresentationMy androidpresentation
My androidpresentation
 
Introduction to Android (before 2015)
Introduction to Android (before 2015)Introduction to Android (before 2015)
Introduction to Android (before 2015)
 
Unit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.pptUnit I- ANDROID OVERVIEW.ppt
Unit I- ANDROID OVERVIEW.ppt
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Android application development fundamentals
Android application development fundamentalsAndroid application development fundamentals
Android application development fundamentals
 
Android Workshop_1
Android Workshop_1Android Workshop_1
Android Workshop_1
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Introduction to android basics
Introduction to android basicsIntroduction to android basics
Introduction to android basics
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for Beginners
 
Android pen test basics
Android pen test basicsAndroid pen test basics
Android pen test basics
 
Android OS
Android OSAndroid OS
Android OS
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
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 Programming
Android ProgrammingAndroid Programming
Android Programming
 
Thick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdfThick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdf
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

Introduction to Android Development and Security

  • 1. An Introduction to Android Development and Security Kun Yang kelwya@gmail.com
  • 2. Android & Me • I’m a first-year graduate student. • I developed my first Android APP——BloGeo two years ago. • I’ve been an Android user for two years. • Now I’ve just started to learn Android security.
  • 3. Outline • Introduction to Android – Brief history – Architecture • Android Development – Environment – Programming framework – Building and running process – Case Study • Overview of Android Security Feature • Android Security Lab (by Security Compass) • My Future Study
  • 4. Brief History • Written by Andy Rubin(founder of Android Inc.) • Acquired by Google in 2005 • Android 1.0 released in 2007 • Android 4.0 released in 2011 • 52.5% of global mobile users
  • 5. Brief Introduction • First complete, open and free mobile platform • Operating System – Mobile device optimized Linux kernel 2.6 • Application framework – Mainly Java-based – Running on Dalvik virtual machine featuring JIT compilation • Key applications – Gmail, Maps, Contacts, Market and etc.
  • 7. Developing Environment • Totally free-of-charge – Open source – Eclipse with ADT plugin – SDK tools with an emulator – Android market • Dev guide – http://developer.android.com
  • 11.
  • 12. Application Framework Overview • Components – Activities – Views – Intents – Services – Content providers – Broadcast receivers • Resources • Manifest File
  • 13. Activities • An activity is a single, focused thing that the user can do • Typically correspond to one UI screen • Activities are stacked like a deck of cards • Active activity is placed on top
  • 14. Activity Lifecycle • 4 states – Active – Paused(visible, not active) – Stopped(invisible) – Destroyed • Call back functions – onCreate & onDestroy – onStart & onStop & onRestart – onResume & onPause
  • 16. Views • Views are GUI controls(E.g. TextView, EditText, Button) • Activity windows consist of views and viewgroups • Organized as trees to build up GUIs • Operations we can perform on views – Set properties: Use function or define in the XML layout files to load. – Set focus – Set up listener – Set visibility – Draw anything we like • We can use Layout to help place views – E.g. LinearLayout, TableLayout, AbsoluteLayout – Use function or define in the XML layout files
  • 17. Hello World using Layout XML Files
  • 19. Intents • Intents are used to exchange data between Activities or Applications • Think of Intents as a verb and object; a description of what you want done – E.g. VIEW, CALL, PLAY etc.. • Describes what the application wants • Provides late runtime binding
  • 20. Services • Services run in the background • Don’t interact with the user • Run on the main thread of the process
  • 21. Content Providers • Content providers store and retrieve data and make it accessible to all applications • It is the only way to share data across packages • The backend is SQLite • They are linked to clients • Data exposed as a unique URI
  • 22. Resources • Resources are images , strings and etc. • Externalize resources from application code • SDK will generate codes to map a resource to an id, we can use static class R to get resources • Layout xml files are also resources
  • 23. Manifest File • Control file that tells the system what to do and how the top-level components are related • It’s the “glue” that actually specifies which intents your activities receive • Specifies permissions
  • 24. Building and Running • Android package format – Bundle a few files into a file(.apk) – Just a zip file – Classes.dex is core file – compiled java classes – Use ‘DX’ tool to convert Java *.class to Dalvik bytecode *.dex
  • 26. Building and Running • DEX process flow
  • 27. Building and Running • Simplified Process Diagram
  • 28. Developing Process • Create your own android project • Design the UI • Externalize resources • React to events • Run the application
  • 30. Android Security Overview • Goals – Protect user data – Protect system resources (including the network) – Provide application isolation • Android security features provided – Robust security at the OS level through the Linux kernel – Mandatory application sandbox for all applications – Secure interprocess communication – Application signing – Application-defined and user-granted permissions
  • 31. Android Security Overview(cont.) • Application Sandbox: Kernel Level – Each Application has a user ID(UID) to run • Interprocess Communication – Binder • A lightweight capability-based remote procedure call mechanism designed for high performance when performing in-process and cross-process calls. – Intents – ContentProviders • Application signing
  • 32. Android Security Overview(cont.) • Application-defined and user-granted permissions – Camera functions – Location data (GPS) – Bluetooth functions – Telephony functions – SMS/MMS functions – Network
  • 33. ExploitMe Mobile Android Labs • By Security Compass – information security consulting firm – specializing in secure software development and training • An open source project demonstrating Android mobile hacking • A bank transfer mobile client • Server written in python(http/https) • 8 Labs
  • 34. Lab 1: Secure connections • python app.py • emulator.exe -avd emu -tcpdump test.cap • Solution: python app.py --ssl --port 8443
  • 35. Lab 2 - Parameter Manipulation • emulator @YOUR_AVD_NAME --http-proxy localhost:8008 • http post Solution:
  • 36. Lab 3 - Insecure file storage File creation mode: the default mode, where the created file can only be Solution: accessed by the calling application (or all applications sharing the same user ID).
  • 37. Lab 4 - Secure Logging Solution: • adb logcat Be aware of what you are logging and only log non-sensitive information.
  • 38. Lab 5 - Basic Encryption
  • 39. Lab 5 - Basic Encryption(cont.)
  • 40. Lab 6 - Advanced Encryption • apktool – It is a tool for reengineering 3rd party, closed, binary Android apps. – It can decode resources to nearly original form and rebuild them after making some modifications.
  • 41. Lab 6 - Advanced Encryption(cont.) • apktool d BasicEncryptionSolution.apk export
  • 42. Lab 6 - Advanced Encryption(cont.)
  • 43. Lab 6 - Advanced Encryption(cont.) • Smali – Smali is an assembler for the dex format used by dalvik
  • 44. Lab 6 - Advanced Encryption(cont.)
  • 45. Lab 7 - Memory Protection
  • 46. Lab 7 - Memory Protection • hprof-conv source dest – Convert dex memory dump format to Java format • Use MAT(memory analyzer tool) to browse it
  • 47. Lab 7 - Memory Protection(cont.)
  • 48. Lab 7 - Memory Protection(cont.)
  • 49. Lab 8 - Client-side Password complexity
  • 50. Future Study Android Reverse Engineering! I hope I can show you some more hacking examples next time.