SlideShare a Scribd company logo
Android System Architecture
And
Pen-testing of Android applications

Yavuz Han
What is Android ?
• A software platform and operating system for
mobile devices
• Based on the Linux kernel(Kernel 2.6)
• Developed by Google and later Open Handset
Aliance(OHA)
• Also writing managed code in the Java
Language
• C/C++ also but not supported
Android Architecture
Applications
• First layer in system architecture
• These include the applications shipped with
android like the email client, SMS client, maps,
browsers and also the applications developed
and distributed through the Android market.
Application Framework
• Second layer in system architecture
• These include the programs that manage the
basic functions of the phone like resource
allocation, voice call management, etc
Libraries
• The layer above to the Linux kernel is the
Android’s native libraries.
• These libraries are written in C/C++ languages.
• These libraries also run as processes within the
underlying Linux kernel.
• The libraries are nothing but a set of instructions
that tell the device how to handle different kinds
of data (e.g. The media libraries support playing
or recording various audio/video formats)
Some of the key libraries are listed
below:
• SQLite:This is a lightweight yet powerful
relational database engine available for all
applications to store data.
• Webkit:This is a browser engine providing
tools for browsing web pages.
• Surface Manager: This is responsible for the
graphics on the device screens
• OpenGL: Used to render 2D or 3D graphics to
the screen
Android Runtime
• This is located on the same layer as the libraries
layer.
• It consists of the core JAVA libraries and the
Dalvik virtual machine.
• The core Java libraries are used for developing
Android based applications.
• Dalvik VMs help in achieving the following:
- better memory management
-an application cannot interfere with other
applications without permissions
- threading support
• The diagram below is a pictorial
representation of the Android environment.
• It can be observed that each Android
application runs under a separate virtual
instance and each application has a unique
user-id assigned to it.
Linux Kernel
• This is last layer in system architecture
• Device drivers, power management, process
management and networking services depend
on the layer
• Android using Linux kernel 2.6 and android
developed over time have been harmonized.
• Android is not exactly Linux.
Penetration testing of Android apps
• The applications in Android can be mainly
classified into two categories:
-Android browser-based applications
-Android-based applications (Android
application package files – .apk extension files)
Android Filesystem Access
We want to analyze files within the device,so
how do we do this ?

ADB
(windows,linux,mac)
Android FileSystem Access
• Android Debug Bridge (adb) command
-Access a shell
-Pull/push files
-Many more
Example of ADB
Quick look at some apps
• We’re going to use Android’s default mail client
(Note – this is for a rooted device)
•Navigate to the shared_prefs directory of the
application
Quick look at some apps
• •cat (read) the file
Data Storage

SQLite
-Single file relational database
-Supportet by Android & iPhone APIs to store
Application settings/data
• Using the ADB shell, we can browse to the
database folder and access the data as shown
below:
Logging
• Applications may leak data through gratuitous
logging
• In older versions of Android, the browser
would log URLs visited
-This also logged session Ids for websites
that put it in the GET request
Viewing Android Logs
• We can use ‘adb logcat’ command
Android Client Analysis
• Android Application Layout
-Apps are packaged in an APK file (zip archive)
-What is in it ?
-Dalvik class files(.dex)
-Assets and Resources
-Android Manifest.xml
-APKs stored at /data/app on a device
Can extract this
Android Application Layout
Android Application Layout
Android Manifest.xml
• Enumerates permissions
• We are most interested in permissions and
metadata
Analyzing an APK
• The files inside an APK are not directly useful
-Need to unpack the XML,disassemble the
dex class files

We are using some tool for reverse engineering
Android apk files
Decompilation
• This way eassier than other ways
• You may be familiar with jad or jdgui
-Use dex2jar to get a (JVM) jar from an apk
*Perform “source review” on decompiled app
Does not work for all apks
Decompilation
Protection
•
•
•
•

We must treat the mobile device as hostile
Don’t store sensitive data unencrypted!
Doing encryption well is HARD
Best practice: don’t store any sensitive data on
device
QUESTİONS
THANK YOU

More Related Content

PDF
Android Workshop_1
PPTX
Tech presentation (part 1)
PPTX
Android the new Mobile Technoogy
PPT
Android project architecture
PDF
OpenProdoc Overview
DOCX
Android architecture
PPTX
How to design a distributed system
PPTX
Assembly
Android Workshop_1
Tech presentation (part 1)
Android the new Mobile Technoogy
Android project architecture
OpenProdoc Overview
Android architecture
How to design a distributed system
Assembly

What's hot (7)

PPTX
Dot net assembly
PPTX
Asp folders and web configurations
PDF
Android Architecture
PPT
Apex ace update
PDF
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
PPTX
Android Handheld Systems
Dot net assembly
Asp folders and web configurations
Android Architecture
Apex ace update
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
Android Handheld Systems
Ad

Viewers also liked (20)

PPTX
Penetrating Android Aapplications
PPTX
Pentesting Android Applications
PDF
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
PDF
SSL Pinning and Bypasses: Android and iOS
PPTX
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
PDF
CocoaConf Austin 2014 | Demystifying Security Best Practices
PDF
Pentesting iOS Apps
PDF
Andriod Pentesting and Malware Analysis
PDF
HIJACKING ATTACKS ON ANDROID DEVICES
PDF
Certificate Pinning in Mobile Applications
PPTX
How to Test Security and Vulnerability of Your Android and iOS Apps
PDF
Security testing in mobile applications
PDF
[2014/10/06] HITCON Freetalk - App Security on Android
PPTX
Rapid Android Application Security Testing
PPTX
Android pen test basics
PPT
Mobile app testing services
PDF
Mobile application security – effective methodology, efficient testing! hem...
PDF
Security Testing Mobile Applications
PPTX
[Wroclaw #1] Android Security Workshop
PDF
Mobile Application Security Testing, Testing for Mobility App | www.idexcel.com
Penetrating Android Aapplications
Pentesting Android Applications
Nullcon Goa 2016 - Automated Mobile Application Security Testing with Mobile ...
SSL Pinning and Bypasses: Android and iOS
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
CocoaConf Austin 2014 | Demystifying Security Best Practices
Pentesting iOS Apps
Andriod Pentesting and Malware Analysis
HIJACKING ATTACKS ON ANDROID DEVICES
Certificate Pinning in Mobile Applications
How to Test Security and Vulnerability of Your Android and iOS Apps
Security testing in mobile applications
[2014/10/06] HITCON Freetalk - App Security on Android
Rapid Android Application Security Testing
Android pen test basics
Mobile app testing services
Mobile application security – effective methodology, efficient testing! hem...
Security Testing Mobile Applications
[Wroclaw #1] Android Security Workshop
Mobile Application Security Testing, Testing for Mobility App | www.idexcel.com
Ad

Similar to Android System Architecture And  Pen-testing of Android applications (20)

PPT
My androidpresentation
PDF
Wifi Direct Based Chat And File Transfer Android Application
PPTX
Android village @nullcon 2012
PPTX
Android architecture
PPT
UPDATED Application fundamentals lec 1 &2.ppt
PPTX
Hacker Halted 2014 - Reverse Engineering the Android OS
PDF
Android and its feature
PDF
Ch1 hello, android
PPTX
Introduction to android
PDF
Introduction to android
PPTX
Androidoverview 100405150711-phpapp01
PPTX
Cross compiling android applications
DOCX
Android architecture
PDF
01 02 - introduction - adroid stack
PPTX
Android 1-intro n architecture
PDF
Android
PPTX
Getting started with android
PPTX
Presentation for Android OS
PDF
Android report.
My androidpresentation
Wifi Direct Based Chat And File Transfer Android Application
Android village @nullcon 2012
Android architecture
UPDATED Application fundamentals lec 1 &2.ppt
Hacker Halted 2014 - Reverse Engineering the Android OS
Android and its feature
Ch1 hello, android
Introduction to android
Introduction to android
Androidoverview 100405150711-phpapp01
Cross compiling android applications
Android architecture
01 02 - introduction - adroid stack
Android 1-intro n architecture
Android
Getting started with android
Presentation for Android OS
Android report.

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Cell Types and Its function , kingdom of life
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Lesson notes of climatology university.
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
master seminar digital applications in india
Supply Chain Operations Speaking Notes -ICLT Program
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Sports Quiz easy sports quiz sports quiz
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Cell Types and Its function , kingdom of life
TR - Agricultural Crops Production NC III.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Final Presentation General Medicine 03-08-2024.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Renaissance Architecture: A Journey from Faith to Humanism
Lesson notes of climatology university.
O7-L3 Supply Chain Operations - ICLT Program
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Microbial disease of the cardiovascular and lymphatic systems
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPH.pptx obstetrics and gynecology in nursing
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Microbial diseases, their pathogenesis and prophylaxis
master seminar digital applications in india

Android System Architecture And  Pen-testing of Android applications

  • 1. Android System Architecture And Pen-testing of Android applications Yavuz Han
  • 2. What is Android ? • A software platform and operating system for mobile devices • Based on the Linux kernel(Kernel 2.6) • Developed by Google and later Open Handset Aliance(OHA) • Also writing managed code in the Java Language • C/C++ also but not supported
  • 4. Applications • First layer in system architecture • These include the applications shipped with android like the email client, SMS client, maps, browsers and also the applications developed and distributed through the Android market.
  • 5. Application Framework • Second layer in system architecture • These include the programs that manage the basic functions of the phone like resource allocation, voice call management, etc
  • 6. Libraries • The layer above to the Linux kernel is the Android’s native libraries. • These libraries are written in C/C++ languages. • These libraries also run as processes within the underlying Linux kernel. • The libraries are nothing but a set of instructions that tell the device how to handle different kinds of data (e.g. The media libraries support playing or recording various audio/video formats)
  • 7. Some of the key libraries are listed below: • SQLite:This is a lightweight yet powerful relational database engine available for all applications to store data. • Webkit:This is a browser engine providing tools for browsing web pages. • Surface Manager: This is responsible for the graphics on the device screens • OpenGL: Used to render 2D or 3D graphics to the screen
  • 8. Android Runtime • This is located on the same layer as the libraries layer. • It consists of the core JAVA libraries and the Dalvik virtual machine. • The core Java libraries are used for developing Android based applications. • Dalvik VMs help in achieving the following: - better memory management -an application cannot interfere with other applications without permissions - threading support
  • 9. • The diagram below is a pictorial representation of the Android environment. • It can be observed that each Android application runs under a separate virtual instance and each application has a unique user-id assigned to it.
  • 10. Linux Kernel • This is last layer in system architecture • Device drivers, power management, process management and networking services depend on the layer • Android using Linux kernel 2.6 and android developed over time have been harmonized. • Android is not exactly Linux.
  • 11. Penetration testing of Android apps • The applications in Android can be mainly classified into two categories: -Android browser-based applications -Android-based applications (Android application package files – .apk extension files)
  • 12. Android Filesystem Access We want to analyze files within the device,so how do we do this ? ADB (windows,linux,mac)
  • 13. Android FileSystem Access • Android Debug Bridge (adb) command -Access a shell -Pull/push files -Many more
  • 15. Quick look at some apps • We’re going to use Android’s default mail client (Note – this is for a rooted device) •Navigate to the shared_prefs directory of the application
  • 16. Quick look at some apps • •cat (read) the file
  • 17. Data Storage SQLite -Single file relational database -Supportet by Android & iPhone APIs to store Application settings/data
  • 18. • Using the ADB shell, we can browse to the database folder and access the data as shown below:
  • 19. Logging • Applications may leak data through gratuitous logging • In older versions of Android, the browser would log URLs visited -This also logged session Ids for websites that put it in the GET request
  • 20. Viewing Android Logs • We can use ‘adb logcat’ command
  • 21. Android Client Analysis • Android Application Layout -Apps are packaged in an APK file (zip archive) -What is in it ? -Dalvik class files(.dex) -Assets and Resources -Android Manifest.xml -APKs stored at /data/app on a device Can extract this
  • 24. Android Manifest.xml • Enumerates permissions • We are most interested in permissions and metadata
  • 25. Analyzing an APK • The files inside an APK are not directly useful -Need to unpack the XML,disassemble the dex class files We are using some tool for reverse engineering Android apk files
  • 26. Decompilation • This way eassier than other ways • You may be familiar with jad or jdgui -Use dex2jar to get a (JVM) jar from an apk *Perform “source review” on decompiled app Does not work for all apks
  • 28. Protection • • • • We must treat the mobile device as hostile Don’t store sensitive data unencrypted! Doing encryption well is HARD Best practice: don’t store any sensitive data on device