Repository navigation
Add behavioral detection tests and static emulator coverage - #4007
Draft
jacobocasado wants to merge 39 commits into
Draft
jacobocasado wants to merge 39 commits into
jacobocasado wants to merge 39 commits into
Conversation
5 of 6 tasks
This reverts commit 8c09f17.
This branch has not been deployed
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.
Relates to #4005. Supersedes #4006.
Description
Draft / WIP: This branch is not ready for review. It still needs to address @cpholguera's feedback on collecting outputs from logs and on making observations reproducible when detection is not visible on screen or in logs. These are two related themes across three inline comments on #4006.
Adds three Android behavioral detection tests for root, emulator, and hooking, with accompanying demos for root and emulator. Also adds the static emulator detection test from @sgIOlas's work and a separate native hooking demo for the existing instrumentation-based test. The behavioral hooking test does not yet have a demo.
The behavioral tests run the app under the selected condition and evaluate its response according to its risk profile. Root and emulator observation does not require Frida. In the hooking test, Frida supplies the test stimulus rather than tracing the app's detection logic.
Implemented changes
MASTG-TEST-0x01(root),MASTG-TEST-0x02(emulator), andMASTG-TEST-0x04(hooking).MASTG-DEMO-0x01(root) andMASTG-DEMO-0x02(emulator).MASTG-TEST-0x03.MASTG-DEMO-0x03associated with the existing dynamicMASTG-TEST-0341; keepMASTG-DEMO-0108unchanged from upstream.Build.SERIALandBuild.USERchecks.Related: #3987.
Coverage after this PR
This matrix covers Android root, emulator, hook, and debugger detection in MASTG. It distinguishes static analysis, instrumentation-based dynamic analysis, and behavioral testing.
New marks additions in this PR. A dash means no dedicated test or directly associated demo was identified. Temporary
0xIDs will be replaced during review.MASTG-TEST-0324Demo:
MASTG-DEMO-0087MASTG-TEST-0x03Demo: —
Demo: —
MASTG-TEST-0352Demos:
MASTG-DEMO-0115,MASTG-DEMO-0116MASTG-TEST-0325Demo:
MASTG-DEMO-0088MASTG-TEST-0351Demo:
MASTG-DEMO-0114MASTG-TEST-0341Demos:
MASTG-DEMO-0106,MASTG-DEMO-0107,MASTG-DEMO-0108, newMASTG-DEMO-0x03MASTG-TEST-0353Demo: —
MASTG-TEST-0x01New demo:
MASTG-DEMO-0x01MASTG-TEST-0x02New demo:
MASTG-DEMO-0x02MASTG-TEST-0x04Demo: —
Demo: —
Remaining gaps
MASTG-TEST-0x04.Completing the remaining coverage is outside this PR's scope and is left for later.
Validation
git diff --check, shell syntax, and JavaScript syntax checks pass for this branch.A full website build, the native demo's runtime behavior, and the full device/environment matrix were not validated locally for this branch. Further review and validation remain WIP.
AI Tool Disclosure
This contribution does not include AI-generated content.
This contribution includes AI-generated content.
AI tools used: Pi coding agent with the OpenAI Codex provider.
Models and versions:
openai-codex/gpt-6.1-sol(runtime model identifier).Prompt summary: Review MASTG conventions, align behavioral test evaluation with risk-appropriate responses, reuse demo inputs, validate local sample behavior, and prepare the issue, PR, and coverage matrix. Reconcile this draft with the revised branch and @cpholguera's review feedback. The contributor reviewed and corrected the proposed wording and scope throughout the process.
Your mobile security expertise level: high.
Contributor Checklist