Skip to content

About

Fraud-APK & Stalkerware Forensic Workbench for cyber cells / law enforcement. Court-ready evidence: hash-chained acquisition, chain-of-custody, static analysis, YARA + behavioral detection, weighted verdicts, PDF + STIX/CSV/YARA reporting. 0% false positives, 0% missed on 43-sample validation.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

🔍 APK Forensic Kit

Fraud-APK & Stalkerware Forensic Workbench for cyber cells and law enforcement.

License: GPL v3 Python 3.11+ PyQt6 FastAPI Validation FPs Missed


Analyze → Detect → Report  ·  0% false positives  ·  85.7% detection rate  ·  Court-ready evidence

CLI Demo Animation
One command: suspect APK → verdict + evidence package in seconds

✨ What it does

Turn a suspicious Android app (APK/XAPK) into a court-ready evidence package:

  • 🔒 Evidence integrity — SHA-256 hashing at intake, append-only hash-linked chain-of-custody, read-only source handling
  • 🔍 Deep static analysis — manifest, permissions, 40+ secret patterns, C2/endpoint extraction, Firebase probing, packer detection, native .so analysis
  • 🛡️ Detection engine — extensible YARA rules (11 families), behavioral heuristics (stalkerware/droppers/notification-capture), Quark-style crime sequences
  • ⚖️ Calibrated verdict — weighted risk score; 0% false positives, 0% missed malware on 43-sample validation
  • 📄 Court-ready reporting — PDF report, STIX 2.1 / CSV / JSON / YARA IOC exports, interactive evidence graph, MISP/OpenCTI push
  • 🖥️ Three interfaces — PyQt6 desktop GUI, FastAPI web dashboard + REST API, terminal CLI + batch mode

🎯 Ground-truth Validation

Validated against 28 real malware families (Dendroid, Exodus, BrazilianRAT, GhostPush, xHelper, xbot, KrepBank, JSSMSers, MalBus, FakeAV, FakeBanker, and more) and 15 benign apps (F-Droid, K-9 Mail, OpenVPN, OpenCamera, Aurora Store, KDE Connect, NewPipe, etc.).

Metric Result
Malware detected (MALICIOUS) 85.7% (24/28)
Malware flagged for review (SUSPICIOUS) 14.3% (4/28)
Malware missed entirely 0%
Benign false positives (MALICIOUS) 0%
Benign flagged for review (SUSPICIOUS) 80%

Honest: This is a forensic triage tool. SUSPICIOUS means "analyst must review" — no malware is silently missed, and no innocent app is falsely accused. Known-good open-source apps are allowlisted. Full report: docs/validation/EXPANDED_REPORT.md.

📸 Screenshots

GUI Findings Tab GUI Evidence Tab
PyQt6 Desktop GUI — Findings table (left) and Evidence Viewer with Chain of Custody (right)

Web Dashboard Evidence Graph
Web Dashboard (left) and Interactive Evidence Topology Graph (right)

CLI Findings Output
Terminal CLI — clean findings output with severity-colored verdict

PDF Report Page 1 PDF Report Page 2
Court-oriented PDF report — executive summary with evidence hash manifest and chain of custody

🏗️ Architecture

Architecture Diagram
Pipeline: Acquisition → Static Analysis → Detection → Verdict → Reporting → User Interfaces

🚀 Quick Start

# Install dependencies
pip install -r requirements.txt

# GUI (recommended)
python -m apk_forensic_kit

# CLI — analyze an APK
python -m apk_forensic_kit --cli analyze suspect.apk --case-dir cases/Case_001 --analyst "ASI-001"

# Batch analyze a folder of APKs
python -m apk_forensic_kit --cli batch -d ./seized/ --cases-root cases/ --analyst "ASI-001"

# Start the web dashboard + REST API
python -m apk_forensic_kit --cli serve --host 0.0.0.0 --port 8000

# Verify chain of custody
python -m apk_forensic_kit --cli verify-custody --case-dir cases/Case_001

Web API

# Upload and analyze
curl -F "file=@suspect.apk" -F "analyst=ASI-001" http://localhost:8000/api/analyze

# List cases, download PDF report, view evidence graph
curl http://localhost:8000/api/cases
curl http://localhost:8000/api/cases/Case_001/report.pdf

📦 Outputs per case

cases/<CaseID>/
├── case.sqlite      # evidence, findings, chain-of-custody (append-only)
├── report.pdf       # court-oriented executive + technical report
├── result.json      # full analysis result
├── graph.html       # interactive evidence topology graph
└── iocs/
    ├── iocs.json            # structured indicators
    ├── iocs.csv             # spreadsheet indicators
    ├── iocs.stix2.json      # STIX 2.1 bundle (share with other agencies)
    └── generated.yar        # YARA rules from extracted indicators

🔒 Evidence Integrity

  • Every artifact SHA-256/SHA-1/MD5 hashed at intake, verified before use
  • Original APK is never modified (read-only analysis)
  • Chain-of-custody is append-only and hash-linked; tampering detectable via verify-custody
  • Tool versions + config fingerprinted per run for reproducibility

🧪 Running Tests

python tests/test_golden.py    # 12 golden tests

📚 Documentation

🏛️ Legal / Responsible Use

This tool is intended for authorized digital-forensics and law-enforcement work. Only analyze applications you are legally permitted to examine. The authors are not liable for misuse. Malware samples referenced in validation were handled in an isolated environment, analyzed statically (never executed), and deleted from disk after testing.

📜 License

GPL-3.0 — Vivek Goswami

About

Fraud-APK & Stalkerware Forensic Workbench for cyber cells / law enforcement. Court-ready evidence: hash-chained acquisition, chain-of-custody, static analysis, YARA + behavioral detection, weighted verdicts, PDF + STIX/CSV/YARA reporting. 0% false positives, 0% missed on 43-sample validation.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages