A Node.js tool that uses Puppeteer to intercept and log all HTTP requests made by a browser during your interactions. Perfect for reverse engineering APIs and understanding how web applications communicate with their backends.
- 🌐 Opens a real browser window for manual interaction
- 📝 Logs all HTTP requests (GET, POST, PUT, DELETE, etc.)
- 📥 Captures response data including status codes and response bodies
- 💾 Saves everything to a structured JSON file
- 🔧 Generates curl commands for easy API replication
- ⚡ Real-time console logging of requests
- Install dependencies:
npm installnpm startnode interceptor.js example.com
# or
node interceptor.js https://example.com/login- Start the script - A browser window will open
- Navigate and interact - Go to any website, fill forms, click buttons, make logins, etc.
- Monitor in real-time - See all HTTP requests logged in your terminal
- Stop when done - Press
Ctrl+Cto stop and save all captured data
When you stop the script, it generates:
Complete structured data including:
- All requests with headers, POST data, timestamps
- All responses with status codes, headers, response bodies
- Combined request-response pairs
- Session metadata
Real-time log file that records:
- All HTTP requests and responses as they happen
- Timestamps for each event
- POST data and response bodies (when applicable)
- Session start and end markers
- Human-readable format for easy monitoring
- Login Flow Analysis: See exactly what credentials are sent and how authentication works
- API Discovery: Find hidden API endpoints used by web applications
- Form Submission: Understand complex form data structures
- AJAX Debugging: Capture dynamic requests made by JavaScript
- Authentication Reverse Engineering: See how tokens, cookies, and sessions work
[2024-01-15T10:30:45.123Z] ===== Puppeteer Request Interceptor Started =====
[2024-01-15T10:30:47.456Z] REQUEST POST https://api.example.com/login
[2024-01-15T10:30:47.457Z] POST_DATA {"username":"user","password":"pass"}
[2024-01-15T10:30:48.234Z] RESPONSE 200 POST https://api.example.com/login
[2024-01-15T10:30:48.567Z] REQUEST GET https://api.example.com/dashboard
[2024-01-15T10:30:49.123Z] RESPONSE 200 GET https://api.example.com/dashboard
[2024-01-15T10:31:15.789Z] ===== Session Ended - 2 requests, 2 responses =====
Generated curl command:
curl -X POST 'https://api.example.com/login' \
-H 'Content-Type: application/json' \
-H 'User-Agent: Mozilla/5.0...' \
-d '{"username":"user","password":"pass"}'- The browser runs in non-headless mode so you can see and interact with it normally
- All major HTTP methods are captured (GET, POST, PUT, DELETE, PATCH, etc.)
- Response bodies are captured for JSON and text content types
- Use the generated curl commands to test APIs independently
- Check the JSON file for detailed request/response analysis
- Monitor the
.logfile in real-time withtail -f intercepted_requests.log - The log file is written immediately as requests happen, useful for live monitoring
- If Puppeteer fails to install, try:
npm install puppeteer --unsafe-perm=true - On Linux, you might need:
sudo apt-get install -y chromium-browser - Make sure you have sufficient permissions to write files in the current directory