This Python tool helps detect API leaks within web pages, including JavaScript files. It identifies various API formats by scanning the HTML and linked JavaScript files for common patterns of API keys and tokens.
- Fetches and scans HTML content from a given URL.
- Extracts and scans linked JavaScript files.
- Identifies common API key patterns such as Google API keys, AWS keys, and generic API keys.
- Generates a report of found keys.
- Python 3.x
requests
librarybeautifulsoup4
libraryregex
library
-
Clone the repository:
git clone https://github.com/ cd /api-detector
-
Install the required Python libraries:
pip install requests beautifulsoup4 regex
-
Run the tool:
python api-detector.py
-
Enter the URL you want to scan when prompted.
$ python api-detector.py
Enter the URL to scan: https://example.com
Scanning https://example.com...
Found API keys:
Google API Key:
- AIzaSyD-3E4_aE6hMckjvP48e3FsdL3mDe
AWS Access Key ID:
- AKIAIOSFODNN7EXAMPLE