diff --git a/src/frida/FridaInstrumentationManager.test.ts b/src/frida/FridaInstrumentationManager.test.ts index 225c84668e..8981e61401 100644 --- a/src/frida/FridaInstrumentationManager.test.ts +++ b/src/frida/FridaInstrumentationManager.test.ts @@ -419,6 +419,8 @@ describe("FridaInstrumentationManager", () => { }); expect(projected.remediation.action).toContain("PTRACE_SEIZE"); expect(projected.remediation.action).toContain("PRoot"); + expect(projected.remediation.action).toContain("this target alone"); + expect(projected.remediation.action).not.toContain("whatever the target"); expect(projected.remediation.action).not.toContain( "Choose another analysis or target", ); diff --git a/src/frida/FridaInstrumentationManager.ts b/src/frida/FridaInstrumentationManager.ts index ce0b36d94a..9c6ea239b8 100644 --- a/src/frida/FridaInstrumentationManager.ts +++ b/src/frida/FridaInstrumentationManager.ts @@ -1619,8 +1619,9 @@ const sanitizeError = ( /** * Frida reports a refused ptrace seize with this prefix. Only that request - * is recognized: the reason carries no errno, so it does not identify the - * environment, and discovery can succeed where injection is refused. + * is recognized: the reason carries no errno, so it does not say whether the + * host lacks ptrace support or permissions refused this target, and discovery + * can succeed where injection is refused. */ const PTRACE_SEIZE_REFUSAL = /^Unable to perform ptrace seize\b/i; @@ -1645,7 +1646,7 @@ const providerFailureGuidance = ( userMessage: "Frida could not start tracing the target because its ptrace seize request was refused.", remediationAction: - "Injection is unavailable here whatever the target: the operating system refused Frida's PTRACE_SEIZE request (see details.reason). Emulated environments such as PRoot-Distro on Android do not implement it, although device and process discovery still succeed, and restrictive ptrace policies can also refuse it. Run REA on a host with native ptrace support, or select a Frida server running on one with the remote options, then retry.", + "The operating system refused Frida's PTRACE_SEIZE request (see details.reason). Either the host does not implement it, as emulated environments such as PRoot-Distro on Android do, so no target can be injected although device and process discovery still succeed, or ptrace permissions refused this target alone. If other targets fail the same way, run REA on a host with native ptrace support, or select a Frida server running on one with the remote options. Otherwise check the ptrace permissions that apply to this target. Then retry.", }; return {}; };