Skip to content

md-sabeel/Dorkify

Repository files navigation

🔍 Dorkify

A full-stack web application for performing Google Dork searches. Dorkify allows users to search for specific file types, site sections, administrative pages, and more using Google's advanced search operators.

Features

Core Functionality

  • Google Dork Search: Perform advanced searches using Google dork operators
  • Responsive UI: Clean, modern interface that works on desktop and mobile
  • Dark Mode: Built-in dark/light theme toggle
  • Results Display: Shows title, link, and description for each result
  • Pagination: Multi-page result browsing (up to 5 pages)
  • Loading States: Visual feedback during searches
  • Error Handling: Clear error messages for network issues and blocking

Additional Features

  • Recent Searches: Automatically saves last 20 searches (client-side storage)
  • Popular Dorks: Predefined list of common Google dork operators
  • Input Validation: Query validation and reasonable limits
  • Clean Architecture: Flask backend with RESTful API
  • Safe Scraping: Respectful delays and user-agent rotation

Project Structure

Dorkify/
├── backend/
│   ├── __init__.py
│   ├── app.py              # Flask application and API endpoints
│   ├── search_engine.py    # Google search scraper implementation
│   └── data/
│       └── recent_searches.json  # Local search history storage
├── frontend/
│   ├── index.html          # Main HTML page
│   ├── css/
│   │   └── style.css       # Styling with dark mode support
│   └── js/
│       └── app.js          # Frontend application logic
├── requirements.txt        # Python dependencies
└── README.md              # This file

Prerequisites

  • Python 3.8+ - Download Python
  • pip - Usually comes with Python
  • Git (optional) - For cloning the repository
  • Google Custom Search API key - See Setup Guide

Quick Start

1. Clone or Download the Project

# If using Git
git clone <repository-url>
cd dorkify

# Or download and extract the project

2. Set Up Virtual Environment (Recommended)

Windows:

python -m venv venv
venv\Scripts\activate

macOS/Linux:

python3 -m venv venv
source venv/bin/activate

3. Configure Google Custom Search API

Dorkify uses Google's official Custom Search JSON API. To use it, you need to:

  1. Create a Google Cloud Project

    • Go to Google Cloud Console
    • Create a new project or select an existing one
    • Enable the "Custom Search API" (APIs & Services > Library > search for "Custom Search API")
  2. Create API Credentials

  3. Create a Custom Search Engine

    • Go to Programmable Search Engine
    • Click "Add" to create a new search engine
    • In "Sites to search", you can put *.com or leave it as required (you'll need to enable "Search the entire web" in settings)
    • After creation, go to Control Panel > Basics > enable "Search the entire web"
    • Copy the Search engine ID (also called CX)
  4. Configure Environment Variables

    • In the project root, copy .env.example to .env:
      cp .env.example .env
    • Edit .env and add your credentials:
      GOOGLE_API_KEY=your_actual_api_key_here
      GOOGLE_CX=your_actual_search_engine_id_here
      

Note: The free tier provides 100 queries per day. Monitor your usage in the Google Cloud Console. If you need more, enable billing (costs apply per query).

4. Install Dependencies

pip install -r requirements.txt

4. Run the Application

cd backend
python app.py

The application will start on http://localhost:5000

5. Open in Browser

Navigate to http://localhost:5000 in your web browser.

Using Dorkify

Basic Search

  1. Enter your dork query in the search box
  2. Click "Search" or press Enter
  3. Browse results with clickable links

Using Popular Dorks

Click any dork chip below the search box to automatically add it to your query. Combine multiple dorks for more precise searches.

Examples:

  • filetype:pdf cybersecurity - Find PDF files about cybersecurity
  • site:example.com filetype:xlsx - Find Excel files on a specific site
  • intitle:admin inurl:login - Find admin login pages

Pagination

Use the Previous/Next buttons to browse through multiple pages of results. Maximum 5 pages per search.

Recent Searches

Your 20 most recent searches are saved locally and appear in the "Recent Searches" section. Click any recent search to run it again.

Dark Mode

Click the moon/sun icon in the top-right corner to toggle between light and dark themes.

Google Dork Examples

Dork Operator Description Example
filetype: Search by file extension filetype:pdf
site: Search within a specific site site:github.com
intitle: Search in page titles intitle:admin
inurl: Search in URL inurl:login
intext: Search in page content intext:"confidential"
ext: Alternative for filetype ext:sql

Technical Implementation

Backend (Flask)

  • Framework: Flask 3.0.0 with Flask-CORS
  • Search Engine: Google Custom Search JSON API
    • Official API, reliable and no blocking
    • Requires API key and Custom Search Engine ID
    • 100 free queries/day (rate limits apply)
  • Data Storage: JSON file for recent searches
  • Endpoints:
    • GET / - Serves frontend
    • POST /api/search - Perform search
    • GET /api/recent - Get recent searches
    • GET /api/popular-dorks - Get popular dorks list
    • GET /health - Health check

Frontend (Vanilla JS)

  • No Framework: Pure JavaScript for lightweight operation
  • Responsive Design: Grid layouts and flexbox
  • CSS Variables: Easy theme switching
  • REST API: Async fetch for all operations
  • LocalStorage: Theme preferences

Search Engine

  • Google Custom Search API: Official API for reliable, unrestricted searching
  • Rate Limiting: Respects Google's API quotas (1-second delay between page requests)
  • Deduplication: Removes duplicate results across pages
  • Error Handling: Graceful handling of API errors and quota limits

Ethical Use & Disclaimer

Dorkify is designed for authorized security research and educational purposes only.

Important:

  • Only search systems you own or have explicit permission to test
  • Do not use to access unauthorized data or systems
  • Respect privacy and intellectual property
  • Use responsibly and ethically
  • Developers are not responsible for misuse

Troubleshooting

"Search is not configured" error

Cause: GOOGLE_API_KEY or GOOGLE_CX environment variables are not set.

Solution: Follow the Setup Guide to configure your Google Custom Search API credentials.

"Google API error" or quota exceeded

Cause: You've reached your daily query limit (100 free queries/day) or your API key is invalid.

Solutions:

  1. Check your API usage in Google Cloud Console
  2. Wait 24 hours for quota to reset
  3. Consider enabling billing for higher quotas
  4. Verify your API key and Custom Search Engine ID are correct

No results found

  • Try simpler queries first
  • Verify your dork syntax is correct
  • Some dorks may not return results depending on current web content
  • Check that your Custom Search Engine is configured to search the entire web (not just specific sites)
  • Ensure your Custom Search Engine has "Search the entire web" enabled in its settings

Port already in use

# Option 1: Kill process on port 5000 (Windows)
netstat -ano | findstr :5000
taskkill /PID <pid> /F

# Option 2: Run on different port
# Edit backend/app.py and change port=5000 to another number

Configuration

Adjusting Search Parameters

Edit backend/app.py:

searcher = GoogleCustomSearch(max_results=100)

You can modify max_results to limit the total number of results fetched across all pages. Note that each page request can return up to 10 results.

Customizing Popular Dorks

Edit backend/app.py - modify the popular_dorks list in the get_popular_dorks() function.

Development

Adding Features

  1. Backend: Modify backend/app.py or create new modules
  2. Frontend: Update frontend/js/app.js and frontend/css/style.css
  3. Test locally before deploying

API Response Format

{
  "success": true,
  "query": "filetype:pdf",
  "results": [
    {
      "title": "Document Title",
      "link": "https://example.com/doc.pdf",
      "description": "Description..."
    }
  ],
  "count": 42,
  "pages_fetched": 1
}

Deployment

Requirements for Production

  • WSGI Server: Use Gunicorn or uWSGI (not Flask dev server)
  • Reverse Proxy: Nginx or Apache
  • SSL Certificate: HTTPS required
  • Rate Limiting: Add request limiting
  • Caching: Implement Redis or similar
  • Monitoring: Log requests and errors

Deployment Checklist

  • Set debug=False in app.py
  • Configure production WSGI server
  • Set up reverse proxy with HTTPS
  • Add rate limiting middleware
  • Configure proper logging
  • Set up monitoring/alerts
  • Add authentication if needed
  • Use production-grade database (optional)

Example Gunicorn command:

gunicorn -w 4 -b 0.0.0.0:5000 backend.app:app

Security Considerations

  • Input validation on all API endpoints
  • Rate limiting to prevent abuse
  • Educational use only with proper authorization
  • Consider adding authentication for production
  • Sanitize all displayed content to prevent XSS
  • Use environment variables for sensitive config

Limitations

  • Google Custom Search API has a free quota of 100 queries per day (can be increased with billing)
  • Maximum 10 results per page, maximum start index of 91 (100 results max per query)
  • Search results limited to what Google's Custom Search Engine returns
  • No authentication required (could be added)
  • Stored searches saved locally only (could use database)
  • Maximum 5 pages per search (configurable in code)

Versions

  • v1.0 - Initial release
    • Basic Google dork search
    • Responsive UI with dark mode
    • Recent searches
    • Pagination
    • Popular dorks

License

MIT License - See LICENSE file for details

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes
  4. Test thoroughly
  5. Submit a pull request

Support

For issues, questions, or feature requests, please open an issue on GitHub.


Remember: With great power comes great responsibility. Use Dorkify ethically and only on systems you have permission to test.

Happy (ethical) hunting! 🔍

About

A full-stack web application for performing Google Dork searches. Dorkify allows users to search for specific file types, site sections, administrative pages, and more using Google's advanced search operators.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors