A comprehensive DNS tunneling simulator that enables you to create, monitor, and analyze DNS tunnel traffic. The system supports multiple popular DNS tunneling tools (dnscat2, iodine) through an extensible plugin architecture.
- Multiple DNS Tunnel Tools: Support for dnscat2, iodine, and extensible to more tools
- Docker Isolation: Each tunnel session runs in isolated Docker containers
- Traffic Capture: Automatic PCAP file generation for analysis
- Detailed Analysis: Extract DNS queries, subdomains, timing, and decoded data
- Web Interface: Modern React-based UI for tunnel management and traffic visualization
- REST API: Full-featured API for programmatic control
- Real-time Updates: WebSocket support for live traffic monitoring
- Extensible Architecture: Plugin-based system for adding new tunnel tools
┌─────────────────────────────────────────────────────────────┐
│ React Frontend │
│ - Tunnel configuration UI │
│ - Real-time traffic dashboard │
│ - PCAP viewer/download │
└────────────────────┬────────────────────────────────────────┘
│ WebSocket + REST API
┌────────────────────▼────────────────────────────────────────┐
│ FastAPI Backend │
│ - Tunnel management service │
│ - Docker container orchestration │
│ - Traffic capture & analysis │
│ - WebSocket for real-time updates │
└───┬──────────────┬──────────────┬───────────────────────────┘
│ │ │
┌───▼────┐ ┌─────▼─────┐ ┌────▼────────┐
│ Docker │ │ SQLite │ │ PCAP Storage│
│ Engine │ │ Database │ │ (/pcaps) │
└────────┘ └───────────┘ └─────────────┘
- Docker (version 20.10+)
- Docker Compose (version 2.0+)
- Python 3.11+ (for local development)
- Node.js 20+ (for local development)
- Clone the repository:
git clone <repository-url>
cd tunnel-sim- Start the application:
docker-compose up -d- Access the web interface:
http://localhost:3000
- Access the API documentation:
http://localhost:8000/docs
Backend:
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the backend
python -m app.mainFrontend:
cd frontend
# Install dependencies
npm install
# Run development server
npm run dev- Navigate to the web interface at
http://localhost:3000 - Click "Create Tunnel"
- Select a tool (dnscat2 or iodine)
- Configure parameters:
- Domain: The domain to use for tunneling (e.g.,
example.com) - Tool-specific settings: Port, passwords, etc.
- Domain: The domain to use for tunneling (e.g.,
- Click "Create"
- From the tunnel list, click "View" on a running tunnel
- View real-time traffic in the dashboard:
- Traffic Records: Tab showing all DNS queries/responses
- Subdomains: List of unique DNS subdomains used
- Statistics: Query types, volume, timing info
- Click on a tunnel to view its details
- Click the "Download PCAP" button
- PCAP files can be analyzed with Wireshark or other tools
Creates a secure command channel through DNS with support for encryption.
Parameters:
domain(required): Domain for tunnelingport(optional): DNS port (default: 53)secret(optional): Encryption passphrase
Tunnels full IPv4 traffic through DNS, creating a virtual network interface.
Parameters:
domain(required): Domain for tunnelingpassword(optional): Tunnel passwordmtu(optional): Maximum transmission unit (default: 1024)port(optional): DNS port (default: 53)
The simulator supports easy extension with new DNS tunneling tools. See docs/ADDING_TOOLS.md for detailed instructions.
Basic steps:
- Create a new tool class inheriting from
DNSTunnelTool - Implement required methods (get_name, build_server_command, etc.)
- Create Dockerfiles for server and client
- Register the tool in the registry
Interactive API documentation is available when running the backend:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
See docs/API.md for complete API reference.
tunnel-sim/
├── backend/ # Python FastAPI backend
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── core/ # Business logic
│ │ ├── models/ # Database models
│ │ ├── tools/ # DNS tunnel tool implementations
│ │ ├── main.py # FastAPI application
│ │ └── database.py # Database connection
│ ├── requirements.txt
│ └── Dockerfile
│
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API client
│ │ └── types/ # TypeScript definitions
│ ├── package.json
│ └── Dockerfile
│
├── docker/ # Docker infrastructure
│ ├── dnscat2/ # DNSCat2 Dockerfiles
│ └── iodine/ # Iodine Dockerfiles
│
├── docs/ # Documentation
│ ├── ARCHITECTURE.md # System architecture
│ ├── API.md # API documentation
│ └── ADDING_TOOLS.md # Tool extension guide
│
├── pcaps/ # Stored PCAP files
├── docker-compose.yml
└── README.md
- Architecture Overview - System design and component details
- API Reference - Complete API documentation
- Adding Tools Guide - How to extend with new tools
# Backend tests
cd backend
pytest
# Frontend tests
cd frontend
npm testTool images are built on-demand when creating tunnels. To manually build:
# Build dnscat2 server image
docker build -t tunnel-sim/dnscat2-server:latest -f docker/dnscat2/server/Dockerfile .
# Build iodine client image
docker build -t tunnel-sim/iodine-client:latest -f docker/iodine/client/Dockerfile .This tool is designed for:
- Educational purposes
- Security research and testing
- C2 (Command and Control) simulation in authorized environments
- Network traffic analysis training
Important: Use only on networks and systems you own or have explicit authorization to test.
- Ensure Docker daemon is running
- Check that ports 53, 8000, 3000 are available
- Verify Docker-in-Docker is working:
docker run hello-world
- Verify tcpdump is installed in containers
- Check PCAP directory permissions
- Ensure container has access to
/capturevolume
- Verify CORS settings in backend config
- Check API URL in frontend environment variables
- Ensure both services are on the same Docker network
Contributions are welcome! Areas for contribution:
- Additional DNS tunnel tool implementations
- Enhanced traffic analysis features
- UI/UX improvements
- Bug fixes and performance optimizations
This project is provided as-is for educational and research purposes.