Skip to content

🎯 Chrome Extension - Passive scanner for Dependency Confusion vulnerabilities in npm/PyPI packages

Notifications You must be signed in to change notification settings

KingOfBugbounty/Dependency-Confusion-Hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Dependency Confusion Hunter

Chrome Extension Manifest V3 Version License

πŸ” Passive Scanner for Dependency Confusion Vulnerabilities

Twitter YouTube


Automatically detect packages vulnerable to Dependency Confusion attacks while browsing


πŸ“‹ About

Dependency Confusion Hunter is a Chrome extension that passively monitors web pages for packages that may be vulnerable to Dependency Confusion attacks. It analyzes JavaScript files and source maps to identify internal/private dependencies that don't exist in public registries (npm, PyPI).

🎯 What is Dependency Confusion?

Dependency Confusion is a supply chain attack where an attacker publishes a malicious package to a public registry with the same name as an internal/private package. If the package manager isn't configured correctly, it may download the malicious public package instead of the private one.

// Example: Internal package that doesn't exist on npm
import { auth } from 'company-internal-auth';  // ⚠️ Vulnerable!

// An attacker can publish 'company-internal-auth' to npm
// and compromise systems that try to install it

⚑ Features

πŸ” Detection

  • βœ… Passive monitoring (no interference)
  • βœ… JavaScript file analysis
  • βœ… Source map (.map) parsing
  • βœ… NPM & PyPI registry checks
  • βœ… Scoped packages support (@scope/pkg)

πŸ› οΈ Tools

  • πŸ“Š Real-time dashboard
  • πŸ”” Browser notifications
  • πŸ’¬ Discord webhook alerts
  • 🌐 Proxy support (Burp Suite)
  • πŸ“ One-click command export

πŸš€ Installation

Method 1: Load Unpacked (Developer Mode)

# 1. Clone this repository
git clone https://github.com/KingOfBugbounty/Dependency-Confusion-Hunter.git

# 2. Open Chrome and go to
chrome://extensions/

# 3. Enable "Developer mode" (top right)

# 4. Click "Load unpacked"

# 5. Select the cloned folder

Method 2: Generate Icons (if missing)

python3 create_icons.py

πŸ”§ Configuration

Discord Webhook (Optional)

Receive instant alerts on Discord:

  1. Go to your Discord channel β†’ Settings β†’ Integrations β†’ Webhooks
  2. Create a new webhook
  3. Copy the webhook URL
  4. Paste in extension settings

Proxy Support (Optional)

Route traffic through Burp Suite or corporate proxy:

http://127.0.0.1:8080

πŸ“– How to Use

1️⃣  Install the extension
         ↓
2️⃣  Browse websites normally
         ↓
3️⃣  Extension analyzes JS files passively
         ↓
4️⃣  Get alerts for vulnerable packages
         ↓
5️⃣  Click extension icon to see results

🎯 Detection Patterns

NPM Packages

// All these patterns are detected:
require('package-name')
import x from 'package-name'
import('package-name')
import { x } from '@scope/package'
// References in node_modules/

Python Packages

# These patterns are detected:
import package_name
from package_name import x
pip install package-name

πŸ“Š Dashboard

πŸ“ˆ Statistics πŸ“‹ Vulnerability List βš™οΈ Actions
β€’ Total packages found
β€’ Files analyzed
β€’ Vulnerabilities count
β€’ Package name
β€’ Registry type (npm/pip)
β€’ Source URL
β€’ Copy package name
β€’ Copy npm publish cmd
β€’ Open registry

πŸ›‘οΈ Security & Ethics

βœ… Intended Use

  • Authorized penetration testing
  • Bug bounty programs
  • Security research
  • Educational purposes
  • CTF competitions

❌ DO NOT Use For

  • Unauthorized exploitation
  • Publishing malicious packages
  • Supply chain attacks
  • Compromising systems without permission

πŸ“ Project Structure

Dependency-Confusion-Hunter/
β”œβ”€β”€ manifest.json       # Extension configuration
β”œβ”€β”€ background.js       # Service worker (main logic)
β”œβ”€β”€ content.js          # Page content analyzer
β”œβ”€β”€ injected.js         # Injected script context
β”œβ”€β”€ popup.html/js       # Extension popup UI
β”œβ”€β”€ options.html/js     # Settings page
β”œβ”€β”€ styles.css          # Styles
β”œβ”€β”€ icons/              # Extension icons
β”‚   β”œβ”€β”€ icon16.png
β”‚   β”œβ”€β”€ icon48.png
β”‚   └── icon128.png
└── create_icons.py     # Icon generator script

πŸ› Troubleshooting

Problem Solution
No detections Check if site has JavaScript files
No notifications Check Chrome notification permissions
Discord not working Verify webhook URL is correct
Extension not loading Ensure Manifest V3 is supported

πŸ“š References


πŸ™ Credits

Developed by OFJAAAH

Twitter GitHub


⚠️ For authorized security testing only. Always obtain proper permission.

About

🎯 Chrome Extension - Passive scanner for Dependency Confusion vulnerabilities in npm/PyPI packages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published