剑庭安
首页
黑客安全首页全部安全栏目 黑客技术黑客技术、渗透测试、漏洞利用工具与教程 安全软件安全工具、扫描器、检测与审计软件 病毒分析恶意软件分析、样本、逆向与沙箱 CTF思路CTF 题目、writeup、解题思路与工具 防护思路防御技术、加固、检测响应与蓝队 红蓝攻防红队攻击模拟、蓝队对抗、攻防演练 漏洞知识库漏洞、CVE、PoC、EXP 与安全研究
逆向|反编译
PHP源码PHP 网站源码、程序、系统 APP源码安卓/iOS APP 源码 ASP源码ASP 网站源码与程序 NET源码.NET 网站源码与系统 小程序源码微信/支付宝小程序源码 Dedecms风格模板Dedecms 织梦风格模板 Empirecms风格模板EmpireCMS 帝国风格模板 Discuz商业模板/插件Discuz 商业模板与插件 WordPress主题/插件WordPress 主题与插件 其它源码、模板其它各类源码与模板 游戏源码游戏源码与引擎项目 加密货币源码加密货币、区块链、钱包、USDT/比特币相关源码与工具 手游源码手机游戏源码、服务端、客户端与引擎项目 传奇源码热血传奇、传奇世界、复古传奇等客户端/服务端/引擎源码 页游源码网页游戏、H5 游戏、浏览器游戏源码 端游源码电脑单机游戏、PC 网游客户端/服务端源码
最新万能免驱动支持所有型号打印机下载程序 日历天气老黄历 · 每天同步真实日期与天气
站长工具站长工具 自助开通会员浏览该分类 其他资源qtziy SEO工具SEO工具 站群源码站群源码 泛程序泛程序 蜘蛛模板蜘蛛模板 蜘蛛池蜘蛛池 外链工具外链工具
搜索 自助开通会员🔓 破甲 API
登录 注册
首页 分类列表 安全软件 npxconfuse - npx confusion v…
npxconfuse - npx confusion vulnerability scanner 安全软件 点击放大
作者:admin 发布:2026-10-05

npxconfuse - npx confusion vulnerability scanner

项目说明npxconfuse<p align="center"> <strong>npx Confusion Scanner</strong><br> <em>Find unclaimed npm package nam…
资源可下载 免费下载 0 条讨论
会员资源
开通会员后即可下载全部资源。
登录后开通会员
会员方案
315浏览量
0讨论
2下载链接
可下载资源状态
内容可验证
更新 2026-10-05
人工审核发布
评论区答疑

npxconfuse - npx confusion vulnerability scanner

项目说明

npxconfuse

<p align="center">
<strong>npx Confusion Scanner</strong><br>
<em>Find unclaimed npm package names in your supply chain before attackers do.</em>
</p>

<p align="center">
<a href="#license"><img src=" alt="License: MIT"></a>
<a href=" src=" alt="Node >= 18"></a>
</p>

---

> Based on the original research by Lupin & Holmes, presented at DEF CON 33.
>
> Read the full paper: npx Used Confusion and It's Super Effective
>
> This tool automates the discovery process described in that research — scanning local codebases, GitHub organizations, and web assets for unclaimed npm package names that are exploitable via npx confusion and dependency confusion attacks.

---

What It Detects

| # | | Se | Description |
|---|---------------|----------|-------------|
| 🔴 | npx Confusion | CRITICAL | An npx <name> in in your package.json scripts points to a package unclaimed on npm. An attacker can register that name and achieve RCE on every de and CI pipeline that runs your scripts. |
| 🔴 | Bin Mismatch | CRITICAL | A scoped package (/pkg) exposes a binary with a different, unscoped name that is unclaimed on npm. Since npm binaries cannot contain /, this mismatch is inherent to scoped packages. |
| 🟡 | Dependency Confusion | HIGH | Private/internal package names (enterprise-scoped packages, file: references) are not registered on the public npm registry. An attacker can publish a package with the same name and hijack installs. |
| 🟠 | Name Clash | MEDIUM | A used package name exists on the public registry but is owned by a different entity — potential typo-squatting or namespace collision worth in. |

The Attack in 30 Seconds

npxconfuse automates discovery of these unclaimed names across your entire codebase, GitHub organization, and public-facing web assets.

---

Installation

Requirements: Node.js >= 18

---

Quick Start

---

Usage

scan — Scan a Local Directory

What it scans:

  • package.json — scripts (npx in), bin field, dependencies
  • With --deep:

  • JS bundles (*.js, *.mjs, *.cjs) — parses require(), import, and embedded package.json blocks
  • What it skips:

  • node_modules/, .git/, dist/, build/, .next/, co/
  • github — Scan a GitHub Organization

    Token requirements:

  • Create a token at github.com/settings/tokens

  • Scope: repo (private repos) or public_repo (public repos only)
  • web — Scan Web Domains

    Probes each domain for:

  • Exposed /package.json, /package-lock.json

  • Ja bundles referenced in <script> tags
  • check — Direct Package Name Checking

    ---

    Output Formats

    | Format | Flag | Best For |
    |--------|------|----------|
    | Table (default) | -o table | Interacti use |
    | JSON | -o json | CI/CD pipelines, jq processing |
    | CSV | -o csv | Spreadsheets, data analysis |

    Table Output (default)

    JSON Output

    CS

    ---

    Options

    | Option | Description | Default |
    |--------|-------------|---------|
    | -o, --output <format> | Output format: table, json, csv | table |
    | -c, --concurrency <n> | Max parallel registry requests | 20 |
    | --timeout <ms> | HTTP timeout (milliseconds) | 10000 |
    | --save <filepath> | Sa to file (format auto-detected from extension) | — |
    | - | Enable debug logging | false |

    Scan-specific options:

    | Command | Option | Description |
    |---------|--------|-------------|
    | scan | --deep | Also parse JS bundles for imports/requires |
    | github | --max-repos <n> | Maximum repos to scan | 1000 |
    | github | --github-enterprise <url> | GitHub Enterprise base URL | — |

    ---

    Exit Codes

    | Code | Meaning |
    |------|---------|
    | 0 | No critical or high findings |
    | 2 | Critical findings detected (useful for CI/CD || exit pipelines) |

    ---

    : Setting Up a Callback Server

    Once npxconfuse identifies unclaimed package names, you'll want to whether those names are actually being pulled in real en. Simply claiming the name and publishing a package is not enough — you need to confirm that the package is being downloaded by real CI pipelines or de.

    Step 1: Set Up a Callback Server

    Publish a harmless package under the unclaimed name that phones home to a server you control. This lets you obser who is pulling the package and from where.

    Step 2: Deploy a Lightweight Callback Listener

    You can use a simple HTTP server, a webhook receiver, or services like:

  • Pipedream — Free tier, instant HTTP endpoints with logging

  • Webhook.site — Instant disposable endpoints, no setup needed

  • ngrok — Expose a local server to the internet

  • Your own VPS with a simple nc -l or Python HTTP server
  • Example with a one-liner netcat listener:

    Step 3: Monitor and Filter

    Watch your callback logs for incoming requests. Each hit represents a machine that ran npx my-internal-tool or installed the package.

    ---

    ⚠️ Important: Distinguishing Real Pulls from Bots

    When you publish a package to npm, you will see immediate download activity. Most of this is not from real targets — it comes from automated systems that mirror or analyze every new npm package.

    Common False Positi

    | Source | What It Is | Action |
    |--------|------------|--------|
    | npm CDN / mirror bots | Replication bots from jsDeli, etc. that cache every package | Ignore — these are not your targets |
    | Security scanners | Automated tools (Snyk, Socket.dev, etc.) that analyze every new publish | Ignore — they are not real installs |
    | Replication services | Third-party registries that mirror npm (e.g. npmmirror.com in China) | Ignore — these are mirrors, not targets |
    | npm's own download count | The download counter on npmjs.com includes all mirror/cache traffic | Do not trust download counts as proof |

    How to Identify Real Pulls

    Real pulls come from actual CI en and de machines. Look for these signals in your callback data:

    | Signal | Indicates |
    |--------|-----------|
    | 🟢 CI hostnames (e.g. github-runner-*, circleci-*, jenkins-*, gitlab-runner-*) | CI pipelines pulling the package |
    | 🟢 Corporate hostnames (matches the organization you're testing) | Internal de machines |
    | 🟢 Timing alignment — hits coincide with code pushes or scheduled builds | Genuine CI activity |
    | 🟢 De usernames in the callback path (from
    whoami) | Real de workstations |
    | 🟢 Non-standard user agents or IPs from corporate ranges | Authentic internal traffic |
    | 🔴 Immediate hits from IPs owned by Cloudflare/Fastly/CDN pro | Likely mirror bots |
    | 🔴 Hits at the exact same second as publish | Bots polling the registry feed |

    Recommended Approach

    1. Publish your probe package
    2. Ignore the first 24—48 hours of activity — this is predominantly bots and mirrors
    3. After the initial noise settles, look for patterns that match the target organization's:
    - IP ranges
    - Hostname con
    - CI provider
    - Working hours / timezone
    4. Only consider hits that correlate with known de activity (commits to repos, CI build triggers)

    ---

    How It Works

    Detection Logic

    1. Discovery — Finds package.json files and JS bundles glob, GitHub API, or HTTP probes
    2. Extraction — Parses each file with dedicated extractors:
    -
    package.json: npx in scripts, bin field, scoped dependencies with file:/workspace: references
    -
    JS bundles: embedded package.json blocks, require() calls, import statements
    3. Analysis — Deduplicates names across sources and queries the npm registry in parallel, classifying each name as unclaimed, claimed, private, or error
    4. Reporting — Formats results in the chosen output format with se coloring

    Se Classification

    Se is derived from the finding type, the registry status, and how
    npm resolves the dependency at install time.

    | Finding Type | Registry Status | Resolution | Se |
    |---|---|---|---|
    |
    npx-confusion | unclaimed | registry | 🔴 CRITICAL |
    |
    bin-mismatch | unclaimed | registry | 🔴 CRITICAL |
    |
    dependency-confusion | unclaimed | registry | 🟡 HIGH |
    |
    dependency-confusion | unclaimed | file: / link: | 🔵 LOW |
    |
    dependency-confusion | unclaimed | workspace: | ⚪ INFO |
    | Any |
    claimed | any | 🟠 MEDIUM |
    | Any |
    private | any | ⚪ INFO |

    Why resolution matters: only registry resolution can fall back to the
    public npm registry. The local protocols (
    workspace:, file:, link:,
    portal:) resol the local filesystem and fail closed when their
    target is missing — they ne the registry. An unclaimed name behind a
    local protocol is a hygiene issue, not an exploitable install-time .

    When a name is declared with more than one protocol across files, the riskiest
    protocol wins (e.g.
    workspace:* in one file and ^1.0.0 in another is
    treated as
    registry). Each finding reports both resolution (worst case) and
    resolutions (all observed).

    ---

    Real-World Scenarios

    Scenario 1: You run npx in your npm scripts

    npxconfuse detects both my-build-tool and the unscoped binary name of /custom-linter if they're unclaimed on npm.

    Scenario 2: You use private/internal packages

    If /internal-auth is not registered on the public npm registry, an attacker can publish a malicious package with the same name.

    Scenario 3: Your web app exposes its package.json

    If returns your production manifest, an attacker can extract your internal package names. npxconfuse web helps you find this exposure first.

    ---

    Research Background

    This tool operationalizes the class described by Lupin & Holmes in their DEF CON 33 research:

  • npx Used Confusion and It's Super Effective — The original paper
  • Key concepts from the research:

  • npx resolution flow: When npx <binary> cannot find a binary in ./node_modules/.bin/, it falls back to fetching from the public npm registry. If that name is unclaimed, an attacker can register it.

  • Scoped package mismatch: npm binaries cannot contain /, so /pkg must expose an unscoped binary name — creating a natural mismatch exploitable for package takeover.

  • Dependency confusion: If a private package name is not reserved on public registries, an attacker can publish a package with the same name and hijack the resolution chain.

  • Defense: Register placeholder packages for all internal names, use --yes/--no flags with npx, configure scope-to-registry mappings via .npmrc, and audit your package.json scripts for unregistered npx targets.
  • ---

    Contributing

    Contributions are welcome! Areas that particularly need help:

  • 🧪 Tests — unit and integration tests

  • 📦 Additional registries — RubyGems, NuGet, Maven, Docker Hub support

  • 🖥️ Windows — PowerShell script support and testing

  • 📊 SARIF output — GitHub Code Scanning integration

  • 🔍 Deeper JS parsing — AST-based extraction for more accurate import detection
  • De Setup

    ---

    License

    MIT — see LICENSE file.

    ---

    Security

    If you discover a in npxconfuse` itself, please open an issue or submit a PR responsibly. Do not publish the publicly before a fix is a.

    项目信息

    开发语言:JavaScript

    Star 数:17

    技术要点

    该项目属于安全软件方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕npx confusion vulnerability scanner展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。

    从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。

    使用与学习建议

    1. 下载源码压缩包,解压到本地环境。

    2. 根据项目类型准备对应的运行环境与依赖。

    3. 按照 README 中的步骤完成配置与部署。

    4. 在隔离的测试环境中运行验证,避免影响生产系统。

    免责声明

    本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。

    资源标题npxconfuse - npx confusion vulnerability scanner
    所属分类安全软件
    发布作者admin
    发布时间2026-10-05 22:55:48
    下载权限 免费下载
    附件数量2 个下载链接
    浏览次数315
    讨论数量0
    主题状态正常讨论中

    本资源免费,登录后即可在本页「下载链接」区域获取全部附件。

    请在评论区留言说明具体链接,或联系作者补档。楼主更新后本页会同步最新的下载地址。

    请先阅读正文中的授权说明;未注明的默认仅限站内学习交流,禁止直接搬运到其他站点二次售卖。
    还没有讨论,快来抢沙发~
    登录 后才能参与讨论
    下载链接
    会员才能下载
    登录后开通会员
    同分类推荐
    暂无同类资源
    免费登录即可下载
    查看会员
    放大预览

    © 2026 剑庭安 - 网站开发定制 SEO 优化蜘蛛池代做 在线看手相算命. 保留所有权利。

    Powered by 酷像SEOv3.0

    网站地图 Sitemap.xml
    首页 全部分类 黑客安全 逆向|反编译 精品源码 站长工具自助开通会员其他资源SEO工具站群源码泛程序蜘蛛模板蜘蛛池外链工具创意乐园 搜索 会员服务 登录 注册