A Python tool to detect and monitor GitHub repositories related to the Sha1-Hulud project across organization members.
- Fetch Organization Members: Automatically retrieve all members from a GitHub organization and save them to CSV
- V1 Detection: Scan for repositories named
- V2 Detection: Scan for repositories with "Sha1-Hulud: The Second Coming." in their description
- Slack Notifications: Send alerts when repositories are detected
- Automated Pagination: Handles large organizations with automatic API pagination
- Python 3.7+
- GitHub Personal Access Token (recommended for higher rate limits)
- Slack Webhook URL (optional, for notifications)
- Clone the repository:
git clone git@github.com:Joeri-Abbo/Github-Sha1-Hulud-detector.git
cd Github-Sha1-Hulud-detector- Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate # On macOS/Linux
# or
.venv\Scripts\activate # On Windows
pip install -r requirments.txt- Set up your environment variables:
cp .env.example .envEdit .env and add your tokens:
GITHUB_TOKEN=your_github_token_here
GITHUB_ORG=your_organization_name
SLACK_WEBHOOK_URL=your_slack_webhook_url_here
- Go to GitHub Settings > Tokens
- Click "Generate new token (classic)"
- Select scopes:
public_repo- for reading public repositoriesread:org- for reading organization member information
- Copy the token and add it to your
.envfile
Run this script to populate users.csv with all members from a GitHub organization:
python fetch_org_members.pyYou'll be prompted to enter the organization name. The script will:
- Fetch all members (automatically paginated)
- Display progress as it collects members
- Save all usernames to
users.csv
Once you have users.csv populated, run the main scanner:
python main.pyThis will:
- Load all users from
users.csv - Check each user for:
- V1: A repository named
Shai-Hulud - V2: Any repository with "Sha1-Hulud: The Second Coming." in its description
- V1: A repository named
- Send Slack notifications when repositories are found (if webhook configured)
Instead of using a CSV file, you can scan an organization directly using main_org.py:
python main_org.pyThis will:
- Fetch all members from the organization specified in
GITHUB_ORG(from.env) - Scan each member for Sha1-Hulud repositories in real-time
- Send Slack notifications when repositories are found
Note: This requires the GITHUB_ORG environment variable to be set in your .env file.
For convenience, use the provided run script:
sh run.shGitHub API rate limits:
- Without authentication: 60 requests/hour
- With authentication: 5,000 requests/hour
Recommendation: Always use a GitHub token to avoid hitting rate limits, especially when scanning many users.
.
βββ fetch_org_members.py # Fetch organization members to CSV
βββ main.py # Main scanner (reads from users.csv)
βββ main_org.py # Alternative scanner (fetches org members directly)
βββ users.csv # List of usernames to scan
βββ requirments.txt # Python dependencies
βββ run.sh # Convenience script
βββ .env.example # Example environment variables
βββ README.md # This file
GITHUB_TOKEN- GitHub Personal Access Token (required for org access)GITHUB_ORG- GitHub organization name (required formain_org.py)SLACK_WEBHOOK_URL- Slack webhook for notifications (optional)
The users.csv file should have the following format:
Username
user1
user2
user3$ python fetch_org_members.py
Enter the GitHub organization name: Homebrew
Fetching members from organization: Homebrew
(PyGithub will automatically paginate through all results)
Collecting members...
- member1
- member2
Fetched 10 members so far...
...
β Successfully saved 150 members to users.csv$ python main.py
Loaded users: ['user1', 'user2', 'user3']
Scanning V1 SHA1 Hulud for user: user1
Scanning V2 SHA1 Hulud for user: user1
User user1 has V1 SHA1 Hulud repository: https://github.com/user1/Shai-Hulud
Notification sent with status code: 200Contributions are welcome! Please feel free to submit a Pull Request.
Joeri Abbo