Skip to main content

Shai Hulud Detector

License Python PyPI PyPI Downloads

A CLI tool to detect potential Shai Hulud npm-worm compromises in GitHub users and organizations.

OG Image

What is Shai Hulud?

Shai Hulud is a self-replicating npm worm that spreads through compromised developer systems, infecting GitHub repositories and injecting malicious code.
It has already been linked to multiple global supply-chain attacks targeting major npm libraries.

This tool scans for known indicators of compromise (IOCs), including:

  • Suspicious repository descriptions containing
    "Sha1-Hulud: The Second Coming."
  • Presence of suspicious JSON files containing secrets, credentials or environment configuration

Features

  • Scan individual GitHub users
  • Scan all members of a GitHub organization
  • Dual detection methods: repository description patterns and suspicious file detection
  • Concurrent scanning with configurable workers
  • Color-coded output for easy identification (FLAG/OKAY/ERROR status)
  • Detailed verbose mode

Requirements

Installation

Install directly from PyPI:

pip install shai-hulud-detector

Authentication

Set your GitHub token as an environment variable (recommended):

export GITHUB_TOKEN=<GITHUB_TOKEN_HERE>

Or pass it via command-line flag (see Usage section below). If omitted, the tool exits with a clear warning.

Usage

Scan one or more users

shai-hulud-detector scan <USERNAME_HERE>
shai-hulud-detector scan <USERNAME_HERE1> <USERNAME_HERE2> <USERNAME_HERE3>

Scan all members of an organization

shai-hulud-detector scan --org <ORGANIZATION_NAME_HERE>

Authentication via command-line

shai-hulud-detector scan <USERNAME_HERE> --token <GITHUB_TOKEN_HERE>

Help

shai-hulud-detector scan --help

Parallelism

Set concurrency (default 5):

shai-hulud-detector scan --org <ORGANIZATION_NAME_HERE> --workers 10

Verbose Output

shai-hulud-detector scan <USERNAME_HERE> --verbose

Recommended Actions

If you detect a compromise (FLAG status):

  • Rotate all GitHub, npm, cloud, and CI/CD secrets
  • Enforce MFA on GitHub & npm accounts
  • Check GitHub for repositories with the description "Sha1-Hulud: The Second Coming."
  • Review and remove any suspicious files found (e.g., secrets.json, credentials.json, etc.)
  • Disable npm postinstall scripts in CI where possible
  • Audit all npm dependencies and versions

References

For more detailed information about Shai Hulud attacks, see:

License

MIT License - see LICENSE file for details.

Author

Y. Siva Sai Krishna

Development

For development setup, building, and contributing, see DEVELOPMENT.md.

Changelog

See CHANGELOG.md for a detailed list of changes and version history.

Releases

For information on the release process and how to create new releases, see RELEASE.md.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

If you encounter any issues or have feature requests, please open an issue on GitHub.

Metadata

Release files for shai-hulud-detector 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shai-hulud-detector 1.0.4
File Size Uploaded
shai_hulud_detector-1.0.4.tar.gz 278.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shai-hulud-detector 1.0.4
File Interpreter ABI Platform
shai_hulud_detector-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 286.6 kB

Release files / shai_hulud_detector-1.0.4.tar.gz

Download URL shai_hulud_detector-1.0.4.tar.gz
Size 278.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6b3b1d250aa20ea9f57de7d96c6b92f3522aadc99b5dbd8f98a8a423c2f971e2
BLAKE2b-256 checksum
How to use checksums
a7efc2702a96b3d95eb8d135513d75642521ee1554a06c4bb2b633edbfcd7550
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / shai_hulud_detector-1.0.4-py3-none-any.whl

Download URL shai_hulud_detector-1.0.4-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4df5033527d089c385964f520c9f7dce848bb279b5eab05c9425cbb4bf01cff
BLAKE2b-256 checksum
How to use checksums
b88bea8b289ea5bb5e98bea650f07686ecbf169570d6214e7ddf9f97513911ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page