Skip to Content
mobsec

Troubleshooting

Ordered by how often each one actually happens.

The five-minute triage

pentestctl status            # which section is red?
pentestctl fix               # repairs reverse + frida
adb devices                  # is the emulator even up?
curl -s -x 127.0.0.1:18080 -o /dev/null -w '%{http_code}\n' https://example.org
tail -20 /tmp/mitm.log

If pentestctl status is green but the app is silent, the problem is almost always inside the app (dead proxy in a cached connection, app not restarted, wrong package).

Symptom → cause

SymptomMost likely causeFix
App spins forever, zero flowsadb reverse died on rebootnettap on
Zero flows but nettap status says upapp cached a dead connectionforce-stop + relaunch; fspawn … intercept
GMS/Play Store TLS errors in /tmp/mitm.logCert-Fixer didn't run this bootreboot, then pentestctl status | grep Cert-Fixer
frida-ps hangs or "unable to connect"frida-server diedadb shell su -c '/data/adb/fsrv/ctl start'
Failed to spawn but package installedwrong package name / user profileadb shell pm list packages | grep -i name
App crashes at startup under Fridaa script broke itfspawn <pkg> raw, add scripts one at a time
net_error -202 on every WebView pagewhitelist denylist policyzygiskd denylist-policy default (see below)
Attestation rejected (4202) after a keybox changetarget.txt missing the package, or keybox revoked/expiredpentestctl status | grep keybox, add package, force-stop app
magisk -v → Cannot connect to daemondaemon segfaulted by a two-arg --denylist rmreboot
Emulator won't boot after a bad snapshotsnapshot captured a broken mountsnap boot (cold), verify, snap save <newname>
A command you rely on suddenly behaves differentlya ~/mobsec/bin helper shadows it (PATH order)pentestctl status → host commands; rename the helper

Trap list (all hit for real here)

1. adb reverse does not survive a reboot

settings put global http_proxy does. Result: the app points at 127.0.0.1:18080 where nothing listens, and every request hangs with no error. pentestctl fix handles it.

2. frida … < /dev/null exits instantly

No tty → REPL dies. Use a fifo:

mkfifo /tmp/f; sleep 900 > /tmp/f &
fspawn <pkg> intercept < /tmp/f > /tmp/frida.log 2>&1 &

3. pkill -f kills your own shell

pkill -f qemu-system or pkill -f 'frida -U -f pkg' matches the bash -c "<that command>" wrapper and kills the invoking shell (exit 143). Record the PID and kill <pid>.

4. magisk --denylist rm <pkg> <process> segfaults magiskd

Always one argument: magisk --denylist rm <pkg>. Recovery from the crash requires a reboot.

5. Whitelist denylist policy breaks WebView renderers

zygiskd denylist-policy whitelist avoids injecting into non-listed apps, but renderer sandbox processes (…:sandboxed_process0, isolated uid) never match the package, so the CA and unpinning hooks are missing inside WebView → SSL handshake failed; net_error -202. Keep default.

6. adb shell su -c '…' mangles quotes and loops

Multi-line snippets with for/while fail with syntax error: unexpected 'do'. Use asu '…', which writes a script and runs it.

7. Don't grep /data/adb/modules/zygisksu/ recursively

Its webroot has megabytes of i18n JSON and floods your terminal (and your context). Read specific files.

8. mitmproxy does not hot-reload addons

Edited mitm/dump.py? nettap off && nettap on, otherwise you keep the old behaviour (this is how a "fixed" filename bug appears unfixed).

9. PlayIntegrityFork v19 is arm-only

On x86_64 it silently never loads (zygiskd status stops listing playintegrityfix). Use the 4.9 x86_64 build.

10. Medusa's shared_preferences module kills WebView apps

java.lang.NullPointerException … SharedPreferences$Editor.apply() on a null object reference inside WebViewChromiumFactoryProvider. Not in any default profile.

Recovery runbook

# 1. device
snap boot                     # or: snap load logged-in
adb wait-for-device
pentestctl status

# 2. root/modules
adb shell su -c 'zygiskd status'
adb shell su -c 'cat /data/adb/tricky_store/target.txt'
adb shell su -c 'grep -o "DeviceID=\"[^\"]*\"" /data/adb/tricky_store/keybox.xml'

# 3. frida
adb shell su -c '/data/adb/fsrv/ctl status' || adb shell su -c '/data/adb/fsrv/ctl start'
frida-ps -U | head -3

# 4. interception
nettap on
ls -t /tmp/mtflows/*.txt | head -2

# 5. CA trust for system apps
adb shell su -c 'tail -1 /data/local/tmp/cert-fixer.log'   # want "execution completed"

If step 5 is stale, reboot once — Cert-Fixer only mounts at post-fs-data.

Logs worth knowing

LogWhat
/tmp/mitm.logmitmdump stdout (-v), TLS failures, addon exceptions
/tmp/mtflows/_err.logaddon write failures
/tmp/frida.logyour fspawn output when run in background
/data/local/tmp/cert-fixer.logCA mount result per boot
adb logcatapp crashes: adb logcat -v time | grep -iE 'AndroidRuntime|FATAL'

When nothing makes sense

Compare against a state you know worked:

snap load logged-in
pentestctl fix
fspawn tech.httptoolkit.pinning_demo intercept    # known-good pinning target

If the demo app also fails, the rig is broken. If only your target fails, the target has an additional defence — collect fspawn … trace output and read the rootcheck/tls lines before guessing.

On this page