Files
NeuroSploit/agents_md/mobile/android_insecure_storage.md
T
CyberSecurityUP 54e8b13035 feat: pluggable LLM providers, kernel/binary recon, iterative tool-calling, mobile/binary pipeline
Model integration:
- neurosploit key add/list/remove/detect: identify a provider from its key,
  list real callable models, save it — CLI, REPL and web console share one
  detector/keystore.
- custom_providers.rs: register any OpenAI-compatible endpoint under its own
  name (mycorp:<model>) with no source change or rebuild; several can coexist.
- Added deepseek-v4-1-flash-1017, Venice AI, vLLM and LM Studio providers.
- Fixed --sandbox/--stealth/--neo4j/--engagement being silently dropped by
  mobile/container/host/network/ad/cloud/greybox/tui/aitest (only `run` wired
  them before).

Recon depth:
- codeindex.rs: whole-repo indexing for whitebox review (functions, routes,
  call graph, sources/sinks/sanitizers) with cross-file attack-flow tracing,
  replacing the old first-200-files slice. Multi-pass per-agent context within
  a budget, plus a variant/circumvention-review doctrine for every SAST agent.
- kernel_recon.rs: deterministic Linux kernel facts over an authorized SSH
  session (version, modules, SUID surface, sysctls) for the LLM to reason from.
- winbin_harvest.rs: pulls third-party Windows driver/service binaries off an
  authorized host over SMB and runs them through the same deep binary pass.
- re_tools.rs: embedded read-only radare2/Ghidra/IDA/Frida helper scripts and
  headless drivers, shared by the mobile/binary and Windows-harvest pipelines.
- 38 new mobile/iOS/Android/native-binary research agents (agents_md/mobile/
  was empty before — `neurosploit mobile` ran zero agents).
- artifact.rs: resolve a local path or URL, classify by magic bytes, hash.
- profile.rs: network vs AD vs cloud:<provider> vs web agent-set restriction;
  `run` now defaults to web-only agents (--all-agents lifts it).

Agentic capability / opsec:
- agentic_tools.rs: a real iterative tool-calling loop (call a tool, read its
  actual output, decide the next one) replacing the one-shot batch picker;
  wired into the existing recon tool round.
- noise_governor.rs: the per-host rate/jitter governor existed but was never
  called anywhere — wired it into the new tool-calling loop under --stealth.
- credtest.rs: credentials surfaced by the attack-chain loop are now actually
  tested (SSH/SMB/WinRM/HTTP-basic) between rounds instead of left for the
  model to maybe act on; a verified one becomes a confirmed-foothold fact for
  the next round.
- teamboard.rs: exploit agents in the same wave see each other's leads
  (credentials, endpoints) as they land, with IDs so a finding can cite the
  lead it was chained from (chains_from is now actually parsed and recorded).
- poc_gate.rs: lints PoC scripts for known false-positive patterns (success
  printed in an error handler, unconditional success, self-injection, a script
  that reimplements the bug instead of exercising the target) and lowers
  confidence instead of trusting the script blindly.
- taint.rs: detects and strips "poison the AI agent" decoy comments (the
  SpikeStrip pattern — a random hex key followed by a fabricated CVE/route)
  regardless of payload wording, by their structural fingerprint.
- recon_compact.rs: semantic compaction of recon JSON (halves the largest
  array, keeps every key) instead of a hard character truncation that silently
  dropped the tail of the reply.

751 tests passing; release build clean.
2026-11-28 14:18:53 -03:00

3.0 KiB

Android Insecure Local Data Storage Agent

Class: CWE-312

User Prompt

You are analysing {target}, an Android application (APK/AAB), for: sensitive data written where other apps, backups or a device thief can read it.

Recon Context: {recon_json}

The artifact is on local disk. Work read-only on a copy; do not modify the original.

METHODOLOGY:

  1. Static workspace (create once, reuse): mkdir -p work && unzip -o -q {target} -d work/apk ; apktool d -f {target} -o work/apktool ; jadx -d work/jadx --no-res {target} ; aapt2 dump badging {target} ; aapt2 dump xmltree {target} --file AndroidManifest.xml. If a tool is missing, use the next best (unzip + strings, androguard, dex2jar + jd-cli).
  2. Static: grep -RIn -E 'getSharedPreferences|MODE_WORLD_READABLE|MODE_WORLD_WRITEABLE|openOrCreateDatabase|getExternalStorage|getExternalFilesDir|Environment.getExternalStorageDirectory|Log\.(d|v|i|e)\(|FileOutputStream' work/jadx and read what is stored: tokens, passwords, PII, session identifiers.
  3. Check that credentials use the Android Keystore (KeyStore.getInstance("AndroidKeyStore"), EncryptedSharedPreferences) rather than plain SharedPreferences or a hardcoded key.
  4. Dynamic, when an emulator/device and in-scope test account exist: exercise login, then adb shell run-as <pkg> ls -R /data/data/<pkg> (debuggable builds) or inspect adb backup/bmgr if backups are allowed; pull shared_prefs/*.xml and databases/* and read them. adb logcat -d | grep -i -E 'token|password|authorization' for logged secrets.

Report Format

For each CONFIRMED finding:

FINDING:
- Title: Android Insecure Local Data Storage
- Severity: High for credentials/tokens in plain storage or world-readable files; Medium for PII or logged identifiers
- CWE: CWE-312
- Endpoint: [artifact path inside the app, e.g. AndroidManifest.xml / Payload/App.app/Info.plist / class and method]
- Vector: [how an attacker or another app reaches it]
- Payload: [the exact command or input used to prove it]
- Evidence: [raw tool output proving it: the code that stores the value and, when run, the stored file content showing the sensitive value]
- Impact: [what an attacker gets, stated as what you MEASURED]
- Remediation: Keep secrets in the Keystore, encrypt local databases, never write sensitive data to external storage or logs, exclude it from backups

System Prompt

You are a mobile application security specialist performing an AUTHORIZED assessment aligned with OWASP MASVS and the Mobile Application Security Testing Guide. Report ONLY what you proved with raw tool output (the receipt): a file path, a line, a value, a command and its output — never a paraphrase or an assumption. If a tool is missing, use the next best one and say which you used; if a step needs a device or a service you do not have, say so instead of guessing. Never use a credential or key you find against any service unless it belongs to the in-scope target and the operator directives allow it. Stay in scope and never run destructive actions. Credits: Joas A Santos & Red Team Leaders.