Android SELinux Internals Part II SELinux Domains, Denials, ... - #2840
Open
carlospolop wants to merge 1 commit into
Open
Android SELinux Internals Part II SELinux Domains, Denials, ...#2840carlospolop wants to merge 1 commit into
carlospolop wants to merge 1 commit into
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://8ksec.io/android-selinux-internals-part-ii Content Categories: Based on the analysis, this content was categorized under "Mobile Pentesting > Android Applications Pentesting > Android SELinux Domains, AVC Analysis, and Live Policy Manipulation". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Overview
This post is a practical guide to Android SELinux internals and post-root policy manipulation, tested by the author on devices through Android 16. It explains how applications receive process domains and data-file labels, how to decode visible and suppressed AVC denials, how file labels and process transitions affect exploit PoCs, and how Magisk, KernelSU, and APatch modify SELinux. The techniques are intended for rooted or engineering research devices and help remove mandato...
🔧 Technical Details
Derive or influence an application's SELinux domain: Android first maps an APK signing certificate to a
seinfovalue throughmac_permissions.xml. Zygote then combinesseinfowith the UID class, package name, privileged or ephemeral status, SDK sandbox status, and related selectors. It evaluatesseapp_contextsfrom top to bottom and uses the first match. On a policy-modifiable device, inserting a package-specific rule before the genericuntrusted_appcatch-all can place an application in a more privileged domain and assign a corresponding data-file type.Turn AVC messages into exact policy requirements: Read the denied permission set together with
scontext,tcontext, andtclass. These fields directly describe the missing source-type-to-target-type access. Monitordmesg,/proc/kmsg, or Logcat while reproducing th...🤖 Agent Actions
Implemented the HackTricks update.
Changes
android-selinux-domains-and-policy-manipulation.mdcovering:seinfoassignmentdontauditanalysischcon,restorecon,genfscon, andrunconmagiskpolicymanipulationsrc/SUMMARY.mdREADME.mdValidation
git diff --checkpassed.mdbook buildcould not run becausemdbookis not installed.This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.
📚 Repository Maintenance
All .md files have been checked for proper formatting (headers, includes, etc.).