npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@farksecurity/phish-signals

v0.2.1

Published

Heuristic phishing-detection engine: URL/domain typosquat and homograph checks, SPF/DKIM/DMARC-aware header analysis, Received-chain spoofing checks, IOC defang/refang, MITRE ATT&CK mapping, Sigma rule generation, and parsing for raw .eml/.msg messages pl

Readme

@farksecurity/phish-signals

This is the TypeScript implementation. See the repo root for the Python port and the conformance suite the two are checked against.

Heuristic phishing-detection engine, extracted from farksecurity.com's phish-report tool: URL/domain typosquat and homograph checks, SPF/DKIM/DMARC-aware header analysis, Received-chain spoofing checks, IOC defang/refang, MITRE ATT&CK mapping, Sigma rule generation, and parsing for raw .eml/pasted messages, Outlook .msg files, and embedded QR codes. No network calls, no external API keys — everything runs locally on data you already have.

Install

npm install @farksecurity/phish-signals

Quick start

import { parseEmail, checkUrls, checkAuthentication, combineResults } from '@farksecurity/phish-signals';

// A single URL, no email context needed.
const [result] = checkUrls(['http://paypa1-secure.tk/login']);
console.log(result.risk, result.detail);
// 'malicious', 'Closely resembles "paypal.com" (likely typosquat)'

// A full raw .eml or pasted message.
const raw = [
  'From: CEO <[email protected]>',
  'Authentication-Results: mx.example.com; spf=fail; dkim=fail; dmarc=fail',
  '',
  'Click http://paypa1-secure.tk/login to verify.',
].join('\r\n');

const parsed = await parseEmail(raw);
console.log(checkAuthentication(parsed.headers, parsed.headerLines).signals.map((s) => s.id));
// [ 'dmarc_fail', 'spf_fail', 'dkim_fail' ]

Every check takes plain data and returns Signal[]-bearing results ({ id, category, severity, label, detail, mitre?, benign? }) rather than a raw numeric score — see the Signal/EvidenceCategory/Severity types. The checks below don't need parseEmail at all if you already have structured data (a URL string, a header-lines array) from elsewhere.

What's included

  • URL/domain analysis (checkUrls, checkTyposquat, brandImpersonation, isIpLiteral) — typosquatting, brand impersonation, IP-literal links, dangerous extensions, URL shorteners, and more, scored per URL.
  • Punycode / homograph detection (describeHostname, decodeHostname, isWholeScriptConfusable) — a hand-written RFC 3492 decoder distinguishing mixed-script and whole-script-confusable homograph domains from ordinary internationalized domains.
  • Header analysis (checkAuthentication, checkHeaderAnomalies, analyzeReceivedChain) — SPF/DKIM/DMARC parsing (including a structural check against forged trailing Authentication-Results headers), thread-hijack detection, and Received-chain HELO/reverse-DNS spoofing checks.
  • Attachment/content checks (checkAttachments, checkContent, checkLinkText, checkDangerousSchemes) — dangerous extensions (including inside a ZIP's central directory), double extensions, MIME/extension mismatches, urgency language, link-text/href mismatches.
  • Scoring (scoreSignals, assessConfidence, MAX_CATEGORY_SCORE) — combines signals across categories so correlated findings don't stack, and no single category dominates.
  • Analyst output (extractIocs/defang/refang/parseIocText, mapTechniques, buildSigmaRule, buildKqlQuery, buildRecommendations, buildJsonExport) — defanged IOC lists (from a parsed email, or from freeform pasted text via parseIocText), MITRE ATT&CK technique mapping, generated Sigma detection rules, Microsoft 365 Defender / Sentinel Advanced Hunting KQL queries, and prioritized next-step recommendations.
  • Parsing (parseEmail, msgToRawEmail, scanImagesForQrCodes) — turns a raw .eml, pasted message, or Outlook .msg file into the structured shape every check above consumes, plus bounded QR-code decoding for embedded/attached images. This is the one part of the package with real runtime dependencies (mailparser, @kenjiuno/msgreader, jsqr, pngjs, jpeg-js) — everything above it is plain data in, plain data out.
  • Input handling (sanitizeInput, stripDangerousUnicode, parseHeaderText) — control-character stripping, RTLO/zero-width-character removal, and a lightweight parser for raw pasted header blocks (for when you have headers but not a full message).

Status

Extracted and open-sourced from an in-production tool, and now developed here in its own right rather than synced out of another repo. The same heuristics also ship inside farkwebsite's phish-report tool, but the two copies evolve independently and are not kept in lockstep, so pin a version rather than assuming score/verdict output is stable across releases.

License

MIT