SlideShare a Scribd company logo
1 of 30
Download to read offline
ANDROID SECURITY
‫مدرس‬ ‫تربیت‬ ‫دانشگاه‬ ‫داده‬ ‫پایگاه‬ ‫امنیت‬ ‫درس‬ ‫کالسی‬ ‫ارائه‬
‫دهندگان‬ ‫ارائه‬:
‫آمون‬ ‫مهرناز‬
‫محمدی‬ ‫کاوه‬
‫درس‬ ‫استاد‬:
‫نوگورانی‬ ‫دری‬ ‫صادق‬
‫اول‬ ‫نیمسال‬۹۷-۹۸
1
SEANDROID (1/2)
• The incorporation of Security-Enhanced Linux in Android (SEAndroid) is an important security
enhancement to the platform.
• Android is built on top of the Linux kernel, with a collection of traditional and customized Linux
libraries and daemons.
• Early versions of Android relied on Unix’s discretionary access control (DAC) mechanism to protect
daemon-specific resources as well as to isolate apps from one another.
• Security-Enhanced Linux (SELinux), which adds mandatory access control (MAC), has been
integrated into Android to harden the security of the lower layer of Android, resulting in
SEAndroid
• Android Open Source Project (AOSP)
2
SEANDROID (2/2)
• SEAndroid enforcement was first adopted in Android version 4.4, but with a
minimally restrictive policy
• Samsung
• HTC
3
BASIC CONCEPTS OF ANDROID ACCESS CONTROL POLICY (AACP)
• Android Access Control Policy:
• app permissions,
• middleware MAC,
• Linux DAC,
• and kernel-level MAC (implemented in the SELinux LSM module).
4
SEANDROID
• SEAndroid supports three access control models:
• Type Enforcement (TE),
• Role-Based Access Control (RBAC) [22],
• and Multi-Level Security (MLS)
5
SECURITY LABEL (1/2)
• In SEAndroid, every subject or object has a security label in the format of
user:role:type:security level.
• The first element represents the user in SEAndroid, the second element role is for
RBAC, the third element type is for TE, and the last element security level is for MLS.
An example of security label is u0:object r:app data file:s0.
• allow Domain Type : Class { Permissions } An example rule is allow untrusted app
system app data file : file { read write } , which allows the domain untrusted app to
read and write files of type system app data file. N
6
SECURITY LABEL (2/2)
• SEAndroid includes important context files for labelling subjects and objects in
the system. One such file is file contexts for labelling the file system, and
another is seapp contexts for labelling processes and their related data.
• Each permission group has three characters that represent the read (r, or 4 as
an integer), write (w, or 2), and execute (x, or 1) permissions, respectively.
Therefore, if a file’s permission is set to “r--------” or 400, it means that only
the owner of the file can read it.
7
SEANDROID POLICY
• An SEAndroid policy is P𝑀𝐴𝐶 = (𝐿𝑠, 𝐿𝑜, 𝑀𝐿, 𝑆, 𝑂, 𝐴, 𝑀𝐴, 𝑅)
• 𝐿𝑠 and 𝐿𝑜 are the sets of security labels of subjects and objects,
• 𝑀𝐿 : 𝐿𝑠 ∪ 𝐿𝑜 ↦→ 𝑆 ∪ 𝑂 is a mapping for assigning security labels to subjects and
objects
• 𝐴 = {𝑎} is the set of attributes, s.t., 𝐴 ⊂ 𝐿𝑠 ∪ 𝐿𝑜
• 𝑀𝐴 : 𝐿𝑠 ∪ 𝐿𝑜 ↦→ 2 𝐴 is a mapping from security labels to their attribute set
• 𝑅 = {𝑟} is a set of SEAndroid policy rules (defined below).
8
SEANDROID POLICY RULE
• An SEAndroid policy rule is a tuple 𝑟 = (𝑙𝑠, 𝑙𝑜, 𝑐𝑟, 𝑃𝑟)
• where 𝑙𝑠 ∈ 𝐿𝑠 is the subject security label (i.e., domain)
• 𝑙𝑜 ∈ 𝐿𝑜 is the object security label (i.e., type)
• 𝑐𝑟 is the object class
• and 𝑃𝑟 is the permission set granted by 𝑟 when subjects with label 𝑙𝑠 access objects with
label 𝑙𝑜.
9
DAC RELATED DATA
• To dump file entries for DAC permissions, we use the command:
“adb shell ls -aRZ ”
from the root directory of a phone. Note that the phone must be rooted to list the whole file system,
otherwise only part of the file entries in the phone can be obtained and thus the analysis results may
be incomplete.
• A file pubkey blacklist.txt under the directory /data/misc/keychain/ has read and write
permissions for its owner, read for its group members, and read for all others, respectively. Its user
and group are both system, and its security label is keychain data file. 10
MAC RELATED DATA (1/2)
• Pull the SEAndroid policy binary from an Android device through the command
“adb pull sepolicy”
Then we employ SETools to recover rules from the extracted binary with the command “sesearch -A
sepolicy” 2
11
POLICIES TO BE ANALYZED
These statistics show that through the evolution of SEAndroid policies, Android 4.4 is quite different from
the later versions, and that the versions after Android 5.0 become more stable, although Android 6.0
adds revisions due to new features like fingerprint.
12
EXAMPLES OF COMPOSITIONAL PRIVILEGE
ESCALATION IN DIFFERENT AOSP POLICIES
13
EXAMPLES OF TYPES WITH DIFFERENT GLOBAL
PERMISSIONS IN DAC IN DIFFERENT AOSP POLICIES
14
STATISTICS OF SEANDROID POLICIES (ANDROID
5.0) FROM DIFFERENT OEMS
15
COMMANDS FOR COLLECTING DATA
16
CONTROL YOUR APP PERMISSIONS ON ANDROID
6.0 AND UP
• When you install an app from Google Play on a device running Android 6.0 and up or on a
Chromebook, you control which capabilities or information that app can access—known as
permissions. For example, an app might want permission to see your device contacts or
location. You can control which permissions an app can access after the app installs on your
device.
• Turn permissions on or off
You can change the permissions that apps can access in the main Settings app on your device at
any time. Keep in mind turning off permissions may cause apps on your device to lose
functionality.
17
APP PERMISSIONS FOR ANDROID 6.0 AND UP
• Below are the app permissions available on Android 6.0 and up. The permissions you see on your device may vary by
manufacturer.
• To review the permissions on your device, follow the instructions under "Turn permissions on or off" above.
• Body Sensors
• Calendar
• Camera
• Contacts
• Location
• Microphone
• Phone
• SMS
• Storage
18
PERMISSIONS OVERVIEW
• The purpose of a permission is to protect the privacy of an Android user.
Android apps must request permission to access sensitive user data (such as
contacts and SMS), as well as certain system features (such as camera and
internet). Depending on the feature, the system might grant the permission
automatically or might prompt the user to approve the request.
19
PERMISSIONS OVERVIEW
• A central design point of the Android security architecture is that no app, by
default, has permission to perform any operations that would adversely
impact other apps, the operating system, or the user. This includes reading or
writing the user's private data (such as contacts or emails), reading or writing
another app's files, performing network access, keeping the device awake,
and so on.
20
SEE ALL PERMISSIONS FOR EACH APP
• For apps installed on your device
On your device, open the main Settings app .
Tap Apps or Application Manager (depending on your device, this may look different).
Tap the app you want to update.
Tap Permissions.
Turn permissions on or off.
• For instant apps
On your device, open the Settings app .
Go to Google Instant Apps.
Tap the app you want to see more about.
Look under “Permissions”.
21
PERMISSION APPROVAL
• An app must publicize the permissions it requires by including <uses-
permission> tags in the app manifest. For example, an app that needs to send
SMS messages would have this line in the manifest:
22
RUNTIME REQUESTS (ANDROID 6.0 AND HIGHER)
• If the device is running Android 6.0 (API level 23) or higher, and the app's targetSdkVersion is
23 or higher, the user isn't notified of any app permissions at install time. Your app must ask
the user to grant the dangerous permissions at runtime. When your app requests permission,
the user sees a system dialog (as shown in figure 1, left) telling the user which permission
group your app is trying to access. The dialog includes a Deny and Allow button.
• If the user denies the permission request, the next time your app requests the permission, the
dialog contains a checkbox that, when checked, indicates the user doesn't want to be
prompted for the permission again (see figure 1, right).
23
RUNTIME REQUESTS (ANDROID 6.0 AND HIGHER)
24
INSTALL-TIME REQUESTS (ANDROID 5.1.1 AND BELOW)
• If the device is running Android 5.1.1 (API level 22) or lower, or the app's
targetSdkVersion is 22 or lower while running on any version of Android, the
system automatically asks the user to grant all dangerous permissions for your
app at install-time (see figure 2).
25
INSTALL-TIME REQUESTS (ANDROID 5.1.1 AND BELOW)
26
NORMAL PERMISSIONS
• Normal permissions cover areas where your app needs to access data or resources outside the
app's sandbox, but where there's very little risk to the user's privacy or the operation of other
apps. For example, permission to set the time zone is a normal permission.
• As of Android 9 (API level 28), the following permissions are classified as PROTECTION_NORMAL:
ACCESS_LOCATION_EXTRA_COMMANDS
ACCESS_NETWORK_STATE
ACCESS_NOTIFICATION_POLICY
ACCESS_WIFI_STATE
BLUETOOTH
BLUETOOTH_ADMIN
27
DANGEROUS PERMISSIONS AND PERMISSION GROUPS.
28
SIGNATURE PERMISSIONS
• The system grants these app permissions at install time, but only when the app that attempts to use a permission
is signed by the same certificate as the app that defines the permission.
• As of Android 8.1 (API level 27), the following permissions that third-party apps can use are classified as
PROTECTION_SIGNATURE:
BIND_ACCESSIBILITY_SERVICE
BIND_AUTOFILL_SERVICE
BIND_CARRIER_SERVICES
BIND_DEVICE_ADMIN
BIND_INCALL_SERVICE
BIND_INPUT_METHOD
BIND_MIDI_DEVICE_SERVICE
BIND_NFC_SERVICE
BIND_NOTIFICATION_LISTENER_SERVICE
BIND_PRINT_SERVICE
29
‫منابع‬
• Chen, Haining, Ninghui Li, William Enck, Yousra Aafer, and Xiangyu Zhang.
"Analysis of SEAndroid Policies: Combining MAC and DAC in Android."
In Proceedings of the 33rd Annual Computer Security Applications Conference,
pp. 553-565. ACM, 2017.
• developer.android.com
• support.google.com
30

More Related Content

What's hot

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
Android SecurityAndroid Security
Android SecurityArqum Ahmad
 
Android security in depth
Android security in depthAndroid security in depth
Android security in depthSander Alberink
 
Understanding android security model
Understanding android security modelUnderstanding android security model
Understanding android security modelPragati Rai
 
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
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android SecurityMarakana Inc.
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Developmenthackstuff
 
Understanding Android Security
Understanding Android SecurityUnderstanding Android Security
Understanding Android SecurityAsanka 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 solutionTandhy Simanjuntak
 
[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security WorkshopOWASP
 
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 Applicationsh4oxer
 
Смирнов Александр, Security in Android Application
Смирнов Александр, Security in Android ApplicationСмирнов Александр, Security in Android Application
Смирнов Александр, Security in Android ApplicationSECON
 
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 ApplicationsBlrDroid
 
Android Security & Penetration Testing
Android Security & Penetration TestingAndroid Security & Penetration Testing
Android Security & Penetration TestingSubho Halder
 
Android security - an enterprise perspective
Android security -  an enterprise perspectiveAndroid security -  an enterprise perspective
Android security - an enterprise perspectivePietro F. Maggi
 
Android Device Hardening
Android Device HardeningAndroid Device Hardening
Android Device Hardeninganupriti
 
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
 
Bypassing the Android Permission Model
Bypassing the Android Permission ModelBypassing the Android Permission Model
Bypassing the Android Permission ModelGeorgia Weidman
 

What's hot (20)

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
Android SecurityAndroid Security
Android Security
 
Android security in depth
Android security in depthAndroid security in depth
Android security in depth
 
Understanding android security model
Understanding android security modelUnderstanding android security model
Understanding android security model
 
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...
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Android Security Development
Android Security DevelopmentAndroid Security Development
Android Security Development
 
Android sandbox
Android sandboxAndroid sandbox
Android sandbox
 
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
 
[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop[Wroclaw #1] Android Security Workshop
[Wroclaw #1] Android Security Workshop
 
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 system security
Android system securityAndroid system security
Android system security
 
Смирнов Александр, Security in Android Application
Смирнов Александр, Security in Android ApplicationСмирнов Александр, Security in Android Application
Смирнов Александр, Security in Android Application
 
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
 
Android security - an enterprise perspective
Android security -  an enterprise perspectiveAndroid security -  an enterprise perspective
Android security - an enterprise perspective
 
Android Device Hardening
Android Device HardeningAndroid Device Hardening
Android Device Hardening
 
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
 
Bypassing the Android Permission Model
Bypassing the Android Permission ModelBypassing the Android Permission Model
Bypassing the Android Permission Model
 

Similar to Android Security

Mediating Applications on the Android System
Mediating Applications on the Android SystemMediating Applications on the Android System
Mediating Applications on the Android SystemNizar Maan
 
Android Overview
Android OverviewAndroid Overview
Android OverviewRaju Kadam
 
Android security
Android securityAndroid security
Android securityKrazy Koder
 
Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Santosh Sh
 
Getting started with Android pentesting
Getting started with Android pentestingGetting started with Android pentesting
Getting started with Android pentestingMinali Arora
 
Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Mohammed Adam
 
Getting started with android
Getting started with androidGetting started with android
Getting started with androidVandana Verma
 
Security on android
Security on androidSecurity on android
Security on androidpk464312
 
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)Ron Munitz
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat DasNull Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Dasnullowaspmumbai
 
Mobile application security
Mobile application securityMobile application security
Mobile application securityShubhneet Goel
 
Mobile Application Security
Mobile Application SecurityMobile Application Security
Mobile Application SecurityIshan Girdhar
 
Security testing of mobile applications
Security testing of mobile applicationsSecurity testing of mobile applications
Security testing of mobile applicationsGTestClub
 
The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)Ron Munitz
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Codemotion
 
CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidSam Bowne
 

Similar to Android Security (20)

Mediating Applications on the Android System
Mediating Applications on the Android SystemMediating Applications on the Android System
Mediating Applications on the Android System
 
Android Overview
Android OverviewAndroid Overview
Android Overview
 
Mobile security
Mobile securityMobile security
Mobile security
 
Android security
Android securityAndroid security
Android security
 
Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01Androidoverview 100405150711-phpapp01
Androidoverview 100405150711-phpapp01
 
Getting started with Android pentesting
Getting started with Android pentestingGetting started with Android pentesting
Getting started with Android pentesting
 
Android Penetration Testing - Day 1
Android Penetration Testing - Day 1Android Penetration Testing - Day 1
Android Penetration Testing - Day 1
 
Getting started with android
Getting started with androidGetting started with android
Getting started with android
 
Security on android
Security on androidSecurity on android
Security on android
 
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)The Ultimate Android Security Checklist (AnDevCon Boston 2014)
The Ultimate Android Security Checklist (AnDevCon Boston 2014)
 
Untitled 1
Untitled 1Untitled 1
Untitled 1
 
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat DasNull Mumbai Meet_Android Reverse Engineering by Samrat Das
Null Mumbai Meet_Android Reverse Engineering by Samrat Das
 
Securing Android
Securing AndroidSecuring Android
Securing Android
 
Mobile application security
Mobile application securityMobile application security
Mobile application security
 
Mobile Application Security
Mobile Application SecurityMobile Application Security
Mobile Application Security
 
Security testing of mobile applications
Security testing of mobile applicationsSecurity testing of mobile applications
Security testing of mobile applications
 
The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)The Ultimate Android Security Checklist (Mdevcon 2014)
The Ultimate Android Security Checklist (Mdevcon 2014)
 
128-ch4.pptx
128-ch4.pptx128-ch4.pptx
128-ch4.pptx
 
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
Ron Munitz - The Ultimate Android Security Checklist - Codemotion Rome 2015
 
CNIT 128 Ch 4: Android
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
 

Recently uploaded

Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 

Recently uploaded (7)

Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 

Android Security

  • 1. ANDROID SECURITY ‫مدرس‬ ‫تربیت‬ ‫دانشگاه‬ ‫داده‬ ‫پایگاه‬ ‫امنیت‬ ‫درس‬ ‫کالسی‬ ‫ارائه‬ ‫دهندگان‬ ‫ارائه‬: ‫آمون‬ ‫مهرناز‬ ‫محمدی‬ ‫کاوه‬ ‫درس‬ ‫استاد‬: ‫نوگورانی‬ ‫دری‬ ‫صادق‬ ‫اول‬ ‫نیمسال‬۹۷-۹۸ 1
  • 2. SEANDROID (1/2) • The incorporation of Security-Enhanced Linux in Android (SEAndroid) is an important security enhancement to the platform. • Android is built on top of the Linux kernel, with a collection of traditional and customized Linux libraries and daemons. • Early versions of Android relied on Unix’s discretionary access control (DAC) mechanism to protect daemon-specific resources as well as to isolate apps from one another. • Security-Enhanced Linux (SELinux), which adds mandatory access control (MAC), has been integrated into Android to harden the security of the lower layer of Android, resulting in SEAndroid • Android Open Source Project (AOSP) 2
  • 3. SEANDROID (2/2) • SEAndroid enforcement was first adopted in Android version 4.4, but with a minimally restrictive policy • Samsung • HTC 3
  • 4. BASIC CONCEPTS OF ANDROID ACCESS CONTROL POLICY (AACP) • Android Access Control Policy: • app permissions, • middleware MAC, • Linux DAC, • and kernel-level MAC (implemented in the SELinux LSM module). 4
  • 5. SEANDROID • SEAndroid supports three access control models: • Type Enforcement (TE), • Role-Based Access Control (RBAC) [22], • and Multi-Level Security (MLS) 5
  • 6. SECURITY LABEL (1/2) • In SEAndroid, every subject or object has a security label in the format of user:role:type:security level. • The first element represents the user in SEAndroid, the second element role is for RBAC, the third element type is for TE, and the last element security level is for MLS. An example of security label is u0:object r:app data file:s0. • allow Domain Type : Class { Permissions } An example rule is allow untrusted app system app data file : file { read write } , which allows the domain untrusted app to read and write files of type system app data file. N 6
  • 7. SECURITY LABEL (2/2) • SEAndroid includes important context files for labelling subjects and objects in the system. One such file is file contexts for labelling the file system, and another is seapp contexts for labelling processes and their related data. • Each permission group has three characters that represent the read (r, or 4 as an integer), write (w, or 2), and execute (x, or 1) permissions, respectively. Therefore, if a file’s permission is set to “r--------” or 400, it means that only the owner of the file can read it. 7
  • 8. SEANDROID POLICY • An SEAndroid policy is P𝑀𝐴𝐶 = (𝐿𝑠, 𝐿𝑜, 𝑀𝐿, 𝑆, 𝑂, 𝐴, 𝑀𝐴, 𝑅) • 𝐿𝑠 and 𝐿𝑜 are the sets of security labels of subjects and objects, • 𝑀𝐿 : 𝐿𝑠 ∪ 𝐿𝑜 ↦→ 𝑆 ∪ 𝑂 is a mapping for assigning security labels to subjects and objects • 𝐴 = {𝑎} is the set of attributes, s.t., 𝐴 ⊂ 𝐿𝑠 ∪ 𝐿𝑜 • 𝑀𝐴 : 𝐿𝑠 ∪ 𝐿𝑜 ↦→ 2 𝐴 is a mapping from security labels to their attribute set • 𝑅 = {𝑟} is a set of SEAndroid policy rules (defined below). 8
  • 9. SEANDROID POLICY RULE • An SEAndroid policy rule is a tuple 𝑟 = (𝑙𝑠, 𝑙𝑜, 𝑐𝑟, 𝑃𝑟) • where 𝑙𝑠 ∈ 𝐿𝑠 is the subject security label (i.e., domain) • 𝑙𝑜 ∈ 𝐿𝑜 is the object security label (i.e., type) • 𝑐𝑟 is the object class • and 𝑃𝑟 is the permission set granted by 𝑟 when subjects with label 𝑙𝑠 access objects with label 𝑙𝑜. 9
  • 10. DAC RELATED DATA • To dump file entries for DAC permissions, we use the command: “adb shell ls -aRZ ” from the root directory of a phone. Note that the phone must be rooted to list the whole file system, otherwise only part of the file entries in the phone can be obtained and thus the analysis results may be incomplete. • A file pubkey blacklist.txt under the directory /data/misc/keychain/ has read and write permissions for its owner, read for its group members, and read for all others, respectively. Its user and group are both system, and its security label is keychain data file. 10
  • 11. MAC RELATED DATA (1/2) • Pull the SEAndroid policy binary from an Android device through the command “adb pull sepolicy” Then we employ SETools to recover rules from the extracted binary with the command “sesearch -A sepolicy” 2 11
  • 12. POLICIES TO BE ANALYZED These statistics show that through the evolution of SEAndroid policies, Android 4.4 is quite different from the later versions, and that the versions after Android 5.0 become more stable, although Android 6.0 adds revisions due to new features like fingerprint. 12
  • 13. EXAMPLES OF COMPOSITIONAL PRIVILEGE ESCALATION IN DIFFERENT AOSP POLICIES 13
  • 14. EXAMPLES OF TYPES WITH DIFFERENT GLOBAL PERMISSIONS IN DAC IN DIFFERENT AOSP POLICIES 14
  • 15. STATISTICS OF SEANDROID POLICIES (ANDROID 5.0) FROM DIFFERENT OEMS 15
  • 17. CONTROL YOUR APP PERMISSIONS ON ANDROID 6.0 AND UP • When you install an app from Google Play on a device running Android 6.0 and up or on a Chromebook, you control which capabilities or information that app can access—known as permissions. For example, an app might want permission to see your device contacts or location. You can control which permissions an app can access after the app installs on your device. • Turn permissions on or off You can change the permissions that apps can access in the main Settings app on your device at any time. Keep in mind turning off permissions may cause apps on your device to lose functionality. 17
  • 18. APP PERMISSIONS FOR ANDROID 6.0 AND UP • Below are the app permissions available on Android 6.0 and up. The permissions you see on your device may vary by manufacturer. • To review the permissions on your device, follow the instructions under "Turn permissions on or off" above. • Body Sensors • Calendar • Camera • Contacts • Location • Microphone • Phone • SMS • Storage 18
  • 19. PERMISSIONS OVERVIEW • The purpose of a permission is to protect the privacy of an Android user. Android apps must request permission to access sensitive user data (such as contacts and SMS), as well as certain system features (such as camera and internet). Depending on the feature, the system might grant the permission automatically or might prompt the user to approve the request. 19
  • 20. PERMISSIONS OVERVIEW • A central design point of the Android security architecture is that no app, by default, has permission to perform any operations that would adversely impact other apps, the operating system, or the user. This includes reading or writing the user's private data (such as contacts or emails), reading or writing another app's files, performing network access, keeping the device awake, and so on. 20
  • 21. SEE ALL PERMISSIONS FOR EACH APP • For apps installed on your device On your device, open the main Settings app . Tap Apps or Application Manager (depending on your device, this may look different). Tap the app you want to update. Tap Permissions. Turn permissions on or off. • For instant apps On your device, open the Settings app . Go to Google Instant Apps. Tap the app you want to see more about. Look under “Permissions”. 21
  • 22. PERMISSION APPROVAL • An app must publicize the permissions it requires by including <uses- permission> tags in the app manifest. For example, an app that needs to send SMS messages would have this line in the manifest: 22
  • 23. RUNTIME REQUESTS (ANDROID 6.0 AND HIGHER) • If the device is running Android 6.0 (API level 23) or higher, and the app's targetSdkVersion is 23 or higher, the user isn't notified of any app permissions at install time. Your app must ask the user to grant the dangerous permissions at runtime. When your app requests permission, the user sees a system dialog (as shown in figure 1, left) telling the user which permission group your app is trying to access. The dialog includes a Deny and Allow button. • If the user denies the permission request, the next time your app requests the permission, the dialog contains a checkbox that, when checked, indicates the user doesn't want to be prompted for the permission again (see figure 1, right). 23
  • 24. RUNTIME REQUESTS (ANDROID 6.0 AND HIGHER) 24
  • 25. INSTALL-TIME REQUESTS (ANDROID 5.1.1 AND BELOW) • If the device is running Android 5.1.1 (API level 22) or lower, or the app's targetSdkVersion is 22 or lower while running on any version of Android, the system automatically asks the user to grant all dangerous permissions for your app at install-time (see figure 2). 25
  • 26. INSTALL-TIME REQUESTS (ANDROID 5.1.1 AND BELOW) 26
  • 27. NORMAL PERMISSIONS • Normal permissions cover areas where your app needs to access data or resources outside the app's sandbox, but where there's very little risk to the user's privacy or the operation of other apps. For example, permission to set the time zone is a normal permission. • As of Android 9 (API level 28), the following permissions are classified as PROTECTION_NORMAL: ACCESS_LOCATION_EXTRA_COMMANDS ACCESS_NETWORK_STATE ACCESS_NOTIFICATION_POLICY ACCESS_WIFI_STATE BLUETOOTH BLUETOOTH_ADMIN 27
  • 28. DANGEROUS PERMISSIONS AND PERMISSION GROUPS. 28
  • 29. SIGNATURE PERMISSIONS • The system grants these app permissions at install time, but only when the app that attempts to use a permission is signed by the same certificate as the app that defines the permission. • As of Android 8.1 (API level 27), the following permissions that third-party apps can use are classified as PROTECTION_SIGNATURE: BIND_ACCESSIBILITY_SERVICE BIND_AUTOFILL_SERVICE BIND_CARRIER_SERVICES BIND_DEVICE_ADMIN BIND_INCALL_SERVICE BIND_INPUT_METHOD BIND_MIDI_DEVICE_SERVICE BIND_NFC_SERVICE BIND_NOTIFICATION_LISTENER_SERVICE BIND_PRINT_SERVICE 29
  • 30. ‫منابع‬ • Chen, Haining, Ninghui Li, William Enck, Yousra Aafer, and Xiangyu Zhang. "Analysis of SEAndroid Policies: Combining MAC and DAC in Android." In Proceedings of the 33rd Annual Computer Security Applications Conference, pp. 553-565. ACM, 2017. • developer.android.com • support.google.com 30