Files
hermes-skillsharing/skills/security/spycheck/SKILL.md
T

6.4 KiB

name, description, version, author, license, metadata
name description version author license metadata
spycheck Use when checking phones for spyware via Termux/MVT. 2 Hermes Agent MIT
hermes
tags related_skills
security
spyware
stalkerware
mvt
androidqf
ios
sysdiagnose
termux
android-debugging-from-termux

Spycheck: quick check for spy/stalkerware from Termux (Pixel)

When to Use

The user wants to check their own or someone else's phone (with consent) for spyware, stalkerware or mercenary spyware, or wants to run, fix or extend the Spycheck widgets.

User preferences (always)

  • Plain German text, no Markdown. Short verdict first, then findings, then limits ("no guarantee: only KNOWN traces").
  • One-tap widgets on the phone, not a CLI recipe. Ask for consent first. Clean up AUTOMATICALLY at the end, without asking: delete raw case data (often 500+ MB) and the sysdiagnose archive. Keep only the report (and the expert ZIP if one was made).
  • Results must be shareable as a compact, styled HTML mail, not a bare .txt file: dark header, verdict banner (green/orange/red), lists, real umlauts. Append a short help block (what to do, hotlines, expert contacts) only on AUFFAELLIG or PRUEFEN.
  • Live progress is required for long steps: a step counter n/15 with a bar in the terminal and as an ongoing notification. Silent phases look like a hang to the user.
  • iOS: no long full backup. Use sysdiagnose plus the iCloud/account checklist instead.
  • Calm, realistic framing: mercenary spyware is targeted and rare; stalkerware and account access are the common threat.

Layout

~/spycheck: android-check.sh, ios-check.sh, lib/common.sh (dialogs, IOC update, progress), lib/android_report.py, lib/ios_analyze.py, bin/androidqf-auto, wrap/adb, src/ (androidqf git checkout plus patch), README.txt. Widgets: ~/.shortcuts/Spycheck-Android, Spycheck-iPhone. Reports: /sdcard/Download/Spycheck/. Raw data: ~/spycheck/cases/.

Procedure: Android

  1. Connection: the target phone joins via USB-OTG (termux-adb) or wireless debugging. For a foreign phone, prefer this phone's hotspot. For the OWN phone, use wireless debugging to 127.0.0.1; pairing and port discovery are in android-debugging-from-termux section 4.

  2. Run ANDROIDQF_AUTO=1 ANDROIDQF_SKIP=bugreport,backup bin/androidqf-auto -c <ip:port> -s <serial> -o <case>/aqf with </dev/null, in the background.

    • androidqf runs adb kill-server at startup, so a network device needs -c, or the connection is lost.
    • After startup its progress goes to <case>/aqf/command.log, not stdout. Watch it with progress_watch from common.sh, which maps [INFO] Collecting ... lines to steps n/15 and also posts a notification.
    • Expect about 8-10 minutes over WLAN; hashing the packages and the file list are the slow steps.
  3. Run mvt-android check-androidqf -o <case>/mvt <case>/aqf. Alerts land in mvt/alerts.json (fields: level, module, message).

  4. Write the German report with lib/android_report.py <case>. Line 3 is the verdict (it goes into the notification).

    • The heuristic flags sideloaded apps that combine accessibility, notification-listener and device-admin rights.
    • A MEDIUM "installed via browser/adb" alert alone is normal for F-Droid/Termux users. Never treat it as a finding.
  5. Turn it into mail HTML with lib/html_report.py <report.txt> [--hilfe], which writes <report>.html. Use a fixed word map for umlauts (ae->ä etc.); a generic regex wrecks words like "Quelle" and "aktuell". share_results in common.sh offers: report only, or report plus an expert ZIP (alerts.json, alerts_timeline.csv, info.json, *_detected.json, about 70 KB, no raw data).

  6. Mail handoff: termux-share -a send -c text/html < report.html opens the share sheet but cannot preset the recipient or subject. Prefilling FairEmail needs termux-am start -a android.intent.action.SEND -t text/html -p eu.faircode.email --esa android.intent.extra.EMAIL <addr> --es android.intent.extra.SUBJECT ... --es android.intent.extra.HTML_TEXT "$H". That only works when Termux's am socket server is running; if am.sock is missing, the user must fully exit and restart Termux. /system/bin/am is refused for the app uid. Never ask for SMTP passwords in chat; use the vault if SMTP sending is wanted.

Procedure: iPhone

The owner restarts the iPhone, triggers sysdiagnose, waits about 10 minutes, then shares the archive to /sdcard/Download (Quick Share works from iPhone). ios-check.sh runs mvt-ios check-sysdiagnose (device info only, no detection), then lib/ios_analyze.py <tar.gz> ~/.local/share/mvt/indicators <mvt.log>. That script checks shutdown.log (iShutdown method), ps.txt, .ips names and log domains against the IOCs. For account and iCloud-based spying, walk through references/ios-account-checklist.md. ios-check.sh appends the same checklist (/sdcard/Download/Spycheck/iPhone-iCloud-Checkliste.txt) to every iPhone report.

Real suspicion: advice order

Next steps and contacts go in references/suspicion-next-steps.md. Core rule: do not delete or reset first. Removing stalkerware alerts the abuser, and the traces are evidence. Seek help from a clean device; get a tool hit confirmed by experts before acting on it.

Environment rules

  • Always unset LD_LIBRARY_PATH before Termux python/mvt/go; Hermes's value loads a mismatched libpython.
  • MVT venv: ~/mvt-venv. Install and the cryptography-wheel fix are in android-debugging-from-termux references/mvt-spyware-check.md.
  • mvt-android check-adb was removed from MVT. Use androidqf, then check-androidqf.
  • androidqf finds adb via PATH, and wrap/adb points to termux-adb (nohajc apt repo; USB via termux-usb without root). Kill the android-tools adb server first: both use port 5037, and the version mismatch kills the server.
  • Patched androidqf (env ANDROIDQF_AUTO / ANDROIDQF_SKIP; the upstream build has promptui prompts and an Enter pause at the end). Rebuild: cd ~/spycheck/src; CGO_ENABLED=0 make -C android-collector build; cp android-collector/build/collector_* assets/; CGO_ENABLED=0 go build -o ../bin/androidqf-auto .
  • Long runs go through terminal(background=true, notify=true). Foreground timeouts kill pip/androidqf.

Testing

Use synthetic fixtures before claiming detection works. Real IOC examples: app com.apspy.app (TheTruthSpy, stalkerware STIX), Pegasus process ABSCarryLog, plus a Pegasus domain from the STIX file. Build a fake aqf dir (getprop.txt, packages.json, settings_secure.txt, dumpsys.txt) or a fake sysdiagnose tar, then confirm that a clean input gives UNAUFFAELLIG and a planted one gives AUFFAELLIG.