Skip to content

Commit af9295e

Browse files
authored
Merge pull request #61 from szTheory/feature/dockerfile
Feature/dockerfile
2 parents d50a677 + 2395986 commit af9295e

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed

.github/workflows/docker-build.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docker Build & Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
19+
- name: Build Docker image
20+
uses: docker/build-push-action@v5
21+
with:
22+
context: .
23+
load: true
24+
tags: github-dorks:test
25+
cache-from: type=gha
26+
cache-to: type=gha,mode=max
27+
28+
- name: Test Docker image
29+
run: |
30+
# Test the version flag with version flag
31+
docker run github-dorks:test -v
32+
33+
- name: Verify image size
34+
run: docker image ls github-dorks:test

Dockerfile

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Use Python 3.8 as base - this version has good compatibility with older packages
2+
FROM python:3.8-slim
3+
4+
# Set working directory
5+
WORKDIR /app
6+
7+
# Install git (needed for pip install from git repos)
8+
RUN apt-get update && \
9+
apt-get install -y git && \
10+
apt-get clean && \
11+
rm -rf /var/lib/apt/lists/*
12+
13+
# Copy only the necessary files
14+
COPY github-dork.py /app/
15+
COPY github-dorks.txt /app/
16+
COPY setup.py /app/
17+
COPY README.md /app/
18+
COPY requirements.txt /app/
19+
20+
# Install dependencies
21+
# Using the specific version of github3.py that's known to work
22+
RUN pip install --no-cache-dir github3.py==1.0.0a2 feedparser==6.0.2
23+
24+
# Set environment variables
25+
ENV PYTHONUNBUFFERED=1
26+
ENV PYTHONIOENCODING=UTF-8
27+
28+
# Create volume for potential output files
29+
VOLUME ["/app/output"]
30+
31+
ENTRYPOINT ["python", "github-dork.py"]

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![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)
2+
13
# Github Dorks
24

35
[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.
@@ -16,6 +18,24 @@ Clone this repository and run:
1618
pip install .
1719
```
1820

21+
### Docker Installation
22+
23+
You can also run github-dorks using Docker for a consistent environment:
24+
25+
```shell
26+
# Build the Docker image
27+
docker build -t github-dorks .
28+
29+
# Run with a GitHub token (recommended)
30+
docker run -e GH_TOKEN=your_github_token github-dorks -u someuser
31+
32+
# Run with username/password
33+
docker run -e GH_USER=your_username -e GH_PWD=your_password github-dorks -u someuser
34+
35+
# Save results to a CSV file
36+
docker run -v $(pwd)/output:/app/output -e GH_TOKEN=your_github_token github-dorks -u someuser -o /app/output/results.csv
37+
```
38+
1939
### Usage
2040

2141
```

0 commit comments

Comments
 (0)