A powerful packet interceptor that captures network packets, holds them in a queue (chokes them), and releases them when the Left Alt key is pressed.
- 🔒 Packet Choking: Automatically queues incoming network packets
- 🔓 Manual Release: Press and hold Left Alt to release all queued packets
- 📊 Real-time Stats: Monitor queue size and packet flow status
- 🎯 Protocol Support: Supports ICMP, TCP, and UDP protocols
- 💻 Cross-platform: Works on Windows, Linux, and macOS
- Node.js 14+ and npm
- Administrator/Root privileges (required for raw socket access)
- Windows: Run PowerShell/CMD as Administrator
- Linux/Mac: Use
sudo
npm installnpm run devsudo npm run dev- Packet Capture: The application creates a raw socket to capture network packets (default: ICMP/ping packets)
- Packet Queuing: All captured packets are queued instead of being forwarded
- Manual Release:
- Press and hold Left Alt to release all queued packets
- Release Left Alt to start choking packets again
- Real-time Monitoring: View packet statistics every 5 seconds
To generate network traffic and test the interceptor:
- Start the packet interceptor (as administrator/root)
- In another terminal, run:
ping 8.8.8.8 - Watch as packets are queued
- Press Left Alt to release them
ts-packet-interceptor/
├── src/
│ ├── index.ts # Main application entry point
│ ├── PacketInterceptor.ts # Packet capture and queue management
│ ├── KeyboardListener.ts # Global keyboard event listener
│ └── types/
│ └── raw-socket.d.ts # TypeScript definitions for raw-socket
├── tsconfig.json # TypeScript configuration
├── package.json # Project dependencies and scripts
└── README.md # This file
npm run build- Compile TypeScript to JavaScriptnpm run start- Build and run the compiled applicationnpm run dev- Run the application directly with ts-nodenpm run clean- Remove the dist folder
- Uses raw sockets to capture network packets at the IP layer
- Maintains a queue with a maximum size of 10,000 packets
- Tracks packet metadata (source address, timestamp, length)
- Uses
node-global-key-listenerfor system-wide key detection - Specifically monitors Left Alt key press/release events
- Works even when the terminal is not in focus
- Make sure you're running with administrator/root privileges
- Windows: Right-click PowerShell → "Run as Administrator"
- Linux/Mac: Use
sudo npm run dev
- Try generating network traffic:
ping 8.8.8.8 - Check your firewall settings
- Ensure the network interface is active
- The keyboard listener should work system-wide
- Try pressing and holding Left Alt for 1-2 seconds
- Check console output for debug messages
This application requires elevated privileges to access raw sockets. Use with caution and only in controlled environments.
ISC
Feel free to submit issues and pull requests!