raksa-iocscan-mcp
OfficialExposes a live Prometheus-compatible /metrics (and /healthz) HTTP endpoint from the watch daemon, publishing scan and daemon telemetry in a scrapeable format for monitoring and alerting.
Optionally looks up scanned file hashes against VirusTotal through the hash-only online provider (check-hash / scan --online), using a 6-hour disk TTL cache for results.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
raksa-iocscan
Fast, zero-mandatory-dependency Malware Defense & IoC Scanner written in Python (Layer 5 of the Raksa Security Suite).
raksa-iocscan inspects local hosts, CI artifacts, build outputs, documents, and incident triage directories with zero external runtime requirements (dependencies = [] in pyproject.toml): single-pass streaming SHA-256/SHA-1/MD5 hashing (348.0 MB/s), PE Imphash + pure-Python FastCDC fuzzy similarity (IOC-004), allowlist drift diffing (diff-allowlist), continuous incremental watch daemon with SIEM NDJSON + HTTPS webhooks + Prometheus /metrics, bounded PE Authenticode DER & Universal Fat Mach-O inspection (IOC-211), multi-stage static payload deobfuscation (IOC-210), static OOXML/OLE2/PDF/LNK/HTA/SVG triage (IOC-207..IOC-209), pure-Python YARA compilation with JSON rule cache (--rules-cache, 10.6x warm speedup) and literal-prefiltered AST evaluation (5,183.6 files/sec across 26 built-in rules; 3,915.7 files/sec across 250 rules, pe.*/elf.*/math.entropy() parity, plus optional yara-x extra), STIX 2.1/JSON/CSV IoC extraction, bounded ZIP/TAR/7z/RAR archive inspection (IOC-401..IOC-404), fail-closed .iocscan.yml policies, SARIF 2.1.0 / Markdown / NDJSON reporting, 14 CLI subcommands, and a 10-tool stdio MCP server.
Key Capabilities (v0.3.0)
27 Built-In Defensive Rules (
IOC-001throughIOC-501): Mapped to NIST SP 800-83, CIS Controls v8, CWE-22/CWE-409/CWE-434, STIX 2.1, MITRE ATT&CK, and MITRE D3FEND techniques (D3-FH,D3-AL,D3-FA,D3-FE,D3-BA,D3-PSA,D3-DA,D3-NCI).Pure-Python YARA Compiler, Parity & JSON Rule Cache (
IOC-101..IOC-103): Zero-dependency lexer/parser supporting comments,meta:, ASCII/wide/nocase/fullwordstrings, hex wildcards/jumps/alternations, byte regexes,uint16/uint32/filesize,$id at/$id in (..),math.entropy(),pe.imphash(),pe.is_pe,pe.is_dll(),pe.machine,pe.number_of_sections,pe.is_signed,elf.type,elf.machine,elf.number_of_sections, compile-time literal anchor prefiltering, SHA-256 fingerprint-verified JSON caching (--rules-cache), syntax verification (verify-yara), 26 built-in signatures with 0 false positives on source code, and cached optional--yara-engine yara-x.Streaming Hash, Imphash, Fuzzy Similarity, Diff & Online Adapters (
IOC-001..IOC-004): Computes SHA-256, SHA-1, and MD5 in a single64 KiBchunked stream; matches JSON/CSV/TXT blocklist/watchlist DBs plus PE Imphash and Gear-based FastCDC fuzzy hashes (raksa-fzh1:*) for mutated binary variants (IOC-004); generates and diffs deterministic SHA-256 allowlists (hash-manifest/diff-allowlist); and optionally queries hash-only online providers (custom,malwarebazaar,threatfox,circl-nsrl,virustotal) with a 6-hour disk TTL cache (--online --online-provider).PE Authenticode DER & Universal Fat Mach-O Signing Checks (
IOC-211): Bounded ASN.1 DER PKCS#7 inspection extracting signer CN/O/Country, digest OIDs (SHA-256..MD5), and countersignature/RFC-3161 timestamps, alongside Fat Mach-O (FAT_MAGIC/FAT_MAGIC_64) architecture slicing checkingLC_LOAD_DYLIBandLC_CODE_SIGNATUREuniformity acrossarm64/x86_64slices.Multi-Stage Static Payload Deobfuscator (
IOC-210): Recursively decodes up to 3 layers (256 KiBcap, 12 unique stages) of Base64, UTF-16LE PowerShell-EncodedCommand,zlib/gzipstreams,\xNNescapes, andfromhex(...)strings before re-scanning inner stages with YARA, IoC, and script analyzers.Static Document, Legacy OLE2, PDF & Smuggling Triage (
IOC-207..IOC-209): Analyzes OOXML.docx/.docm/.xlsx/.xlsm/.pptx/.dotmand legacy OLE2 CFBF.doc/.xls/.ppt/.msicontainers (IOC-207) for VBA macro storage, external.relsattached template URLs, and DDE execution, PDFs with#XX-unescaped/JavaScript//OpenAction//Launch//EmbeddedFile(IOC-208), and Windows.lnkshortcuts,.hta, and.svgsmuggling payloads (IOC-209).Pure-Python PE/ELF/Mach-O, Entropy & Script Analyzer (
IOC-201..IOC-206): Audits magic-byte/extension masquerading (IOC-202), RWX sections/executable stacks/packer section hints (IOC-203), section & whole-file Shannon entropy (IOC-201), risky PE injection imports, Imphash & ELF memfd/ptrace symbol clusters (IOC-204), ASLR/NX/timestamp/overlay hygiene (IOC-205), and obfuscated script/dropper chains (IOC-206).STIX 2.1 IoC Extractor (
IOC-301..IOC-304): Extracts printable ASCII/UTF-16LE strings and refanged observables ([.],hxxp://), suppresses version-number and private/loopback IP noise, matches STIX 2.1 / JSON / CSV / TXT feeds, and detects.onion/ raw-IP downloader or socket persistence indicators.Bounded Archive & 7z/RAR Header Scanners (
IOC-401..IOC-404): Inspects.zip/.jar/.whland.tar/.tar.gz/.tgzstrictly in memory while blocking Zip Slip traversal (IOC-401), Zip Bombs exceeding size/ratio/member caps (IOC-402), flagged or deeply nested payloads (IOC-403), and pure-Python.7z/RAR4/RAR5 AES encryption evasion or dangerous executable entries (IOC-404).Continuous Watch Daemon, Enterprise Policy (
IOC-501) & Multi-Format Output: Runswatchincremental filesystem monitoring with deduplicated Schema v1 SIEM NDJSON (--siem-out), HTTPS webhooks (--webhook-url), and live Prometheus/metrics+/healthzHTTP telemetry (--metrics-addr), alongside fail-closed.iocscan.ymlwaivers, custom regex rules (IOC-501), deterministic baselines, and ANSI-sanitizedtable,json,sarif2.1.0,markdown, andndjsonreports.14 CLI Subcommands & 10-Tool Stdio MCP Server: Exposes parallel
ThreadPoolExecutorscans and targeted triage tools over line-bounded (2 MiB) JSON-RPC 2.0 MCP stdio (raksa_iocscan-0.3.0-py3-none-any.whl:105,643bytes).
Related MCP server: Reverence
Architecture
+--------------------------------------------------------------------------------+
| raksa-iocscan CLI / MCP / CI |
| scan | scan-yara | watch | check-hash | diff-allowlist | inspect-binary |
| inspect-document | decode-payload | extract-iocs | hash-manifest | verify-yara |
+--------------------------------------------------------------------------------+
| | | | |
v v v v v
+-----------+ +-----------+ +-----------+ +-----------+ +-----------+
|hash_engine| |yara_engine| |static_ | |doc & | |ioc & |
|SHA256/Imp | |Prefilter +| |analyzer | |deobf | |archive |
|FastCDC/TI | |Cache/pe. | |PE/Auth/Fat| |OOXML/OLE2/| |STIX/Zip/ |
|Diff | |AST/yara-x | |ELF/Mach-O | |PDF/B64/Z | |Tar/7z/RAR |
+-----------+ +-----------+ +-----------+ +-----------+ +-----------+
|
v
+-------------------------------------------------------------------+
| scanner.py / watcher.py (ThreadPoolExecutor, --siem-out, /metrics)|
| policy.py (.iocscan.yml fail-closed waivers, IOC-501, baselines) |
| schema.py (Finding v1 + Posture 0-100) -> report.py |
+-------------------------------------------------------------------+See docs/architecture.md and docs/threat-model.md for component design and defensive bounds.
Installation
From Source / pip / uv
Requires Python 3.11 or newer (pyproject.toml declares zero mandatory runtime dependencies):
pip install --no-deps .Optional extras (PyYAML for full YAML spec features, yara-x for native YARA acceleration, pytest for tests):
pip install -e ".[yaml,yara,dev]"Or with uv:
uv tool install .Container Image (Non-Root python:3.12-slim)
docker build -t raksa-iocscan:v0.3.0 .
docker run --rm -v "$PWD:/workspace:ro" raksa-iocscan:v0.3.0 scan --path /workspace --fail-on low --format tableQuick Start
Unified Scan, Watch Daemon, YARA Cache, Allowlist Diff, Binary & Document Triage
# Verify clean fixture baseline (exit code 0, score 100/100 A+)
raksa-iocscan scan testdata/clean --fail-on low --format table
# Scan artifacts with custom YARA rules (cached to JSON), hash DB, IoC feed, and SARIF 2.1.0 output
raksa-iocscan scan testdata/suspicious \
--rules examples/custom-rules.yar \
--rules-cache .iocscan-rules.cache.json \
--hash-db examples/sample-ioc-feed.json \
--ioc-feed examples/sample-ioc-feed.json \
--format sarif \
--output iocscan.sarif
# Start continuous incremental watch daemon with SIEM NDJSON export and Prometheus /metrics
raksa-iocscan watch --path ./uploads --interval 2.0 \
--siem-out ./siem-alerts.ndjson \
--metrics-addr 127.0.0.1:9108
# Check a SHA-256 hash online against built-in MalwareBazaar adapter (hash-only query, 6h TTL cache)
raksa-iocscan check-hash --sha256 <64-hex-sha256> --online --online-provider malwarebazaar
# Validate YARA syntax cleanly and populate rule cache before deployment (exit 0 valid, exit 1 syntax error)
raksa-iocscan verify-yara --rules examples/custom-rules.yar --rules-cache .iocscan-rules.cache.json
# Generate and diff a SHA-256 allowlist manifest for release or host drift
raksa-iocscan hash-manifest --path ./release-dir --output allowlist.json
raksa-iocscan check-hash --path ./release-dir --allowlist allowlist.json --fail-on medium
raksa-iocscan diff-allowlist --path ./release-dir --allowlist allowlist.json --fail-on low
# Inspect PE/ELF/Mach-O/Fat headers, Authenticode DER, Imphash, FastCDC fuzzy hash, and entropy
raksa-iocscan inspect-binary --path testdata/suspicious/masquerade.pdf
# Inspect OOXML documents, legacy OLE2 (.doc/.xls), PDFs, LNK shortcuts, HTA, or SVG smuggling payloads
raksa-iocscan inspect-document --path ./invoice.doc --format json
# Statically unwrap nested Base64/UTF-16LE/zlib/hex stagers without execution
raksa-iocscan decode-payload --path ./suspicious_script.ps1 --format json
# Extract deduplicated public IP/domain/URL/hash observables as JSON
raksa-iocscan extract-iocs --path testdata/suspicious/suspicious_dropper.sh --observablesObserved output on testdata/clean:
raksa-iocscan v0.3.0 | layer: ioc-defense | score: 100/100 (A+) | total: 0 (critical: 0, high: 0, medium: 0, low: 0, info: 0)
No IoC or malware indicators detected.Subcommand Reference (14 Subcommands)
Subcommand | Purpose | Key Flags |
| Run unified hash, Imphash/fuzzy, YARA, static binary/Authenticode/Fat, doc, deobf, IoC, archive, policy scan |
|
| Scan paths using built-in and/or custom YARA rules ( |
|
| Continuously monitor paths and emit deduplicated SIEM NDJSON, webhooks, and |
|
| Verify files, directories, or a |
|
| Compare directory, file, or newer manifest against SHA-256 allowlist baseline ( |
|
| Inspect PE/ELF/Mach-O/Fat headers, Authenticode DER, Imphash, fuzzy hash, entropy, masquerading |
|
| Inspect OOXML/OLE2 macros/templates/DDE, PDF active objects, LNK, HTA, SVG |
|
| Statically decode nested Base64, UTF-16LE, zlib/gzip, and hex payloads and re-scan |
|
| Extract IP/domain/URL/hash observables or evaluate STIX/JSON/CSV IoC feeds |
|
| Generate deterministic SHA-256 allowlist JSON manifest |
|
| Validate |
|
| List all 27 built-in |
|
| Launch stdio JSON-RPC 2.0 MCP server (10 tools) | reads stdin / writes stdout |
| Print tool, schema version ( |
|
Exit Codes
Exit Code | Meaning |
| Clean run or no remaining findings meet/exceed |
| CLI usage, file I/O, YARA syntax, online feed validation, or |
| Detection gate breached ( |
Rule Catalog (IOC-001 to IOC-501)
Rule ID | Module | Default Severity | Standard | MITRE D3FEND | Title |
|
|
| NIST SP 800-83 |
| Cryptographic hash matches known malware blocklist |
|
|
| NIST SP 800-83 |
| Cryptographic hash matches threat watchlist or online intel feed |
|
|
| CIS Controls v8 2.5 |
| File missing from expected cryptographic allowlist manifest |
|
|
| MITRE ATT&CK / Variant Intel |
| PE Imphash or FastCDC fuzzy hash matches known malware family |
|
|
| MITRE ATT&CK / DFIR |
| Critical YARA rule match detected |
|
|
| MITRE ATT&CK / DFIR |
| High-severity YARA rule match detected |
|
|
| MITRE ATT&CK / DFIR |
| Suspicious YARA heuristic or informational signature matched |
|
|
| OWASP MASVS / Binary Triage |
| High Shannon entropy indicates packed, encrypted, or obfuscated binary |
|
|
| CWE-434 / MIME Integrity |
| Executable file magic masquerading behind non-executable extension |
|
|
| CIS / Exploit Mitigation |
| Binary exposes RWX memory section, executable stack, or packer marker |
|
|
| CWE-94 / Binary Triage |
| Binary imports high-risk process injection or loader API cluster |
|
|
| CIS Build Hardening |
| Binary lacks DEP/ASLR hardening, carries anomalous timestamp, or large overlay |
|
|
| MITRE ATT&CK T1059 |
| Obfuscated script or encoded remote dropper execution chain detected |
|
|
| MITRE ATT&CK T1566 / T1204 |
| OOXML or legacy OLE2 document contains VBA macro storage, external template link, or DDE trigger |
|
|
| MITRE ATT&CK T1566 / T1059 |
| PDF document embeds active JavaScript, Launch, OpenAction, or embedded executable |
|
|
| MITRE ATT&CK T1204 / T1027 |
| LNK shortcut, HTA, or SVG smuggling payload embeds command or script execution |
|
|
| MITRE ATT&CK T1140 |
| Multi-stage static deobfuscation uncovered hidden malicious payload |
|
|
| MITRE ATT&CK T1553 / Code Signing |
| PE Authenticode signature anomaly or unsigned/tampered Mach-O slice detected |
|
|
| STIX 2.1 Threat Intel |
| Artifact embeds IPv4/IPv6 indicator matching malicious IoC feed |
|
|
| STIX 2.1 Threat Intel |
| Artifact embeds domain or URL matching malicious IoC feed |
|
|
| MITRE ATT&CK T1105 |
| Suspicious raw-IP download or anonymizing .onion URL embedded |
|
|
| MITRE ATT&CK T1059 / T1053 |
| Embedded reverse-shell or persistence command indicator detected |
|
|
| CWE-22 |
| Archive contains Zip Slip path traversal entry |
|
|
| CWE-409 |
| Archive triggers decompression bomb size or compression ratio guard |
|
|
| NIST SP 800-83 |
| Archive encloses suspicious executable, nested limit breach, or IoC match |
|
|
| NIST SP 800-83 / CWE-409 |
| 7z or RAR archive embeds encrypted payload evasion, executable entry, or unsafe path |
|
|
| Enterprise Custom Policy |
| Custom organization IoC policy rule violation detected |
Enterprise Policy (.iocscan.yml)
raksa-iocscan discovers .iocscan.yml / .iocscan.yaml / .iocscan.json inside the scan root or loads --policy <file>. Waivers fail closed unless they specify both an audit reason and a future expires_on date:
min_severity: low
max_file_size_mb: 50
entropy_threshold: 7.3
exclude_globs:
- "*.log"
- "dist/*"
suppressions:
- rule_id: "IOC-205"
target_contains: "legacy/signed_helper.exe"
reason: "Signed legacy internal helper binary pending vendor rebuild"
expires_on: "2027-12-31"
custom_rules:
- id: "ORG-TEST-001"
title: "Disallow unapproved staging marker in production bundle"
severity: medium
pattern: "INTERNAL_STAGING_ONLY"
path_glob: "*.txt"
remediation: "Strip internal staging markers prior to release."See examples/iocscan-policy.yml, examples/custom-rules.yar, and examples/sample-ioc-feed.json.
MCP Server Integration (raksa-iocscan mcp)
Connect IDE or AI security workflows directly to raksa-iocscan over line-bounded (2 MiB) stdio JSON-RPC 2.0:
{
"mcpServers": {
"raksa-iocscan": {
"command": "raksa-iocscan",
"args": ["mcp"]
}
}
}Registered MCP tools (10):
iocscan_list_rules: Return catalogedIOC-*rules (optionally filtered by module).iocscan_scan_path: Run unified parallel IoC, YARA (with optionalrules_cache_path), hash/Imphash/fuzzy reputation, static PE/ELF/Mach-O/Authenticode, document, deobfuscator, archive, and policy scans (with optionalonline_provider).iocscan_scan_yara: Scan a path or inline UTF-8 text with built-in and/or custom YARA rules (builtinoryara-x, optionalrules_cache_path).iocscan_check_hash: Verify files, directories, or a direct SHA-256 hex digest against local hash/variant DBs, allowlists, or cached HTTPS providers (custom,malwarebazaar,threatfox,circl-nsrl,virustotal).iocscan_diff_allowlist: Compare a live directory, file, or newer manifest against a SHA-256 allowlist baseline (added,removed,modifieddrift ->IOC-003).iocscan_inspect_binary: Return detailed PE/ELF/Mach-O/Fat headers, Authenticode DER signer metadata, Imphash, FastCDC fuzzy hash, sections, imports, hardening, entropy, and script findings.iocscan_decode_payload: Statically decode nested Base64, UTF-16LE, zlib/gzip, and hex payloads and inspect decoded stages for hidden threats.iocscan_inspect_document: Statically triage Office OOXML (.docx/.docm/.xlsx/.pptx), legacy OLE2 (.doc/.xls/.ppt), PDFs,.lnkshortcuts,.hta, and.svgsmuggling payloads.iocscan_extract_iocs: Extract deduplicated public IPs, domains, URLs, and hashes from files or inline text with optional STIX/JSON/CSV feed matching.iocscan_verify_yara: Validate.yar/.yarafile, directory, or inline rule syntax before use.
Measured Performance (v0.3.0)
Benchmarks measured on windows/amd64 (Python 3.11.9, 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz) against v0.3.0 (raksa_iocscan-0.3.0-py3-none-any.whl: 105,643 bytes, zero dependencies):
Benchmark / Workload | Latency | Throughput |
Streaming Multi-Hash ( |
|
|
Pure-Python FastCDC Fuzzy Hash ( |
|
|
Pure-Python YARA ( |
|
|
|
|
|
Pure-Python YARA Prefilter ( |
|
|
Static OOXML Inspection ( |
|
|
Static OLE2 CFBF Inspection ( |
|
|
Live CLI MCP Stdio 50-Call Burst ( |
|
|
Live CLI MCP Stdio 50-Call Burst ( |
|
|
Live CLI MCP Stdio 50-Call Burst ( |
|
|
Scope & Boundaries
raksa-iocscan is designed for fast static artifact triage, CI/CD defense, continuous directory watch streaming, and AI-assisted DFIR workflows:
All inspection is strictly static and non-executing; it covers host/CI files, PE/Authenticode/ELF/Fat Mach-O binaries, OOXML/OLE2/PDF/LNK/HTA/SVG documents, multi-stage decoded scripts, and ZIP/TAR/7z/RAR containers without acting as a kernel-level EDR driver or running samples inside a dynamic sandbox.
Note that pure-Python 7z/RAR header inspection flags encryption evasion and unsafe paths/executables without bundling external LZMA2/RAR proprietary decompression binaries, and ASN.1 DER Authenticode inspection validates certificate structures and digest strengths deterministically offline rather than contacting external CA CRL/OCSP responders.
The built-in pure-Python YARA engine supports literal anchor prefiltering,
$id at/in,pe.*,elf.*,math.entropy(), hex/regex rules, and fingerprint-verified--rules-cacheJSON persistence with zero C extensions; teams needing full native C-compiled YARA module coverage can optionally installyara-x(--yara-engine yara-x).Online threat intel queries (
--online) andwatch --webhook-urlenforce HTTPS validation; online hash lookups transmit cryptographic hashes only, never raw files. See docs/architecture.md and docs/threat-model.md for resource bounds.
Raksa Security Suite
raksa-iocscan shares Raksa Finding Schema v1 (schema_version = "1.0") across the modular Raksa ecosystem:
Layer 1 (
network-defense): raksa-netguard (Go) - Exposed port audit and real-time firewall/log anomaly detection.Layer 2 (
host-hardening): raksa-hostguard (Rust) - Signed parallel SHA-256 FIM, Linux/SSH/Docker CIS hardening, and MCP server.Layer 3 (
web-defense): raksa-webshield (TypeScript + Go) - Web & API security auditor, semantic SQLi/XSS WAF sidecar, TypeScript SDK, and MCP server.Layer 4 (
devsecops): raksa-pipeguard (Go) - Secret/diff scanner, CycloneDX & SPDX SBOMs, OSV/KEV/EPSS SCA, container tarball auditor, IaC/CI linters, and MCP server.Layer 5 (
ioc-defense):raksa-iocscan(Python) - This repository.Layer 6 (
observability-siem, planned):raksa-siem(Python + Go) - Log normalizer, correlation engine, and alert router.
License
MIT License. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Static MCP server scan: injection, secrets, tool poisoning. SARIF + rules catalog.
Enrich, search, assess, and manage threat intelligence through 80+ typed MCP tools.
Scan AI agent skills, MCP server packages and MCP configs before you install them. Static analysis.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceMCP-native agentic threat investigation server that investigates IOCs across multiple threat intelligence sources, correlates findings to detect campaigns, and outputs STIX 2.1 bundles.1-
- AlicenseAqualityCmaintenanceGives MCP clients such as Claude Code and OpenCode a static-analysis toolbox for binaries, executables, DLLs, shared objects, and web-app code, covering file identification and hashing, string extraction, PE/ELF/Mach-O/WASM parsing, disassembly, Ghidra decompilation, YARA scanning, and JavaScript deobfuscation. All inspection is read-only and never executes the target.16MIT
- AlicenseNot gradedqualityBmaintenanceEnables an agent or MCP client to scan MCP server configs and AI-agent tool manifests on demand, exposing tools that list detection rules and report hidden prompt injections, data-exfiltration attempts, embedded secrets, deceptive Unicode, unpinned packages and shell-launching tools. Each finding comes with a severity and location so risky tool descriptions can be caught before an attacker exploits them.1Apache 2.0
- AlicenseBqualityCmaintenanceThis MCP server lets an agent run local binary inspection on ELF, Mach-O, PE, APK, IPA, ASAR, WebAssembly, and firmware targets — pulling symbols, sections, classified strings, disassembly, and mitigation posture, and flagging dangerous imports and CWE patterns. It exposes eight stdio JSON-RPC tools (with no external API keys) that feed a multi-agent swarm for attack-surface mapping and exploit-chain synthesis.12MIT