Port MASTG-TEST-0045 (Root Detection) from v1 to v2 #3604
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.
Splits the v1 root detection test into separate static and dynamic v2 tests with supporting technique, demos, and best practices.
Structure
Tests
MASTG-TEST-0289: Static analysis for root detection code patternsMASTG-TEST-0290: Dynamic analysis using runtime bypass to identify detection mechanismsTechnique
MASTG-TECH-0142: Documents bypass methods using objection and Frida for root detection evasionBest Practice
MASTG-BEST-0028: Implementation guidance covering file-based, package, process, and system property checksDemos
MASTG-DEMO-0040: Static demo with working Kotlin/Java samples and 5 semgrep rules detecting:new File($PATH).exists())getPackageInfo())getpropMASTG-DEMO-0041: Dynamic demo with Frida script hooking common root detection APIs and logging bypass activitySemgrep Rules
New rules in
rules/mastg-android-root-detection.yaml:Metadata
All components reference:
MASWE-0097MASTG-KNOW-0027[R]The original
MASTG-TEST-0045is marked deprecated withcovered_by: [MASTG-TEST-0289, MASTG-TEST-0290].Warning
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.