Перейти к содержанию
Skillpedia
Безопасность10k · #11972

offensive-dependency-confusion

Что он делает

Этот скилл представляет собой методику проверки подмены зависимостей в npm, PyPI, NuGet и других экосистемах пакетов. Он охватывает настройку реестров и то, как безопасно доказать риск. Он нужен специалистам по безопасности и разработчикам, которые с разрешения проверяют собственную настройку пакетов.

Когда использовать

  • ✓Когда вы хотите проверить, можно ли занять ваши приватные имена пакетов в публичном реестре.
  • ✓Когда ваша сборка берет пакеты и из публичных, и из приватных реестров, и вы хотите ее проверить.
  • ✓Когда нужно безопасное доказательство концепции для находки подмены зависимостей в авторизованном тесте.

Ссылка на скилл

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

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/SnailSploit/Claude-Red/blob/main/Skills/supply-chain/offensive-dependency-confusion/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“У нас есть разрешение на тест нашей настройки npm и PyPI. Проверь, защищены ли наши приватные имена пакетов от подмены.”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

Скилл находит внутренние имена пакетов, проверяет настройки реестров и подтверждает, что имена-кандидаты не заняты в публичных реестрах. Затем он готовит безопасное доказательство концепции, которое только сообщает о вызове обратно, без вредоносной нагрузки.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с 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

Частые вопросы

Наносит ли доказательство концепции вред?

Скилл советует использовать безопасное доказательство концепции с обратным вызовом и без разрушительной нагрузки.

Какие экосистемы он охватывает?

Он охватывает npm, PyPI и NuGet, а также упоминает другие экосистемы.

Это только для авторизованных тестов?

Да. Скилл написан для авторизованных проектов.

Подробности

Оригинальное описание автора

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

Популярность

Звёзды на GitHub
10k
Место в рейтинге
#11972
Лицензия
MIT
Обновлён
12.10.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы