본문으로 건너뛰기
Skillpedia
에이전트35k · #7884

detecting-typosquatting-packages-in-npm-pypi

하는 일

이 도구는 npm과 PyPI 저장소에서 인기 있는 패키지와 이름이 매우 비슷한 패키지를 확인합니다. 오타처럼 보이거나 사용자를 속이려고 일부러 바꾼 이름을 찾습니다.

사용하는 경우

  • ✓프로젝트의 의존성이 ‘가짜’가 아닌지 감사할 때.
  • ✓회사 이름을 사용해 가짜 패키지를 만들려는 시도를 모니터링할 때.
  • ✓개발자가 실수로 잘못된 패키지를 설치했다고 의심되는 경우.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-typosquatting-packages-in-npm-pypi/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/detecting-typosquatting-packages-in-npm-pypi/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“npm과 PyPI에서 ‘react’와 비슷한 이름을 가진 패키지가 있는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 도구는 텍스트 유사도 지표로 패키지 이름을 비교하고, 패키지가 언제 만들어졌는지와 다운로드 수를 분석합니다. 이름이 비슷하고, 최근에 만들어졌고, 다운로드 수가 적은 패키지는 의심스럽다고 표시합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Detecting Typosquatting Packages in npm and PyPI

When to Use

  • Auditing project dependencies to identify packages whose names are suspiciously similar to popular libraries
  • Proactively scanning package registries for newly published packages that may be typosquats of your organization's packages
  • Investigating a suspected supply chain compromise where a developer installed a misspelled package name
  • Building automated monitoring that alerts when new packages appear with names close to critical dependencies
  • Assessing the risk profile of unfamiliar packages before adding them to a project's dependency tree

Do not use as the sole determination of malicious intent; name similarity alone does not prove a package is malicious. Do not use for bulk automated takedown requests without manual review of flagged packages. Do not use against private registries without authorization.

Prerequisites

  • Python 3.9+ with requests and python-Levenshtein (or rapidfuzz) packages installed
  • Network access to https://pypi.org/pypi/<package>/json (PyPI JSON API) and https://registry.npmjs.org/<package> (npm registry API)
  • A list of popular or critical packages to monitor (e.g., top 1000 PyPI packages, organization's dependency list)
  • Understanding of common typosquatting patterns: character omission, transposition, insertion, substitution, and hyphen/underscore manipulation

Workflow

Step 1: Build the Target Package Watchlist

Establish the set of legitimate packages to monitor for typosquats:

  • Extract project dependencies: Parse requirements.txt, Pipfile.lock, package.json, or package-lock.json to extract all direct and transitive dependency names
  • Include popular packages: Supplement with high-value targets from the top 1000 PyPI downloads (available from https://hugovk.github.io/top-pypi-packages/) or top npm packages by download count
  • Add organization packages: Include any packages published by your organization that attackers might target with typosquats to intercept internal installations
  • Normalize names: PyPI treats hyphens, underscores, and periods as equivalent (PEP 503 normalization: re.sub(r"[-_.]+", "-", name).lower()). npm package names are case-sensitive but scoped packages use @scope/name format. Normalize before comparison.

Step 2: Generate Candidate Typosquat Names

Produce potential typosquat variants for each target package:

  • Character omission: Remove each character one at a time (requests -> rquests, requets, reqests)
  • Character transposition: Swap adjacent characters (requests -> erquests, rqeuests, reques ts)
  • Character substitution: Replace characters with keyboard-adjacent keys using a QWERTY distance map (requests -> rrquests, requesta)
  • Character insertion: Insert common characters at each position (requests -> rrequests, reqquests)
  • Separator manipulation: For hyphenated names, try removing, doubling, or replacing separators (my-package -> mypackage, my--package, my_package)
  • Common prefix/suffix attacks: Prepend or append common strings (python-requests, requests-python, requests2, requests-lib)

Step 3: Query Registry APIs for Candidate Packages

Check whether generated candidate names actually exist in the registry:

  • PyPI JSON API: Send GET https://pypi.org/pypi/<candidate>/json for each candidate. A 200 response means the package exists; 404 means it does not. Extract from the response: info.name, info.version, info.author, info.summary, info.home_page, info.project_urls, and releases (keyed by version with upload_time_iso_8601 timestamps).
  • npm registry API: Send GET https://registry.npmjs.org/<candidate> with Accept: application/json. Extract: name, description, dist-tags.latest, time.created, time.modified, maintainers, and versions.
  • Rate limiting: PyPI has no published rate limits but respect reasonable request rates (1-2 requests/second). npm registry returns 429 when rate limited; implement exponential backoff.
  • Batch optimization: For large candidate lists, parallelize requests with connection pooling (requests.Session) and limit concurrency to avoid triggering abuse protections.

Step 4: Analyze Package Metadata for Suspicion Signals

Score each existing candidate package against multiple heuristic signals:

…

자주 묻는 질문

‘타이포스쿼팅’이란 무엇인가요?

기존 도메인 이름이나 패키지 이름과 매우 비슷한 이름을 등록해, 사람들이 원본으로 착각하게 만드는 행위입니다.

왜 위험한가요?

악성 패키지는 정보를 훔치거나, 시스템을 망가뜨리거나, 바이러스를 퍼뜨릴 수 있습니다. 가짜 패키지를 실수로 쓰면 프로젝트의 보안이 위험해질 수 있습니다.

이 도구가 패키지가 악성이라고 보장하나요?

아니요. 이 도구는 이름과 특정 특징을 바탕으로 의심스러운 패키지를 표시할 뿐입니다. 악성인지 확실히 하려면 사람이 직접 검토하는 것이 중요합니다.

상세 정보

작성자의 원본 설명

Detects typosquatting attacks in npm and PyPI package registries by analyzing package name similarity using Levenshtein distance and other string metrics, examining publish date heuristics to identify recently created packages mimicking established ones, and flagging download count anomalies where suspicious packages have disproportionately low usage compared to their legitimate targets. The analy

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#7884
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬