Skip to content

kazisabu/gitscanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” GitScan – GitHub Repo Keyword & Secret Scanner

Python License GitHub API

GitScan: GitHub Repository Keyword & Secret Scanner

GitScan is a lightweight security tool designed to detect secrets, credentials, and specific patterns within public GitHub repositories. Unlike traditional scanners, GitScan leverages the GitHub API to inspect code without the need for local cloning, making it fast and resource-efficient.


Key Features

  • API-Based Scanning: Analyzes code directly via GitHub’s REST API (no git clone required).
  • Customizable Filters: Define specific keywords and file extensions to target.
  • Bulk Processing: Scans multiple repositories in a single execution.
  • Structured Output: Generates JSON reports for easy integration with other tools.
  • Automated Notifications: Optionally delivers results and report files via Telegram.

πŸ—‚οΈ Directory Structure

GitScan/
β”œβ”€β”€ scanner.py # Main script
β”œβ”€β”€ telegram_notify.py # Telegram sending logic
β”œβ”€β”€ utils.py # GitHub API scanning logic
β”œβ”€β”€ repos.txt # List of target GitHub repos
β”œβ”€β”€ keywords.txt # Keywords to match
β”œβ”€β”€ extensions.txt # File types to scan
β”œβ”€β”€ output/
β”‚ └── scan_report.json # Final result
β”œβ”€β”€ requirements.txt
└── README.md

πŸ› οΈ Installation

git clone https://github.com/youruser/GitScan
cd GitScan
python3 -m venv myenv && source myenv/bin/activate
pip install -r requirements.txt

Configuration

  1. GitHub Authentication To avoid rate limiting, provide a GitHub Personal Access Token (PAT) in utils.py:
token = "ghp_yourgithubtoken"
headers["Authorization"] = f"token {token}"

2. Telegram Integration

Configure your bot credentials in scanner.py. You can specify multiple recipients:

TELEGRAM_BOT_TOKEN = "your-bot-token"
TELEGRAM_CHAT_IDS = ["123456789", "987654321"]
  1. Define Targets Add the repositories you wish to scan to repos.txt, ensuring there is one URL per line:
https://github.com/target_1/target_repo_1
https://github.com/target_2/target_repo_2

One repo URL per line Supports scanning multiple public repos

Usage Execute the scanner using Python:

python3 scanner.py

If Telegram notifications are enabled, the bot will transmit a summary and the JSON report file upon completion.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors