offensive-dependency-confusion
यह क्या करती है
यह स्किल npm, PyPI, NuGet और दूसरे package ecosystems में dependency confusion परखने की एक कार्यप्रणाली है। इसमें registry configuration और जोखिम को सुरक्षित तरीके से साबित करना शामिल है। यह अनुमति के साथ अपने package सेटअप की जाँच करने वाले सुरक्षा पेशेवरों और डेवलपरों के लिए है।
कब इस्तेमाल करें
- ✓जब आप जाँचना चाहते हों कि आपके निजी package नामों को सार्वजनिक registry पर कोई ले सकता है या नहीं।
- ✓जब आपकी build पब्लिक और प्राइवेट दोनों registries से packages लेती है और आप उसकी समीक्षा चाहते हैं।
- ✓जब आपको अधिकृत परीक्षण में dependency confusion खोज के लिए सुरक्षित proof of concept चाहिए।
Skill का लिंक
https://github.com/SnailSploit/Claude-Red/blob/main/Skills/supply-chain/offensive-dependency-confusion/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमें अपने npm और PyPI सेटअप के परीक्षण की अनुमति है। जाँचिए कि हमारे निजी package नाम confusion से सुरक्षित हैं या नहीं।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
स्किल आंतरिक package नाम खोजती है, registry सेटिंग जाँचती है, और पुष्टि करती है कि उम्मीदवार नाम सार्वजनिक registries पर अधिकृत नहीं हैं। फिर वह एक सुरक्षित proof of concept तैयार करती है, जो सिर्फ़ callback दर्ज करता है, कोई हानिकारक payload नहीं।
तकनीकी सामग्री (मूल 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
- Perform reconnaissance to discover internal/private package names used by the target.
- Identify the target's package ecosystems and registry configuration.
- Verify that candidate package names are unclaimed on the corresponding public registry.
- Prepare a safe PoC package with a DNS canary or HTTP callback and a high version number.
- Publish the PoC to the public registry with a clear security research description.
- Monitor the callback endpoint for execution confirmations from target infrastructure.
- Record callback metadata (hostname, username, CI flag, timestamp) as evidence.
- Remove the PoC package from the public registry after confirmation or engagement window closes.
- 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
अक्सर पूछे जाने वाले सवाल
क्या proof of concept नुकसान करता है?
स्किल callback वाला सुरक्षित proof of concept इस्तेमाल करने को कहती है, बिना किसी विनाशकारी payload के।
यह कौन से ecosystems कवर करती है?
यह npm, PyPI और NuGet कवर करती है, और दूसरे ecosystems का भी ज़िक्र करती है।
क्या यह सिर्फ़ अधिकृत परीक्षणों के लिए है?
हाँ। यह अधिकृत मूल्यांकन के लिए लिखी गई है।
जानकारी
लेखक का मूल विवरण
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
कमेंट
- …
इस repository की और skills
offensive-active-directory
10kआपके एजेंट को अधिकृत Active Directory सुरक्षा परीक्षण की योजना बनाने में मदद करती है, नेटवर्क मैपिंग से लेकर Domain Admin तक के हमला रास्ते खोजने तक।
offensive-netexec
10kआपके एजेंट को अधिकृत नेटवर्क परीक्षण के लिए NetExec (nxc) टूल इस्तेमाल करने में मदद करती है, जिसमें प्रोटोकॉल, प्रमाणीकरण और credential जाँच शामिल हैं।
offensive-api-abuse
10kआपके एजेंट को अधिकृत API सुरक्षा परीक्षण की योजना बनाने में मदद करती है, जो business logic के दुरुपयोग, GraphQL जोखिम और race conditions खोजते हैं।
offensive-api-security
10kआपके एजेंट को OWASP API Top 10 के आधार पर REST, gRPC और WebSocket API पर अधिकृत सुरक्षा परीक्षण चलाने में मदद करती है।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।