Skip to content
Projetos

Sobre

Experimental script to scan local LLM files for hidden malware (GGUF, Ollama, LM Studio, Hugging Face). Read-only, offline, interactive TUI. MIT.

Segurança e privacidade

Como estes números são medidos

Crescimento medido de estrelas

em 24 h
+1
em 7 dias
Coletando histórico
em 15 dias
Coletando histórico
em 1 mês
Coletando histórico

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

gguf-check

Experimental script to scan local LLM files for hidden malware. Built after five poisoned GGUF models were found on Hugging Face in November 2026 (Malspark report). No guarantee: it detects the known tricks and structural anomalies, not every possible backdoor.

Video (German): In lokaler KI wurde ein Virus gefunden

Cross-platform security scanner for local AI models (macOS, Linux, Windows). Inspects GGUF, Safetensors, PyTorch/Pickle, ONNX, Keras, HDF5, Hugging Face / MLX configs, Ollama manifests/templates, and host IOCs with an interactive full-screen terminal UI (TUI).

  • 100% read-only & offline: Never loads, runs, or executes any AI model, chat template, or pickle payload. Zero network calls during local scans (only --hf connects to huggingface.co).
  • Cloud-safe: Never hydrates iCloud Drive or OneDrive placeholders (macOS setiopolicy_np + SF_DATALESS, Windows RECALL_ON_DATA_ACCESS/OFFLINE, Linux virtual/network mount filters).
  • Zero dependencies: Pure Python 3.8+ standard library engine wrapped in a lightweight Node launcher.

Quick Start

Run directly via npx (no installation needed):

npx gguf-check          # Opens the interactive full-screen TUI in English
npx gguf-check -de      # Opens the interactive full-screen TUI in German

Or install globally:

npm install -g gguf-check
gguf-check              # English TUI (default)
gguf-check -de          # German TUI

Interactive TUI

Launching gguf-check (or gguf-check -de) in a terminal opens the guided 5-step TUI (1 Start › 2 Scan › 3 Findings › 4 System › 5 Export):

  • Row 1 (Primary Scan Modes):
    • 1 · ONLY SCAN - Fast scan of local AI app folders (Ollama, LM Studio, Hugging Face/MLX, llama.cpp, Jan, ComfyUI, GPT4All, Msty, AnythingLLM, Draw Things, Cherry Studio).
    • 2 · STANDARD ★ - Recommended: AI apps + Downloads + external drives + host malware checks (IOCs, persistence, OLLAMA_HOST, MCP configs).
    • 3 · DEEP SCAN - Full device scan across local drives with magic-byte sniffing for renamed models, full zero-scale weight checks, and SHA-256 IOC matching.
  • Row 2: 4 · CUSTOM FOLDER OR FILE - Scan any single folder or model file.
  • Row 3: 5 · HUGGING FACE REPO (inspect remote repos without full download) and 6 · SELF-TEST (OFFLINE) (verify all 15 built-in detectors safely in ~1 second).

Navigate cards with arrow keys or mouse clicks, press Enter to start, and move cleanly through Findings › System › Export with ← / → or the top workflow bar.

CLI Usage

All modes and exporters also work directly from the command line (CI, scripts, pipes):

gguf-check --only                              # Fast: AI runner folders only
gguf-check --standard                          # Standard: AI folders + Downloads + drives + host checks
gguf-check --deep                              # Deep: full device scan + magic sniffing + SHA-256
gguf-check /path/to/models                     # Scan a specific folder or file
gguf-check --hf owner/repo                     # Inspect a Hugging Face repo without downloading weights
gguf-check --self-test                         # Run the 20-check isolated offline self-test
gguf-check --json report.json --html report.html
gguf-check -de --standard                      # Any CLI command in German

Exit Codes

  • 0 - Clean (OK or INFO only)
  • 1 - Findings detected (SUSPICIOUS or CRITICAL)
  • 2 - Usage or runtime error
  • 130 - Interrupted by user (Ctrl+C)

What It Checks

  • GGUF (v2/v3, all 36 active GGML tensor types): Header padding, inter-tensor gaps, trailing overlays behind the last tensor (PE/ELF/Mach-O/archive carving and Malspark ollie signatures), all chat templates (Jinja2 SSTI, command injection, de-obfuscation, Unicode tag smuggling), zero-scale weight anomalies, BPE UNUSED token contradictions, and SHA-256 IOC matching.
  • Other AI Formats: Safetensors (header bounds, offsets, trailing data), PyTorch/Pickle/Joblib/NumPy (static opcode inspection via pickletools.genops, never pickle.load), ONNX (external data path traversal), Keras (.keras Lambda layers), HDF5, Hugging Face/MLX configs (auto_map, chat_template.jinja, additional_chat_templates), and Ollama manifests/templates/Modelfiles.
  • Host & Runner Checks (standard and deep): Malspark Windows traces (%APPDATA%\ollie, %TEMP%\d.exe, %SystemRoot%\Temp\payload.ps1, Registry Run/RunOnce), macOS LaunchAgents/LaunchDaemons, Linux systemd/autostart, ~/.config/ollie, exposed OLLAMA_HOST bindings, and MCP config audits.

Prompt for your own AI agent

PROMPT_KI_AGENT_DE.md (German): a checked prompt for Claude Code, Codex or OpenCode. The agent reads the script first, asks which scan mode you want, runs exactly one read-only scan and explains every finding.

Requirements

  • Node.js 16+ (for npx / npm)
  • Python 3.8+ on your PATH (or py -3 on Windows). Zero pip dependencies required.

Limitations & Privacy

No security scanner provides a 100% guarantee. gguf-check detects known attacks, structural anomalies, dangerous deserialization opcodes, and suspicious template patterns, but cannot rule out novel stealth techniques or subtle weight-level backdoors. Exported JSON/HTML reports contain your hostname and local file paths; review them before sharing publicly.

License

MIT, see LICENSE. No third-party dependencies: the scanner uses only the Python standard library, the launcher only Node.js built-ins. Free to use, copy, modify and share.

Explore projetos relacionados

Carregando…