|
| 1 | +# 🎯 gitdork |
| 2 | + |
| 3 | +> Google, Shodan, and GitHub dork generator. Feed it a repo URL or domain — get ready-to-use dork queries targeting exposed secrets, sensitive files, open directories, and misconfigs. Built for pentesters and bug bounty hunters. |
| 4 | +
|
| 5 | +[](https://github.com/ExploitCraft/gitdork/actions) |
| 6 | +[](https://pypi.org/project/gitdork/) |
| 7 | +[](https://pypi.org/project/gitdork/) |
| 8 | +[](LICENSE) |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Features |
| 13 | + |
| 14 | +- 🔍 **Google dorks** — `site:`, `filetype:`, `intitle:`, `inurl:` across 8 categories |
| 15 | +- 🌐 **Shodan dorks** — `hostname:`, `port:`, `ssl:`, `product:` for infra recon |
| 16 | +- 🐙 **GitHub code search** — `org:`, `filename:`, `extension:` for secret hunting |
| 17 | +- 🧠 **Tech stack detection** — fetch GitHub metadata to generate tech-specific dorks |
| 18 | +- 🗂️ **Category filtering** — focus on secrets, misconfigs, login panels, or any combo |
| 19 | +- ⚙️ **Engine filtering** — run just Google, just Shodan, or all three |
| 20 | +- 📊 **Multiple output formats** — terminal (Rich), JSON, Markdown |
| 21 | +- 🔗 **Clickable URLs** — every dork includes a direct search link |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Installation |
| 26 | + |
| 27 | +```bash |
| 28 | +pip install gitdork |
| 29 | +``` |
| 30 | + |
| 31 | +Or from source: |
| 32 | + |
| 33 | +```bash |
| 34 | +git clone https://github.com/ExploitCraft/gitdork |
| 35 | +cd gitdork |
| 36 | +pip install -e . |
| 37 | +``` |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Quick Start |
| 42 | + |
| 43 | +```bash |
| 44 | +# Generate dorks for a domain |
| 45 | +gitdork generate example.com |
| 46 | + |
| 47 | +# Generate dorks for a GitHub org/repo |
| 48 | +gitdork generate ExploitCraft/ReconNinja |
| 49 | + |
| 50 | +# Google dorks only |
| 51 | +gitdork generate example.com --engine google |
| 52 | + |
| 53 | +# Secrets and misconfigs only |
| 54 | +gitdork generate example.com --category secrets,misconfigs |
| 55 | + |
| 56 | +# Enrich with GitHub API (detects tech stack for extra dorks) |
| 57 | +gitdork generate ExploitCraft/ReconNinja --enrich |
| 58 | + |
| 59 | +# Export to JSON |
| 60 | +gitdork generate example.com --format json --output dorks.json |
| 61 | + |
| 62 | +# Export to Markdown (great for reports) |
| 63 | +gitdork generate example.com --format markdown --output dorks.md |
| 64 | + |
| 65 | +# Group output by category instead of engine |
| 66 | +gitdork generate example.com --group-by category |
| 67 | +``` |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## Example Output |
| 72 | + |
| 73 | +``` |
| 74 | +╭─ gitdork — Google, Shodan & GitHub dork generator ─╮ |
| 75 | +
|
| 76 | +Target: example.com |
| 77 | +
|
| 78 | +── GOOGLE ────────────────────────────────────────────── |
| 79 | +
|
| 80 | + # CATEGORY DESCRIPTION QUERY |
| 81 | + 1 Secrets & Creds API keys in GitHub site:github.com "example.com" "api_key" |
| 82 | + 2 Sensitive Files .env files exposed site:example.com filetype:env |
| 83 | + 3 Sensitive Files Log files exposed site:example.com filetype:log |
| 84 | + 4 Exposed Dirs Open directory listings site:example.com intitle:"index of /" |
| 85 | + 5 Misconfigurations phpMyAdmin exposed site:example.com inurl:phpMyAdmin |
| 86 | +... |
| 87 | +
|
| 88 | +── SHODAN ─────────────────────────────────────────────── |
| 89 | +
|
| 90 | + # CATEGORY DESCRIPTION QUERY |
| 91 | + 1 Subdomains All hosts under this domain hostname:"example.com" |
| 92 | + 2 Misconfigs SSH exposed hostname:"example.com" port:22 |
| 93 | + 3 Misconfigs Redis exposed (often no auth) hostname:"example.com" port:6379 |
| 94 | +... |
| 95 | +
|
| 96 | +╭─ Summary ──────────────────────╮ |
| 97 | + Total dorks 97 |
| 98 | + Google 42 |
| 99 | + Shodan 31 |
| 100 | + GitHub 24 |
| 101 | +╰────────────────────────────────╯ |
| 102 | +``` |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## Categories |
| 107 | + |
| 108 | +| ID | Description | |
| 109 | +|----|-------------| |
| 110 | +| `secrets` | API keys, tokens, passwords, private keys | |
| 111 | +| `sensitive_files` | .env, .sql, .log, .bak, config files | |
| 112 | +| `exposed_dirs` | Open directory listings | |
| 113 | +| `misconfigs` | phpMyAdmin, Jenkins, Grafana, Docker API, debug mode | |
| 114 | +| `login_panels` | Admin panels, login pages | |
| 115 | +| `error_pages` | Stack traces, PHP errors, SQL errors | |
| 116 | +| `subdomains` | Subdomain enumeration, infra discovery | |
| 117 | +| `code_leaks` | TODO credentials, internal-only code | |
| 118 | + |
| 119 | +```bash |
| 120 | +# View all categories |
| 121 | +gitdork list-categories |
| 122 | + |
| 123 | +# View all engines |
| 124 | +gitdork list-engines |
| 125 | +``` |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +## CLI Reference |
| 130 | + |
| 131 | +``` |
| 132 | +Usage: gitdork [OPTIONS] COMMAND [ARGS]... |
| 133 | +
|
| 134 | +Commands: |
| 135 | + generate Generate dorks for a target |
| 136 | + list-categories List all available categories |
| 137 | + list-engines List all supported engines |
| 138 | +
|
| 139 | +Options for generate: |
| 140 | + TARGET Domain, GitHub org/repo, or URL |
| 141 | + --engine, -e google,shodan,github (default: all) |
| 142 | + --category, -c Comma-separated category filter |
| 143 | + --format terminal | json | markdown (default: terminal) |
| 144 | + --output, -o Write to file |
| 145 | + --group-by engine | category (default: engine) |
| 146 | + --enrich Fetch GitHub metadata for tech-stack dorks |
| 147 | + --token GitHub token for enrichment (or GITHUB_TOKEN env) |
| 148 | +``` |
| 149 | + |
| 150 | +--- |
| 151 | + |
| 152 | +## Tech Stack Detection |
| 153 | + |
| 154 | +With `--enrich`, gitdork queries the GitHub API to detect the repo's language, topics, and description — then generates additional targeted dorks: |
| 155 | + |
| 156 | +| Tech | Extra dorks | |
| 157 | +|------|-------------| |
| 158 | +| `django` | DEBUG mode, SECRET_KEY, ALLOWED_HOSTS | |
| 159 | +| `wordpress` | wp-config.php, upload PHP shells | |
| 160 | +| `laravel` | .env APP_KEY | |
| 161 | +| `aws` | aws_access_key_id in code | |
| 162 | +| `kubernetes` | API server, Shodan product query | |
| 163 | +| `terraform` | tfvars with secrets | |
| 164 | + |
| 165 | +```bash |
| 166 | +# Use your GitHub token for higher API rate limits |
| 167 | +export GITHUB_TOKEN=ghp_... |
| 168 | +gitdork generate ExploitCraft/ReconNinja --enrich |
| 169 | +``` |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +## Part of the HackerInc/ExploitCraft Ecosystem |
| 174 | + |
| 175 | +| Tool | Description | |
| 176 | +|------|-------------| |
| 177 | +| [envleaks](https://github.com/ExploitCraft/envleaks) | Codebase & git history secret scanner | |
| 178 | +| [gitdork](https://github.com/ExploitCraft/gitdork) | Google/Shodan dork generator (this repo) | |
| 179 | +| [wifi-passview](https://github.com/ExploitCraft/wifi-passview) | Cross-platform WiFi credential dumper | |
| 180 | +| **ReconNinja** | ReconNinja v6 — 21-phase recon framework | |
| 181 | +| [VaultHound](https://github.com/ExploitCraft/VaultHound) | Secret & credential scanner | |
| 182 | + |
| 183 | +--- |
| 184 | + |
| 185 | +## Disclaimer |
| 186 | + |
| 187 | +gitdork generates search queries only — it does not perform any active scanning or exploitation. Use responsibly, only against targets you own or have explicit written permission to test. |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +## License |
| 192 | + |
| 193 | +MIT © [ExploitCraft](https://github.com/ExploitCraft) |
0 commit comments