From ab447249f691ace198edd570c8329801153beae8 Mon Sep 17 00:00:00 2001 From: dbfreem Date: Fri, 15 Dec 2023 22:29:03 -0500 Subject: [PATCH 1/6] bumped github3.py dependency --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index faadf24..979e932 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ scripts=['github-dork.py'], data_files=[('github-dorks', ['github-dorks.txt'])], install_requires=[ - 'github3.py==1.0.0a2', + 'github3.py==4.0.1', 'feedparser==6.0.2', ], ) From d50a677beae7b7c2972eba86ab42d28dab57fd35 Mon Sep 17 00:00:00 2001 From: Samar Dhwoj Acharya <1886670+techgaun@users.noreply.github.com> Date: Tue, 19 Dec 2023 10:06:50 -0600 Subject: [PATCH 2/6] add datadog api key dork --- github-dorks.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/github-dorks.txt b/github-dorks.txt index a96b015..c5625a6 100644 --- a/github-dorks.txt +++ b/github-dorks.txt @@ -87,3 +87,4 @@ filename:gitlab-recovery-codes.txt filename:discord_backup_codes.txt extension:yaml cloud.redislabs.com extension:json cloud.redislabs.com +DATADOG_API_KEY language:shell From b948dba8c0038ac3041f5dbce079bc6ba74c8840 Mon Sep 17 00:00:00 2001 From: szTheory Date: Sun, 2 Feb 2025 00:34:04 -0500 Subject: [PATCH 3/6] build with Dockerfile --- Dockerfile | 31 +++++++++++++++++++++++++++++++ README.md | 18 ++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0d8ecb9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +# Use Python 3.8 as base - this version has good compatibility with older packages +FROM python:3.8-slim + +# Set working directory +WORKDIR /app + +# Install git (needed for pip install from git repos) +RUN apt-get update && \ + apt-get install -y git && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Copy only the necessary files +COPY github-dork.py /app/ +COPY github-dorks.txt /app/ +COPY setup.py /app/ +COPY README.md /app/ +COPY requirements.txt /app/ + +# Install dependencies +# Using the specific version of github3.py that's known to work +RUN pip install --no-cache-dir github3.py==1.0.0a2 feedparser==6.0.2 + +# Set environment variables +ENV PYTHONUNBUFFERED=1 +ENV PYTHONIOENCODING=UTF-8 + +# Create volume for potential output files +VOLUME ["/app/output"] + +ENTRYPOINT ["python", "github-dork.py"] \ No newline at end of file diff --git a/README.md b/README.md index 3f24dd5..7daa065 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,24 @@ Clone this repository and run: pip install . ``` +### Docker Installation + +You can also run github-dorks using Docker for a consistent environment: + +```shell +# Build the Docker image +docker build -t github-dorks . + +# Run with a GitHub token (recommended) +docker run -e GH_TOKEN=your_github_token github-dorks -u someuser + +# Run with username/password +docker run -e GH_USER=your_username -e GH_PWD=your_password github-dorks -u someuser + +# Save results to a CSV file +docker run -v $(pwd)/output:/app/output -e GH_TOKEN=your_github_token github-dorks -u someuser -o /app/output/results.csv +``` + ### Usage ``` From 2a6109777e95fdcee5a667ee722586c55564078c Mon Sep 17 00:00:00 2001 From: szTheory Date: Sun, 2 Feb 2025 00:37:35 -0500 Subject: [PATCH 4/6] CI: docker build --- .github/workflows/docker-build.yml | 37 ++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 0000000..f243f8e --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,37 @@ +name: Docker Build & Test + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + uses: docker/build-push-action@v5 + with: + context: . + load: true + tags: github-dorks:test + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Test Docker image + run: | + # Test the version flag + docker run github-dorks:test -v + + # Basic test with a public repo (no auth needed) + docker run github-dorks:test -r techgaun/github-dorks -d github-dorks-test.txt + + - name: Verify image size + run: docker image ls github-dorks:test diff --git a/README.md b/README.md index 7daa065..eb36e4f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Docker Build & Test](https://github.com/techgaun/github-dorks/actions/workflows/docker-build.yml/badge.svg)](https://github.com/techgaun/github-dorks/actions/workflows/docker-build.yml) + # Github Dorks [Github Search](https://github.com/search) is a quite powerful and useful feature that can be used to search for sensitive data on repositories. Collection of Github dorks can reveal sensitive personal and/or organizational information such as private keys, credentials, authentication tokens, etc. This list is supposed to be useful for assessing security and performing pen-testing of systems. From 2395986e18ef75dfa7bc02df849660f2f0483b6d Mon Sep 17 00:00:00 2001 From: szTheory Date: Sun, 2 Feb 2025 00:40:55 -0500 Subject: [PATCH 5/6] CI simplify build --- .github/workflows/docker-build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index f243f8e..8476c21 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -27,11 +27,8 @@ jobs: - name: Test Docker image run: | - # Test the version flag + # Test the version flag with version flag docker run github-dorks:test -v - - # Basic test with a public repo (no auth needed) - docker run github-dorks:test -r techgaun/github-dorks -d github-dorks-test.txt - name: Verify image size run: docker image ls github-dorks:test From 21ed3923e445ccc4058375062608eb2387d29132 Mon Sep 17 00:00:00 2001 From: Divyaranjan Sahoo Date: Sun, 5 Oct 2025 20:47:01 +0530 Subject: [PATCH 6/6] chore(ci): add flake8 lint workflow and fix minor lint issue - Add GitHub Actions workflow to run flake8 on push and PR - Align Python version with Dockerfile (3.8) - Fix unused variable in exception handler to satisfy flake8 Refs: #59 --- .github/workflows/lint.yml | 28 ++++++++++++++++++++++++++++ github-dork.py | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..038f261 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,28 @@ +name: Lint (flake8) + +on: + push: + branches: [ "**" ] + pull_request: + branches: [ "**" ] + +jobs: + flake8: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.8' + + - name: Install flake8 + run: | + python -m pip install --upgrade pip + pip install flake8 + + - name: Run flake8 + run: | + flake8 . diff --git a/github-dork.py b/github-dork.py index 713cbc1..2941b04 100644 --- a/github-dork.py +++ b/github-dork.py @@ -28,7 +28,7 @@ def search_wrapper(gen): yield next(gen) except StopIteration: return - except github.exceptions.ForbiddenError as e: + except github.exceptions.ForbiddenError: search_rate_limit = gh.rate_limit()['resources']['search'] # limit_remaining = search_rate_limit['remaining'] reset_time = search_rate_limit['reset']