Langsung ke konten
Skillpedia
Keamanan10k · #11972

offensive-dependency-confusion

Fungsinya

Skill ini adalah metodologi untuk menguji dependency confusion pada npm, PyPI, NuGet, dan ekosistem paket lainnya. Skill mencakup konfigurasi registry dan cara membuktikan risikonya dengan aman. Skill ditujukan bagi profesional keamanan dan pengembang yang memeriksa pengaturan paket mereka sendiri, dengan izin.

Kapan dipakai

  • ✓Saat Anda ingin memeriksa apakah nama paket privat Anda bisa diklaim di registry publik.
  • ✓Ketika build Anda mengambil paket dari registry publik dan privat, dan Anda ingin meninjaunya.
  • ✓Ketika Anda membutuhkan bukti konsep yang aman untuk temuan dependency confusion dalam tes yang sah.

Link skill

https://github.com/SnailSploit/Claude-Red/blob/main/Skills/supply-chain/offensive-dependency-confusion/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/supply-chain/offensive-dependency-confusion/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Kami punya izin untuk menguji pengaturan npm dan PyPI kami. Periksa apakah nama paket privat kami aman dari kebingungan.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill mencari nama paket internal, memeriksa pengaturan registry, dan memastikan nama kandidat belum diklaim di registry publik. Lalu ia menyiapkan bukti konsep yang aman yang hanya melaporkan callback, tanpa muatan berbahaya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Offensive Dependency Confusion and Namespace Attacks

Dependency confusion exploits a fundamental design tension in package managers: the need to resolve packages from multiple sources. When an organization maintains internal packages alongside public dependencies, the resolution logic becomes an attack surface. You exploit the gap between how developers intend packages to resolve and how package managers actually resolve them.

Alex Birsan's 2021 research demonstrated that this class of attack affected Apple, Microsoft, PayPal, Shopify, Netflix, Yelp, Tesla, and Uber, among others. The root cause -- preferring a higher-versioned public package over a lower-versioned private one -- remains exploitable wherever registry configuration is incomplete.

This skill provides ecosystem-specific exploitation techniques, safe PoC methodology, and comprehensive reconnaissance approaches for discovering internal package names during authorized engagements.

Quick Workflow

  1. Perform reconnaissance to discover internal/private package names used by the target.
  2. Identify the target's package ecosystems and registry configuration.
  3. Verify that candidate package names are unclaimed on the corresponding public registry.
  4. Prepare a safe PoC package with a DNS canary or HTTP callback and a high version number.
  5. Publish the PoC to the public registry with a clear security research description.
  6. Monitor the callback endpoint for execution confirmations from target infrastructure.
  7. Record callback metadata (hostname, username, CI flag, timestamp) as evidence.
  8. Remove the PoC package from the public registry after confirmation or engagement window closes.
  9. Document the full attack chain, impacted systems, and registry hardening recommendations.

Reconnaissance for Internal Package Names

Discovering what internal packages a target uses is the critical first step. You extract package names from every available artifact and signal.

Lock File Analysis

Lock files are the highest-fidelity source of internal package names. They list every resolved dependency with exact versions and, in some formats, the registry source.

# npm: package-lock.json reveals resolved URLs
# Internal packages often resolve to a private registry
cat package-lock.json | jq -r '
  .packages | to_entries[] |
  select(.value.resolved != null) |
  select(.value.resolved | test("registry.npmjs.org") | not) |
  .key
' | sed 's|node_modules/||' | sort -u

# yarn: yarn.lock includes registry URLs inline
grep -B1 'resolved "https://registry.yarnpkg.com' yarn.lock | \
  grep -v 'resolved' | sed 's/@.*//' | sort -u > public_packages.txt
grep -B1 'resolved "https://' yarn.lock | \
  grep -v 'resolved' | grep -v 'yarnpkg.com' | grep -v 'npmjs.org' | \
  sed 's/@.*//' | sort -u > possibly_internal.txt

# pip: requirements.txt may reference internal packages
# Look for packages not found on public PyPI
grep -v '^#' requirements.txt | grep -v '^\s*$' | \
  sed 's/[>=<!\[].*//; s/\s*$//' | while read pkg; do
    code=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/$pkg/json")
    [ "$code" = "404" ] && echo "[INTERNAL] $pkg"
  done

# Pipfile.lock contains source information
cat Pipfile.lock | jq -r '.default | keys[]' > pipfile_packages.txt

JavaScript Source Maps

Production JavaScript bundles sometimes ship with source maps or readable module paths that reveal internal package names.

# Extract source map URLs from JavaScript bundles
curl -s https://target.example.com/app.js | \
  grep -oP '//# sourceMappingURL=\K.*'

# Download and parse source map for internal module paths
curl -s https://target.example.com/app.js.map | \
  jq -r '.sources[]' | grep -E 'node_modules/(@[^/]+/[^/]+|[^/]+)' | \
  sed 's|.*node_modules/||; s|/.*||' | sort -u

# Look for webpack chunk manifests
curl -s https://target.example.com/ | \
  grep -oP 'src="[^"]*chunk[^"]*"' | \
  sed 's/src="//;s/"//' | while read chunk; do
    curl -s "https://target.example.com/$chunk" | \
      grep -oP '"[a-zA-Z@][a-zA-Z0-9_./-]+"' | sort -u
  done

Error Messages and Stack Traces

Application errors leak internal package names in stack traces and module resolution failures. Trigger 404 pages, API errors, and debug endpoints.

curl -s https://target.example.com/nonexistent 2>&1 | \
  grep -oP 'Cannot find module .?\K[a-zA-Z@][a-zA-Z0-9_.-/]+'
# Also search Wayback Machine for cached error pages with module names

GitHub Rep

Pertanyaan umum

Apakah bukti konsep itu berbahaya?

Skill menyatakan agar memakai bukti konsep yang aman dengan callback dan tanpa muatan yang merusak.

Ekosistem apa saja yang dicakup?

Ia mencakup npm, PyPI, dan NuGet, dan juga menyebut ekosistem lain.

Apakah ini hanya untuk tes yang sah?

Ya. Skill ditulis untuk keterlibatan yang sah.

Detail

Deskripsi asli dari pembuat

Deep-dive offensive methodology for dependency confusion and namespace attacks across all major package ecosystems. Covers npm scope confusion exploiting the gap between public and private scoped packages and .npmrc misconfigurations where registry mappings fail to pin internal scopes exclusively. Addresses PyPI namespace attacks through --extra-index-url resolution ordering, NuGet feed priority exploitation when multiple package sources are configured without clear directives, Maven and Gradle repository ordering where artifact resolution traverses repositories sequentially, Go module proxy a

repo: SnailSploit/Claude-Red

Popularitas

Bintang GitHub
10k
Peringkat
#11972
Lisensi
MIT
Diperbarui
12/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa