v1.0.0 · ExploitCraft/gitdork@fb95a21 · GitHub
Skip to content

Commit fb95a21

Browse files
committed
v1.0.0
0 parents  commit fb95a21

21 files changed

Lines changed: 2119 additions & 0 deletions

‎.github/workflows/ci.yml‎

Lines changed: 34 additions & 0 deletions

‎.github/workflows/release.yml‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
release:
10+
name: Build & Publish Release
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: write
15+
id-token: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
cache: 'pip'
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install click rich httpx pytest build twine
31+
pip install -e .
32+
33+
- name: Run tests (must pass before release)
34+
run: pytest tests/ -v --tb=short
35+
36+
- name: Build PyPI package
37+
run: python -m build
38+
39+
- name: Publish to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1
41+
with:
42+
password: ${{ secrets.PYPI_API_TOKEN }}
43+
44+
- name: Build release zip
45+
run: |
46+
TAG="${GITHUB_REF_NAME}"
47+
STAGING="gitdork-${TAG}"
48+
mkdir -p "${STAGING}"
49+
rsync -av \
50+
--exclude='.git' \
51+
--exclude='__pycache__' \
52+
--exclude='*.pyc' \
53+
--exclude='.pytest_cache' \
54+
--exclude='*.egg-info' \
55+
--exclude="${STAGING}" \
56+
. "${STAGING}/"
57+
ZIP_NAME="gitdork-${TAG}.zip"
58+
zip -r "${ZIP_NAME}" "${STAGING}/"
59+
echo "ZIP_NAME=${ZIP_NAME}" >> $GITHUB_ENV
60+
echo "TAG=${TAG}" >> $GITHUB_ENV
61+
echo "--- Release zip contents ---"
62+
unzip -l "${ZIP_NAME}"
63+
64+
- name: Extract changelog entry
65+
run: |
66+
python3 - << 'PYEOF'
67+
import re, os
68+
tag = os.environ["GITHUB_REF_NAME"]
69+
version = tag.lstrip("v")
70+
try:
71+
readme = open("CHANGELOG.md").read()
72+
pattern = rf"(?m)^##\s+\[?v?{re.escape(version)}\]?.*?\n(.*?)(?=\n^##\s|\Z)"
73+
m = re.search(pattern, readme, re.DOTALL)
74+
notes = m.group(1).strip() if m else f"Release {tag}"
75+
except Exception:
76+
notes = f"gitdork {tag}"
77+
with open("/tmp/release_notes.md", "w") as f:
78+
f.write(notes)
79+
print(notes[:500])
80+
PYEOF
81+
82+
- name: Create GitHub Release
83+
uses: softprops/action-gh-release@v2
84+
with:
85+
tag_name: ${{ github.ref_name }}
86+
name: "gitdork ${{ github.ref_name }}"
87+
body_path: /tmp/release_notes.md
88+
draft: false
89+
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') || contains(github.ref_name, 'rc') }}
90+
files: ${{ env.ZIP_NAME }}
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎CHANGELOG.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Changelog
2+
3+
## [1.0.0] - 2024-01-01
4+
5+
### Added
6+
- Initial release
7+
- Google dork generation — 40+ templates across 8 categories
8+
- Shodan dork generation — 30+ templates covering ports, services, SSL, admin panels
9+
- GitHub code search dorks — 35+ templates for secrets, sensitive files, misconfigs
10+
- Tech stack detection via `--enrich` flag (GitHub API)
11+
- Category filtering with `--category`
12+
- Engine filtering with `--engine`
13+
- Terminal (Rich), JSON, and Markdown output formats
14+
- `generate`, `list-categories`, `list-engines` commands

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 ExploitCraft
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
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+
[![CI](https://github.com/ExploitCraft/gitdork/actions/workflows/ci.yml/badge.svg)](https://github.com/ExploitCraft/gitdork/actions)
6+
[![PyPI](https://img.shields.io/pypi/v/gitdork)](https://pypi.org/project/gitdork/)
7+
[![Python](https://img.shields.io/pypi/pyversions/gitdork)](https://pypi.org/project/gitdork/)
8+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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)

‎gitdork/__init__.py‎

Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)