Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

"Smiley is suspicious, Percy"

██████████▅▄▅▟███████████▇▆▇████▛▜▜▜██████████████▊▜██████████▛▀▘▔╵╵█████████▉▔▔▔ ╵▗██████
▊╴  ╵▀██████████╴   ╵▜█████████▍    ╵█████████████████████████╴    ▗█████████▎    ╶███████
█╴    ▐█████████▏    ▝█████████▋   ▂▄███████████████▛▀▀██████▋    ╷▟████████▉╴    ▗███████
█▅▁  ╷▃█████████▙▄▂╷▁▄██████████▅▄▟█████████▀▔ ▝▔╶▝▔     ▀████▇▆▅▆██████▛▀▘╵▅▇▆▆▇██████▛▛▀
████████▛▀▘▘▀▜██████████▘▔╵▔▘███████████████▅▃▃▃▄▄▅▆▇▆▅▃   ▜██████████╵    ▗█████████▘    
████████▋    ╶▜████████▉╴    ▐███████████████████████████▖  ▜▞▜██████▍     ▟████████▌     
████████▉╴    ▐█████████▁    ▗██▅▀▀██████████████████████▉ ╶▁▜▖▜████▀╷╷ ╷▂▅███████▜▀╴╷  ╷▂
█▛███████▇▅▅▄▆███▛███████▇▆▇▇██▉  ╶██████████████████████▉ ▜▞┱▁▖▔  ╶▐█████████▘╵  ╵▕▇█████
▉╴   ╵▐█████████╴    ▔█████████▌   ██████████████████████▉ ╷▜▇▞╴╴  ╶█████████▏     ▟██████
█╴    ╶█████████▎     ▜████████▌  ▃██▀▔▔▔▘▀▀▀▀▀▀▀▀▀██████╴ ▐╶╋▔╲   ▁████████▀╴    ╶███████
█▄╷  ╷▁▟████████▙▂╷╷╷▂█████████▙  ▖                  ▀▜██▙ ▕▘╴  ╺▄▅████▛▛▀╵╶▗▆▆▆▆▆████▛▛▀╵
████████▋╵╵▔▝▀██████████╴╵  ╵▀██▌▕▇╴ ▁     ▄▖          ▝▀▀   ╶╷━▇████▉╵    ╶█████████▔    
████████▊     ▐█████████╴    ╶██▋╵╶▛█▋▃▃▖ ▟██▖╻╷    ╷▃▖▅▆▇▍▗▆┘▗▎█████▋     ▗████████▋     
████████▊╴    ╶█████████╴    ╶███▊ ▗████┓▆███▙▁▜██▇▇██▐███▁▄▋ ▝▐███▛▀╴╷   ▁███████▛▘╷╷   ▁
╻▀▀▜▜████▙▅▄▄▅▆█▀▀▀▀▜▜███▆▅▅▆███▀┑         ▔▀▀▀  ▔▔▜█▇▇████▛▃▖▘▔▔  ╵▗▇███████▛▔╵   ╶▅█████
▊╴    ▝█████████╴     █████████▋ ╹    ╶╹╴    ▄▇▇▄ ╶▕███████▆█▇╴     ▐████████▍     ▐██████
█╴     ▜████████╴     ▐████████▌  ╷         ╴▐██▜▋╶▂▜██▟┹▝▃██▋      ████████▘╴     ▕██████
█▅▁╷  ╷▄▜███████▄▂╷  ▁▟████████▍╶╶╴           ╶╷╴╵ ▀▝██▘╶▕▀▀▘▗▄▃▃▄▄▟███▛▀▀▔╵╶▄▄▅▆▆▆███▛▀▀▔
████████▌╵   ▔▜████████▉╴▁▃▅▆▀▔               ╵╵╵╵ ╵▝▛▔ ╶ ╵╺╸▀████████╴     ▐████████▏    
████████▋     ╶█████████▛▘╵         ▗       ╶╌╴╵╶╵╶ ╵╷╷╴▗      ▔▀▜███▋      ▟███████▀     
▜███████▍ ▁▂▃▅▆████▛▛▀▔             ▐▙               ╵ ▅▉          ▝▜▅▄▃▂▁╷▂██████▘╵     ╷
╌▝▘▀▀▀▀▛▜▀██▜▀▘╴                     ▜              ▁▅██▘              ╵╵▔▀▀▛▘╷▁    ▗▇▇▇██
▋╴        ▔╵                          ╴           ▃▆███▛                     ╶╵▔▘╶╶┎▀█████
▊                                      ╶       ╶▆█████▛                            ▔ ▝████
▍╷   ╵                                  ╴╷╷╷    ▐████▛                                ▝▀▀▔
███▇▍                                    ╶╷╴     ████                                     
████▘                                    ╵▐      ███▍                                     

Smiley Is Suspicious (sis) is a document and container analyser that identifies malicious constructs across all supported formats, with native analysis per format family and full traversal of arbitrarily nested content. It produces grouped findings with evidence spans and is designed for interactive speed without trading away parser correctness.

A file submitted to sis is not assumed to be what its extension claims. Format is determined from content. Containers are unpacked and their contents analysed natively. A PDF embedding an OOXML file embedding an RTF document embedding an OLE macro is handled as a single analysis graph, not as isolated format passes.

Key goals:

  • Safety-first -- defensive parsing with strict resource budgets, bounded recursion, and no unsafe code. All inputs are assumed hostile.
  • Deterministic -- stable finding IDs, reproducible evidence spans, and consistent output across runs for the same input and options.
  • Fast triage, deep on demand -- low-cost detectors run by default; heavier decoding, dynamic analysis, and ML scoring activate with --deep.
  • Forensic-grade query -- interactive REPL with structured namespaces, predicate filtering, stream decoding, and object inspection.
  • Operator and pipeline ready -- JSON/JSONL/SARIF output, batch scanning, markdown reports, and campaign-level correlation.

What sis analyses

Supported formats

sis analyses the following formats natively. Nested content of any supported type is detected and analysed inline. Format is identified from content, not extension.

Format Extensions Native detector namespace
PDF .pdf pdf:*
HTML / HTA .html, .htm, .hta html:*, hta:*
RTF .rtf rtf:*
Office Open XML .docx, .xlsx, .pptx ooxml:*
OneNote .one one:*
MIME HTML .mht, .mhtml mht:*
OLE compound document .doc, .xls, .msg ole:*
Windows shortcut .lnk lnk:*
PE executable .exe, .dll, .scr pe:*
ELF executable (no fixed extension) elf:*
ISO / UDF image .iso file:*
Archive / ZIP .zip, .7z, .rar file:*
VBScript .vbs, .vbe (embedded) vbs:*

Where a format is submitted directly or extracted from a container, the same set of detectors applies. There is no distinction between a top-level file and a nested payload.

Attack surfaces

sis runs 60+ detectors across the following attack surfaces, producing 200+ distinct finding kinds:

Attack surface Examples
Format and container polyglot files, format-within-format nesting, magic byte conflicts, format masquerade, archive-within-archive delivery
PDF structure xref conflicts, incremental update chains, object shadowing, trailer inconsistencies, parser divergence
Actions and triggers OpenAction, AdditionalAction, Launch, GoToR, URI, SubmitForm, exportDataObject
JavaScript obfuscation (JSFuck, JJencode, fromCharCode chains), heap grooming, sandbox evasion, environment fingerprinting, runtime behaviour profiling via V8 sandbox
VBScript / scripting WScript shell calls, file write, network fetch, obfuscated string construction, C2 URL recovery
Office macros and OLE VBA macro detection, OLE stream GUID analysis, Equation Editor class abuse, objdata executable headers
Forms and XML AcroForm field abuse, XFA script extraction, XFA image payloads, XML entity expansion, external entity risk
Embedded and nested files executables, scripts, archives, remote templates, altChunk payloads, OneNote attachments
Streams and filters filter chain abuse, high-entropy payloads, JBIG2 decoder risk, nested decode anomalies, decompression bombs
Fonts Type 1 eexec analysis, TrueType/OpenType/WOFF vulnerability signatures, heap spray patterns, control flow storms, decompression bombs, external references
Images JPEG/JPEG2000/PNG/TIFF/JBIG2/CCITT header validation, decoder budget enforcement, steganographic payload indicators
Rich media SWF ActionScript detection, U3D/PRC 3D format analysis, embedded media
URIs obfuscation, phishing indicators, IDN homoglyphs, credential lure patterns, shortener redirect chains, DNS tunnel patterns, automatic trigger correlation
Passive render pipeline UNC/SMB credential leak paths, preview-triggered external fetch, render surface risk composites
Crypto and signatures short keys, quantum-vulnerable algorithms, certified document manipulation, shadow attacks
Content phishing invisible text overlays, image-only pages, annotation link spoofing, clipboard payload staging, OTP harvest pages
AI poisoning ActualText instruction injection, invisible retrieval-conditioned sleeper content, model tool-coercion directives

Findings are correlated into trigger/action/payload chains and composite scores. Multi-stage attack chains, supply chain indicators, cross-format nesting risks, and parser divergence are synthesised from cross-surface evidence. The composite graph spans format boundaries: a finding in a nested RTF payload can form a chain edge with the PDF trigger that delivered it.

All finding IDs, metadata fields, and semantics are documented in docs/findings.md.

Analysis pipeline

  1. Format detection -- content-based format identification from magic bytes, structural signatures, and MIME boundaries. Determines which parser and detector set to activate. Extension is used only as a hint.
  2. Parse and index -- format-specific parser builds a typed object or content graph. For PDF: dual-parser architecture (primary + secondary via lopdf) with xref resolution, structural views, and malformed-file recovery. Parser divergence is measured and reported. For container formats: nested content is extracted and each part queued for its own parse-and-index pass.
  3. Fast triage (default) -- low-cost detectors run per format family for rapid first-pass risk assessment. Typical triage completes in under 50ms per file.
  4. Deep analysis (--deep) -- activates stream decoding, JavaScript and VBScript static and dynamic analysis (V8 sandbox), font/image vulnerability scanning, entropy profiling, and nested container extraction with recursive analysis.
  5. Correlation -- chain synthesis links triggers, actions, and payloads into exploit chains across format boundaries. Composite findings aggregate cross-surface evidence with severity uplift rules.
  6. Output -- findings with evidence spans, reader-specific impact annotations (Acrobat, PDFium, Preview), and machine-readable or operator-facing formats.

Commands

Command Purpose
sis scan Primary detector pipeline for one file or batch paths
sis query Forensic query interface with interactive REPL
sis explain Detailed explanation for a specific finding
sis report Full markdown report generation
sis sanitize CDR strip-and-report for active content removal
sis sandbox Dynamic sandbox evaluation for extracted assets
sis stream Streaming chunk analysis with early-stop on indicators
sis correlate Campaign-level network intent correlation from JSONL
sis generate Test fixture mutation and YARA rule generation
sis doc Print bundled documentation (agent query guide)
sis ml ML runtime configuration, detection, and baseline computation
sis config Configuration initialisation and validation
sis update Self-update from GitHub releases

Typical workflows

sis accepts any supported format directly — format is detected from content, not extension.

# Fast triage — any supported format
sis scan suspicious.pdf
sis scan lure.docx
sis scan attachment.hta
sis scan dropper.lnk
sis scan payload.rtf

# Deep analysis with machine output
sis scan sample.pdf --deep --json

# Batch scan a mixed-format directory
sis scan attachments/ --dir --deep --format jsonl

# Explain a specific finding
sis explain sample.pdf <finding-id>

# Generate markdown report
sis report sample.pdf --deep -o report.md

# Query findings with predicate filtering
sis query sample.pdf findings --where "severity == 'High'" --format json
sis query sample.pdf findings.composite --format json

# Query findings across all format namespaces
sis query sample.pdf findings --where "kind starts_with 'rtf:'" --format json
sis query sample.pdf findings --where "kind starts_with 'ooxml:'" --format json

# Query structure and actions
sis query sample.pdf actions.chains --format json
sis query sample.pdf xref.deviations

# Interactive REPL (parse once, query many)
sis query sample.pdf
> findings.high
> actions.chains
> stream 8 0 --decode
> js
> :json
> findings --where "confidence == 'Certain'"

# Inspect a stream object
sis query sample.pdf stream 8 0 --decode
sis query sample.pdf stream 8 0 --raw --extract-to /tmp/streams

# Sanitise active content
sis sanitize sample.pdf --out clean.pdf --report-json report.json

# Generate YARA rules from findings
sis generate yara --kind js_obfuscation_heavy -o rules.yar

Build with OCR support

Build with one OCR feature profile at a time (ai-ocr-wasm or ai-ocr-native).

# Build sis with wasm-oriented OCR
cargo build -p sis --bin sis --features ai-ocr-wasm

# Run deep scan with runtime profile against OCR fixture
target/debug/sis scan crates/sis-core/tests/fixtures/actions/ocr-runtime-counter-pressure.pdf \
  --deep --runtime-profile --runtime-profile-format json
# Build sis with native OCR
cargo build -p sis --bin sis --features ai-ocr-native

# Run deep scan with runtime profile against OCR fixture
target/debug/sis scan crates/sis-core/tests/fixtures/actions/ocr-runtime-counter-pressure.pdf \
  --deep --runtime-profile --runtime-profile-format json

To exercise model-backed OCR (instead of fallback paths), set model paths before running sis scan:

export SIS_OCR_DETECTION_MODEL=/path/to/detection.rten
export SIS_OCR_RECOGNITION_MODEL=/path/to/recognition.rten

Notes:

  • ai-ocr-wasm and ai-ocr-native are mutually exclusive build features.
  • Runtime profile JSON includes OCR counters (ai_poisoning.ocr_ms) in OCR-enabled builds.

Installation

curl -fsSL https://raw.githubusercontent.com/michiel/sis-release/main/scripts/install.sh | sh

Custom install destination:

SIS_INSTALL_DIR=/opt/bin curl -fsSL https://raw.githubusercontent.com/michiel/sis-release/main/scripts/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/michiel/sis-release/main/scripts/install.ps1 | iex

Binary releases are published in Releases.

Native GUI

The native GUI package builds separately from the CLI:

cargo build -p sis-gui

On macOS and Windows, unsigned binaries may show platform trust prompts (Gatekeeper/SmartScreen) until signing is enabled in the release process.

Linux desktop metadata (entry + icon) can be installed with:

scripts/install_linux_desktop_entry.sh

Configuration

Default config path:

Linux:   ~/.config/sis/config.toml
macOS:   ~/.config/sis/config.toml
Windows: %APPDATA%\sis\config.toml

Initialise and validate:

sis config init
sis config verify

Example:

[logging]
level = "warn"

[scan]
deep = true
parallel = true

Updating

sis update

Include prereleases:

sis update --include-prerelease

Documentation

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages