GitHub Packages · MIT · Node ≥ 18

binary-sentinel

Static PE and ELF triage in pure JavaScript: headers, sections, entropy, imports, imphash, packer hints, capabilities and hardening checks.

Static PE/ELF triage in pure JS: headers, sections, entropy, imports, imphash, Rich header, overlays, TLS callbacks, packer hints (UPX, ASPack, VMProtect...), suspicious API capabilities mapped to ATT&CK, and hardening (ASLR, NX, CFG, PIE, RELRO, canary). Never executes samples. Zero deps.

  1. 1 Point the @mrlouiswright scope at GitHub Packages in .npmrc

    @mrlouiswright:registry=https://npm.pkg.github.com
  2. 2 Install

    npm i -D @mrlouiswright/binary-sentinel
Installing from GitHub Packages needs a token

Published to GitHub Packages, not npmjs.com. GitHub Packages needs a GitHub token with read:packages to install, even for public packages: add //npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} to .npmrc or run npm login --registry=https://npm.pkg.github.com.

~/project — zsh
$ npx binary-sentinel elf-weakbinary-sentinel — 1 target(s) elf-weak  type: elf  size: 12528  sha256: c322806afd5b93132330246f8f7ea123fd4d128c737b6c7f3b1c27a7689e2fb7  entropy: 1.734  format: ELF64 x86-64 executable  interpreter: /lib64/ld-linux-x86-64.so.2  needed: libc.so.6  importHash: b668c3a4d5308e402be5a46970c412ad  hardening: pie=false nx=false execStack=true relro=none bindNow=false canary=false fortify=false  sections: 30... 2 medium, 3 low, 1 info✔ Passing (fail-on: high).
Real output from running binary-sentinel locally on a test fixture.

Why it exists

binary-sentinel gives an analyst a quick first look at a Windows PE (EXE/DLL/SYS, 32- and 64-bit) or Linux/Unix ELF file without leaving the terminal or CI. The same parser can also check your own release binaries for missing hardening (ASLR, DEP/NX, CFG, PIE, RELRO, stack canaries). Samples are only ever read as bytes and are never executed or loaded.

CLI, library and GitHub Action. Node.js 18+, zero runtime dependencies, no native code.

Features

packer-section

Section names of UPX, ASPack, PECompact, MPRESS, NsPack, Themida/WinLicense, VMProtect, Enigma, Petite, FSG, MEW, Obsidium and more (default: high)

packer-signature

Packer/protector strings (UPX!, PECompact2, ConfuserEx…) (default: high)

rwx-section

Writable + executable section or LOAD segment (default: high)

entrypoint-anomaly

Entry point outside every section, in a non-executable section or in the last section (default: high)

embedded-executable

Overlay contains another PE/ELF or archive (droppers, installers) (default: high)

injection-imports

Classic injection API combinations (VirtualAllocEx + WriteProcessMemory + CreateRemoteThread, process hollowing…) (default: high)

high-entropy-section

Executable section ≥ 7.2 bits/byte, or any section ≥ 7.6 (default: medium)

dynamic-api-resolution

Fewer than 15 imports including GetProcAddress/dlsym (default: medium)

Usage

# Example

 npx binary-sentinel suspicious.exe

# JSON includes full headers/sections/imports

 npx binary-sentinel ./samples --format json --json triage.json

# CI gate for your own binaries

 npx binary-sentinel dist/ --profile hardening --fail-on high

CI / GitHub Action

permissions:
  contents: read
  security-events: write   # only for the SARIF upload
steps:
  - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
    with: { persist-credentials: false }
  - uses: MrLouisWright/binary-sentinel@v1
    with:
      targets: 'dist/'
      fail-on: high
      sarif: binary-sentinel.sarif
  - uses: github/codeql-action/upload-sarif@v3
    if: always()
    with: { sarif_file: binary-sentinel.sarif }

Options & flags

FlagDescription
--profile <p>triage (default: packers, capabilities, anomalies) | hardening (ASLR/NX/RELRO/PIE/canary as high)
--detailsInclude full parsed headers, sections and imports in JSON output
Policy and output
-c, --config <file>JSON config (default .binary-sentinel.json if present)
-f, --format <fmt>text (default) | json | sarif | markdown
--json/--sarif/--markdown <file>Also write that format to a file
--fail-on <sev>critical | high | medium | low | info | none (default high)
--list-rulesPrint rules and default severities
--no-colorDisable colours

Full reference, config file format and API in the README.

Support this project

Support open-source security tools

I build free, open-source tools that help developers ship safer websites. Every coffee helps keep them maintained, documented and free for everyone.

Buy me a coffee (opens Stripe in a new tab)

Secure checkout by Stripe

Portrait of Louis Wright

About the author

Louis Wright

Cyber security researcher and software engineer based in the UK.

More tools by Louis Wright

58 tools

Sentinels security scanners & CI gates · 19