performing-supply-chain-attack-simulation skill (Anthropic-Cybersecurity-Skills)
- Install
- SKILL.md (verbatim)
- Overview
- When to Use
- Prerequisites
- Key Detection Areas
- Output
- Other files in this skill
- references/api-reference.md (verbatim)
- Tool Installation
- PyPI JSON API
- Response Structure
- pip-audit CLI
- pip Hash Verification
- pypi-scan Typosquatting Detection
- Levenshtein Distance Examples
- Dependency Confusion Test Structure
- MITRE ATT&CK Mapping
- Metadata Anomaly Indicators
What it does. Simulates and detects software supply chain attacks: typosquatting detection via Levenshtein distance against popular PyPI package names, dependency confusion testing against private registries, SHA-256 package hash verification, and known-CVE scanning with pip-audit. Use when auditing a project's dependencies for malicious or confused packages, or when assessing package-registry supply-chain risk. Part of mukul975/Anthropic-Cybersecurity-Skills (817 security skills) (mukul975/Anthropic-Cybersecurity-Skills).
| Upstream | mukul975/Anthropic-Cybersecurity-Skills |
| Skill file | skills/performing-supply-chain-attack-simulation/SKILL.md |
| License | Apache-2.0 (skill folder LICENSE) |
| Author | mukul975 |
| Fetched | 2026-09-10 |
Install
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-supply-chain-attack-simulation, or copy the skill folder into~/.claude/skills/performing-supply-chain-attack-simulation/.- Raw file:
curl -sL https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/HEAD/skills/performing-supply-chain-attack-simulation/SKILL.md
SKILL.md (verbatim)
name: performing-supply-chain-attack-simulation
description: >-
Simulates and detects software supply chain attacks: typosquatting
detection via Levenshtein distance against popular PyPI package names,
dependency confusion testing against private registries, SHA-256 package
hash verification, and known-CVE scanning with pip-audit. Use when auditing
a project's dependencies for malicious or confused packages, or when
assessing package-registry supply-chain risk.
domain: cybersecurity
subdomain: application-security
tags:
- supply-chain
- typosquatting
- dependency-confusion
- package-verification
- pip-audit
- PyPI
- software-composition-analysis
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.PS-01
- PR.PS-04
- ID.RA-01
- PR.DS-10
mitre_attack:
- T1078
- T1190
- T1059
- T1195
- T1554
Performing Supply Chain Attack Simulation
Overview
Software supply chain attacks exploit trust in package registries through typosquatting (registering names similar to popular packages), dependency confusion (publishing higher-version public packages matching private names), and compromised package distribution. This skill detects these attack vectors by computing Levenshtein distance between package names and popular PyPI packages, verifying package integrity via SHA-256 hash comparison, scanning for known CVEs with pip-audit, and testing dependency resolution order for confusion vulnerabilities.
When to Use
- When conducting security assessments that involve performing supply chain attack simulation
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Python 3.9+ with
pip-audit,Levenshtein,requests - Access to PyPI JSON API (https://pypi.org/pypi/{package}/json)
- Network access for package metadata retrieval
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Key Detection Areas
- Typosquatting — compare package names against top PyPI packages using edit distance thresholds
- Dependency confusion — check if internal package names exist on public PyPI with higher version numbers
- Hash verification — download packages and verify SHA-256 digests match published hashes
- Vulnerability scanning — audit installed packages against OSV and PyPA advisory databases
- Metadata anomalies — flag packages with suspicious author emails, missing homepages, or very recent first upload dates
Output
JSON report with risk scores per package, detected attack vectors, hash verification results, and CVE findings.
Other files in this skill
references/api-reference.md (verbatim)
Supply Chain Attack Simulation Reference
Tool Installation
pip install pip-audit python-Levenshtein requests
PyPI JSON API
# Get package metadata
curl https://pypi.org/pypi/{package_name}/json
# Get specific version
curl https://pypi.org/pypi/{package_name}/{version}/json
Response Structure
{
"info": {
"name": "requests",
"version": "2.31.0",
"author": "Kenneth Reitz",
"author_email": "me@kennethreitz.org",
"home_page": "https://requests.readthedocs.io",
"summary": "Python HTTP for Humans."
},
"urls": [
{
"filename": "requests-2.31.0.tar.gz",
"packagetype": "sdist",
"digests": {
"sha256": "942c5a758f98d790eaed1a29cb6eefc7f0edf3fcb0fce8aea3fbd5951d bfcfeb"
}
}
]
}
pip-audit CLI
# Audit current environment
pip-audit
# JSON output
pip-audit --format json
# Audit requirements file
pip-audit -r requirements.txt
# Hash-checking mode (pinned deps only)
pip-audit --require-hashes -r requirements.txt
# Fix vulnerabilities automatically
pip-audit --fix
pip Hash Verification
# Download with hash verification
pip download --no-deps --require-hashes -r requirements.txt
# requirements.txt with hashes
requests==2.31.0 \
--hash=sha256:942c5a758f98d790eaed1a29cb6eefc7f0edf3fcb0fce8aea3fbd5951dbfcfeb
pypi-scan Typosquatting Detection
# Install
pip install pypi-scan
# Scan for typosquatting of a package
pypi-scan --package requests
# Scan with custom edit distance
pypi-scan --package numpy --edit-distance 2
Levenshtein Distance Examples
| Package | Target | Distance | Risk |
|---|---|---|---|
reqeusts |
requests |
1 | High |
requets |
requests |
1 | High |
request |
requests |
1 | High |
numpys |
numpy |
1 | High |
pandsa |
pandas |
1 | High |
flaask |
flask |
1 | High |
Dependency Confusion Test Structure
[
{"name": "my-internal-lib", "version": "1.2.0"},
{"name": "company-utils", "version": "0.5.3"},
{"name": "private-auth-sdk", "version": "2.1.0"}
]
MITRE ATT&CK Mapping
| Technique | ID | Description |
|---|---|---|
| Supply Chain Compromise | T1195.001 | Compromise software dependencies |
| Trusted Developer Utilities | T1127 | Abuse package manager trust |
| Ingress Tool Transfer | T1105 | Download malicious packages |
Metadata Anomaly Indicators
| Indicator | Risk | Description |
|---|---|---|
| Disposable email author | High | Author uses throwaway email service |
| No homepage/repo URL | Medium | Package has no verifiable source |
| No author info | Medium | Anonymous package publication |
| Very short description | Low | Minimal package documentation |
| Recent first upload + popular name variant | Critical | Likely typosquatting attempt |
Back to mukul975/Anthropic-Cybersecurity-Skills (817 security skills) or Agent skills.