A fast dependency confusion recon tool that crawls JavaScript and source map files to extract NPM package names and checks if they exist on the public registry.
- Crawls a target URL and extracts all linked
.jsand.mapfiles - Parses
require()calls andnode_modules/references to extract package names - Checks each package against the NPM registry
- Flags packages that do not exist — potential dependency confusion targets
- Handles gzip, deflate, and brotli compressed responses
- Saves results to structured JSON and plain text output files
| Mode | Description |
|---|---|
| Wildcard Domain | Runs subfinder to enumerate subdomains, then crawls all of them |
| Single URL | Direct crawl of a single target URL |
| Subdomain List | Batch scan from a .txt file of subdomains |
| JS / Map List | Direct scan of a .txt file of JS or map file URLs |
pip install npmghostFrom source:
git clone https://github.com/alonebeast002/npmghost.git
cd npmghost
pip install .npmghost- Python 3.8+
chardetbrotli(optional, enables brotli decompression)subfinder(optional, required for wildcard mode)
| File | Content |
|---|---|
all_packages.txt |
All extracted package names |
all_urls.txt |
All discovered .js and .map URLs |
all_urls.json |
Same URLs in JSON format |
npm_ghost_results.json |
Full scan results with package name, version, status, and source URL |
For authorized security testing and bug bounty research only. Use on targets you have permission to test.
alonebeast002 — GitHub