binary-sentinel

Sentinel · security scanner

binary-sentinel

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

npm i -D @mrlouiswright/binary-sentinel

Published to GitHub Packages: add @mrlouiswright:registry=https://npm.pkg.github.com to .npmrc first (installing needs a token with read:packages).

What it checks

  • packer-sectionSection names of UPX, ASPack, PECompact, MPRESS, NsPack, Themida/WinLicense, VMProtect, Enigma, Petite, FSG, MEW, Obsidium and more
  • packer-signaturePacker/protector strings (UPX!, PECompact2, ConfuserEx…)
  • rwx-sectionWritable + executable section or LOAD segment
  • entrypoint-anomalyEntry point outside every section, in a non-executable section or in the last section
  • embedded-executableOverlay contains another PE/ELF or archive (droppers, installers)
  • injection-importsClassic injection API combinations (VirtualAllocEx + WriteProcessMemory + CreateRemoteThread, process hollowing…)
  • high-entropy-sectionExecutable section ≥ 7.2 bits/byte, or any section ≥ 7.6
  • dynamic-api-resolutionFewer than 15 imports including GetProcAddress/dlsym

Quick usage

CLI

npx binary-sentinel suspicious.exe
npx binary-sentinel ./samples --format json --json triage.json   # JSON includes full headers/sections/imports
npx binary-sentinel dist/ --profile hardening --fail-on high      # CI gate for your own binaries

API

import { parsePE, parseELF, triage, capabilities, entropy } from 'binary-sentinel';
import { readFileSync } from 'node:fs';

const pe = parsePE(readFileSync('sample.exe'));
pe.imphash; pe.sections.map((s) => [s.name, s.entropy]); pe.tlsCallbacks; pe.overlay;

const report = triage(['samples/'], { profile: 'triage' });

Every option is documented in the binary-sentinel docs.

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 }