Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 37 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,63 @@
# @hailbytes/asm-scope-parser

> Parses and normalizes attack surface scope definitions: IP ranges, CIDR, domains, wildcards, and exclusions.
> Parses and normalizes attack surface scope definitions: IP ranges, CIDR, domains, wildcards, and exclusions. Framework-agnostic, zero-dependency.

[![npm version](https://img.shields.io/npm/v/%40hailbytes%2Fasm-scope-parser.svg)](https://www.npmjs.com/package/%40hailbytes%2Fasm-scope-parser)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Bundle Size](https://img.shields.io/bundlephobia/minzip/%40hailbytes%2Fasm-scope-parser)](https://bundlephobia.com/package/@hailbytes/asm-scope-parser)

---

## What it does

Parse and normalize attack surface scope definitions from any source — bug bounty programs, penetration test briefs, ASM platforms. Handles IPv4/IPv6, CIDR ranges, domain wildcards, and exclusion rules. Zero dependencies.

---

## Install

```bash
npm install @hailbytes/asm-scope-parser
```

## Who Is This For

Pentesters, bug bounty hunters, and ASM platform engineers who need a reliable, framework-agnostic way to parse and validate scope definitions.
---

## API
## Quick Start

```ts
import { parseScope } from '@hailbytes/asm-scope-parser';

const scope = parseScope(['10.0.0.0/8', '*.example.com', '!192.168.1.0/24']);

scope.includes('10.1.2.3'); // true
scope.excludes('192.168.1.5'); // true
scope.toCIDR(); // string[]
scope.toJSON(); // NormalizedScope
// 1. Parse a mixed scope definition
const scope = parseScope([
'10.0.0.0/8',
'*.example.com',
'!192.168.1.0/24', // exclusion
]);

// 2. Check membership
scope.includes('10.1.2.3'); // true
scope.includes('192.168.1.5'); // false (excluded)
scope.excludes('192.168.1.5'); // true

// 3. Export
scope.toCIDR(); // string[] of all CIDR ranges
scope.toJSON(); // NormalizedScope object
```

---

## Who Is This For

Pentesters, bug bounty hunters, and ASM platform engineers who need a reliable, framework-agnostic way to parse and validate scope definitions from diverse sources.

---

## See Also

- [@hailbytes/sbom-diff](https://github.com/HailBytes/sbom-diff)
- [@hailbytes/phishing-template-linter](https://github.com/HailBytes/phishing-template-linter)
- [`@hailbytes/sbom-diff`](https://github.com/HailBytes/sbom-diff) — Diff CycloneDX/SPDX SBOMs
- [`@hailbytes/phishing-template-linter`](https://github.com/HailBytes/phishing-template-linter) — Lint GoPhish email templates
- [HailBytes Platform](https://hailbytes.com)

## Links

- [hailbytes.com](https://hailbytes.com)
---

*Part of the [HailBytes](https://hailbytes.com) open-source security toolkit.*
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hailbytes/asm-scope-parser",
"version": "0.0.1",
"version": "1.0.1",
"description": "Parses and normalizes attack surface scope definitions: IP ranges, CIDR, domains, wildcards, and exclusions. Framework-agnostic, zero-dependency.",
"type": "module",
"license": "MIT",
Expand All @@ -25,14 +25,18 @@
"url": "https://github.com/HailBytes/asm-scope-parser/issues"
},
"homepage": "https://hailbytes.com",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
"dist",
"README.md",
"LICENSE"
],
"scripts": {
"build": "tsc",
Expand Down
Loading