Port MASTG-TEST-0045 (Root Detection) from v1 to v2#3604
Merged
cpholguera merged 43 commits intomasterfrom Feb 9, 2026
Merged
Conversation
- Add MASTG-TECH-0142: Bypassing Root Detection technique - Add MASTG-TEST-0289: Static test for root detection in code - Add MASTG-TEST-0290: Dynamic test for runtime root detection - Add MASTG-BEST-0028: Best practice for implementing root detection - Add MASTG-DEMO-0040: Static demo with semgrep rules - Add MASTG-DEMO-0041: Dynamic demo with Frida bypass script - Add semgrep rules for detecting root detection patterns - Deprecate old MASTG-TEST-0045 with references to new tests Co-authored-by: cpholguera <29175115+cpholguera@users.noreply.github.com>
Co-authored-by: cpholguera <29175115+cpholguera@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create MASTG v2 tests for root detection
Port MASTG-TEST-0045 (Root Detection) from v1 to v2
Dec 21, 2025
serek8
suggested changes
Jan 30, 2026
Collaborator
serek8
left a comment
There was a problem hiding this comment.
Added a couple of comments. Not sure what is the current policy about the Test and Demo titles. @cpholguera are they good here?
Should we mention that a user can install e.g. KernelSU to verify if the app can resist more advanced rooting tools. We keep saying about more advanced bypasses but don't really describe what they are and how to test the app against them.
demos/android/MASVS-RESILIENCE/MASTG-DEMO-0540/MASTG-DEMO-0540.md
Outdated
Show resolved
Hide resolved
serek8
reviewed
Jan 30, 2026
demos/android/MASVS-RESILIENCE/MASTG-DEMO-0541/MASTG-DEMO-0541.md
Outdated
Show resolved
Hide resolved
…pilot/add-testing-root-detection
Co-authored-by: Jan Seredynski <janseredynski@gmail.com>
…y and completeness
…led explanations and updated techniques
demos/android/MASVS-RESILIENCE/MASTG-DEMO-0540/MASTG-DEMO-0540.md
Outdated
Show resolved
Hide resolved
demos/android/MASVS-RESILIENCE/MASTG-DEMO-0541/MASTG-DEMO-0541.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ining Runtime.exec patterns
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ation documentation
serek8
approved these changes
Feb 9, 2026
Diolor
reviewed
Feb 9, 2026
serek8
approved these changes
Feb 9, 2026
Copilot stopped work on behalf of
cpholguera due to an error
February 9, 2026 17:21
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.
Closes #3021
This PR ports MASTG-TEST-0045 (Testing Root Detection) from v1 to v2, splitting it into separate static and dynamic tests with comprehensive supporting content including techniques, demos, best practices, apps, tools, and Semgrep rules.
Structure
Tests
MASTG-TEST-0324: Static analysis for root detection code patternsMASTG-TEST-0325: Dynamic analysis using runtime bypass to identify detection mechanismsMASTG-TEST-0045: Updated to mark as deprecatedTechniques
MASTG-TECH-0042: Modified/updated existing techniqueMASTG-TECH-0144: Documents bypass methods using objection and Frida for root detection evasionBest Practices
MASTG-BEST-0029: Implementation guidance covering file-based, package, process, and system property checksMASTG-BEST-0030: Additional best practice for root detectionDemos
MASTG-DEMO-0087: Static demo with working Kotlin/Java code samples, including AndroidManifest.xml, source code, reversed Java, and Semgrep outputMASTG-DEMO-0088: Dynamic demo with Frida hooks configuration (hooks.json) and output demonstrating root detection bypassApps
MASTG-APP-0032: Sample app for root detection testingMASTG-APP-0033: Additional sample app for root detection testingTools
MASTG-TOOL-0146: Tool documentation for root detection analysisMASTG-TOOL-0147: Additional tool documentationKnowledge
MASTG-KNOW-0027: Updated knowledge article linked to tests and best practicesAdditional Changes
rules/mastg-android-root-detection.yamlMASTG-TEST-0045as deprecatedWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
mas.owasp.org/usr/bin/curl curl -s REDACTED git conf�� unset --global /snap/bin/git user.email(dns block)semgrep.dev/home/REDACTED/.local/bin/pysemgrep osemgrep --config ../../../../rules/mastg-android-root-detection.yaml ./MastgTest_reversed.java --text k/mastg/mastg/best-practices/android/MASVS-RESILIENCE/ -TEST-0036.md nfig/composer/vendor/bin/grep(dns block)/home/REDACTED/.local/bin/pysemgrep osemgrep --config ../../../../rules/mastg-android-root-detection.yaml ./MastgTest_reversed.java --text --noprofile STG-TEST-0020.md p/bin/grep(dns block)/home/REDACTED/.local/bin/pysemgrep osemgrep --config test_rule.yaml ./MastgTest_reversed.java --text --noprofile STG-TEST-0021.md./techniques/android/MASTG-TECH-0041.md x-gnu.so(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.