Skills von pixel: security/spycheck software-development/android-debugging-from-termux

This commit is contained in:
2026-11-08 16:07:33 +01:00
parent e77842c33f
commit 97b91c57dd
4 changed files with 72 additions and 19 deletions
@@ -31,7 +31,7 @@ Key context that is easy to get wrong:
- pip installs that compile Rust wheels (pydantic-core, cryptography) take 5–10 min on-device: start them with `terminal(background=true, notify=true)` and log to a file, because a foreground timeout kills pip mid-build.
## Security / spyware check (MVT)
Install MVT into its own venv, check app IDs against the IOCs right away (works without ADB), then do the full `check-adb` once wireless debugging is paired (§4). Recipe and the IOC matcher are in `references/mvt-spyware-check.md`. Report to the user in German plain text: IOC hits, unknown-installer apps worth a look, and what was NOT covered yet.
Install MVT into its own venv and check app IDs against the IOCs right away (works without ADB): `references/mvt-spyware-check.md`. The full check (androidqf over ADB, then `mvt-android check-androidqf`; `check-adb` no longer exists) is the `spycheck` skill. Report to the user in German plain text: IOC hits, unknown-installer apps worth a look, and what was NOT covered yet.
## Tailscale / tailnet connectivity
- Non-root Termux tailscaled usually runs `--tun=userspace-networking` → proxy-only (SOCKS5/HTTP on localhost); stock Android browsers don't use local proxies, so browser access to tailnet names needs the official Tailscale app (real VpnService) or a TUN-capable proxy client.
@@ -135,6 +135,12 @@ confirmed the dup is recoverable from Nextcloud.
(codes are one-shot, ~1 min TTL) or server-side rate limiting after failed attempts.
**Get a FRESH code+port from the phone GUI, re-pair within ~30 s, then connect.
A fresh code has not been verified as working in the originating session.**
- Verified working flow for the SAME phone (self-debugging): user opens split screen (Settings on top, Termux below), taps "pair with code" and sends HOST:PORT + code in chat; run `adb pair HOST:PORT CODE` immediately (the Wi-Fi/tailnet IP the GUI shows works). Then connect via `127.0.0.1:<session port>`.
- Find the session port yourself instead of asking: scan 127.0.0.1 ports 30000-50000 with a threaded Python socket probe, then `adb connect 127.0.0.1:<p>` and keep the one whose `adb devices` state is `device`.
- "Paired" in the GUI only means the key is stored. If no port is open, the wireless-debugging service itself is off: Android switches it off when Wi-Fi changes, so ask the user to toggle the switch. Re-pairing is not needed.
- On public Wi-Fi with client isolation the GUI may show the tailnet IP (100.x). For a FOREIGN target phone, have it join this phone's hotspot so both are on one network.
- Anything that runs `adb kill-server` (e.g. androidqf on start) drops every network-ADB connection. Reconnect afterwards, or use the tool's own connect option.
- Never `pkill -f <pattern>` from the terminal tool: the pattern matches the tool's own shell command line and kills it. Use `pkill -x <name>`.
- Sanity checks before suspecting the client:
- `nc -z -w2 HOST PAIRPORT` — closed = code was consumed (good sign), open = GUI still showing (expected)
- `nc -z -w2 HOST SESSIONPORT` — must stay open
@@ -1,5 +1,7 @@
# MVT (mvt-project) on the phone itself, from Termux
Full workflow (widgets, androidqf, iOS sysdiagnose, report): see the `spycheck` skill. This file only covers install and the no-ADB quick check.
## Install (verified)
```bash
unset LD_LIBRARY_PATH
@@ -7,10 +9,12 @@ pkg install -y python-pip python-cryptography rust # rust is needed for the py
/data/data/com.termux/files/usr/bin/python -m venv --system-site-packages --without-pip ~/mvt-venv
# run in the background, it takes several minutes:
env -u LD_LIBRARY_PATH ~/mvt-venv/bin/python -m pip install mvt > ~/mvt-install.log 2>&1
env -u LD_LIBRARY_PATH ~/mvt-venv/bin/python -m pip uninstall -y cryptography # use Termux's python-cryptography; the pip wheel fails with dlopen PyModule_Type
env -u LD_LIBRARY_PATH ~/mvt-venv/bin/mvt-android download-iocs # -> ~/.local/share/mvt/indicators/*.stix2
```
- `--without-pip`: venv's ensurepip fails here. The system pip is reused through `--system-site-packages`.
- If even plain Termux python fails to `import array`, run `pkg upgrade python` (a partial upgrade leaves lib-dynload out of sync).
- If even plain Termux python fails to `import array`, first check that LD_LIBRARY_PATH is unset; only then try `pkg upgrade python`.
- `pip check` complains about the cryptography version pin afterwards; MVT runs fine anyway.
## Quick check without ADB (app IDs vs IOCs)
```bash
@@ -18,8 +22,4 @@ env -u LD_LIBRARY_PATH ~/mvt-venv/bin/mvt-android download-iocs # -> ~/.local/
```
Line format: `package:<apk path>=<pkg> installer=<x> uid:<n>`. Parse the package with `\.apk=(\S+)\s+installer`. Pull the IOC app IDs from the STIX `pattern` fields with the regex `app:id\s*=\s*'([^']+)'`, then intersect the two sets.
Also list the `/data/app` packages with `installer=null`. These are sideloaded via adb or restored from a backup, so mention them as "worth a look", not as a finding.
Limits: this check covers app IDs only. Processes, logs, SMS/URLs, files and settings need `mvt-android check-adb` (or androidqf) over a paired ADB session.
## Full scan
Pair via wireless debugging (SKILL.md §4), then:
`env -u LD_LIBRARY_PATH ~/mvt-venv/bin/mvt-android check-adb --output ~/mvt-out`
Limits: app IDs only. For processes, logs, settings and hashes use androidqf + `mvt-android check-androidqf` (`check-adb` was removed from MVT).