Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. CTF
  3. Dnscat2

Dnscat2

BSD-3-ClausePHP

A DNS-based encrypted command-and-control (C&C) tunnel for secure communication and data exfiltration.

GitHubGitHub
4.0k stars648 forks0 contributors

What is Dnscat2?

dnscat2 is a DNS tunneling tool that creates an encrypted command-and-control channel over the DNS protocol. It allows secure communication and data exfiltration from compromised or restricted networks by disguising traffic as legitimate DNS queries and responses. The tool is specifically designed for penetration testing and secure remote access scenarios.

Target Audience

Security professionals, penetration testers, and red team operators who need to establish covert communication channels in restricted network environments. It is also useful for researchers studying network security and DNS-based tunneling techniques.

Value Proposition

Developers choose dnscat2 for its strong default encryption, ability to bypass firewalls using DNS, and flexible deployment options. Unlike generic tunneling tools, it is optimized for command and control with features like session management, shell access, and port forwarding.

Overview

dnscat2 is a tool designed to create an encrypted command-and-control (C&C) channel over the DNS protocol. It enables secure communication and data tunneling out of restricted networks by leveraging DNS queries and responses, making it effective for penetration testing and secure remote access.

Key Features

  • Encrypted Communication — All traffic is encrypted by default using ECDH key exchange, Salsa20 encryption, and SHA3 signatures.
  • DNS Protocol Tunneling — Uses DNS queries/responses to bypass firewalls and network restrictions, appearing as normal DNS traffic.
  • Flexible Deployment — Supports both authoritative DNS server traversal (stealthy) and direct UDP connections (faster).
  • Session Management — Provides an interactive console with multiple windows for managing clients, shells, and tunnels.
  • Data Tunneling — Can tunnel any data, including file transfers, shell sessions, and TCP connections (via port forwarding).
  • Cross-Platform Client — The client is written in C with minimal dependencies, running on Linux, Windows, FreeBSD, and macOS.

Philosophy

dnscat2 is purpose-built for command and control, prioritizing encryption and flexibility over generic internet tunneling. It treats DNS as a transport layer, enabling robust, protocol-agnostic data exchange.

Use Cases

Best For

  • Establishing covert C&C channels in penetration tests
  • Bypassing network egress filters using DNS tunneling
  • Exfiltrating data from air-gapped or restricted networks
  • Remote shell access on compromised systems via DNS
  • Tunneling TCP traffic through DNS for internal network pivoting
  • Conducting red team exercises requiring stealthy communication

Not Ideal For

  • Networks with deep packet inspection that flags anomalous DNS query patterns or volume
  • Scenarios requiring high-bandwidth, low-latency data transfer like video streaming or large file syncs
  • Teams lacking control over DNS infrastructure to set up an authoritative server for stealthy operation
  • General-purpose internet tunneling for casual bypass of hotel or airport Wi-Fi restrictions

Pros & Cons

Pros

Strong Default Encryption

All traffic is encrypted by default using ECDH key exchange, Salsa20 encryption, and SHA3 signatures, providing secure communication without extra configuration, as detailed in the protocol section.

Effective Firewall Bypass

Uses DNS queries and responses to tunnel data, appearing as normal DNS traffic to bypass most egress filters, especially with authoritative server traversal, as emphasized in the overview.

Cross-Platform Client Portability

The client is written in C with minimal dependencies and compiles on Linux, Windows, FreeBSD, and macOS, making it deployable on diverse compromised systems, per the compilation instructions.

Flexible Session Management

Provides an interactive console with multi-window support for managing command sessions, shells, and port forwarding tunnels, similar to Metasploit, as shown in the windows and session examples.

Cons

Ruby Server Complexity

Setting up the server requires managing Ruby gems and dependencies, with noted issues like permission errors and the need for root or rvm, complicating deployment for non-Ruby experts.

Unaudited Custom Cryptography

The encryption scheme was designed by the author and lacks professional audit, raising potential security risks in high-stakes environments, as admitted in the encryption section.

Performance Overhead

DNS tunneling introduces latency and bandwidth limitations due to protocol polling and packet size constraints, making it unsuitable for real-time or high-speed data transfer, implied by its C&C focus.

Frequently Asked Questions

Quick Stats

Stars3,982
Forks648
Contributors0
Open Issues87
Last commit2 years ago
CreatedSince 2013

Tags

#red-teaming#penetration-testing#data-exfiltration#cybersecurity-tools#command-and-control#network-security#c-language#ruby#encrypted-communication

Built With

B
Bundler
R
Ruby
C
C++

Included in

CTF11.4k
Auto-fetched 2 hours ago

Related Projects

VolatilityVolatility

An advanced memory forensics framework

Stars8,053
Forks1,343
Last commit1 year ago
FibratusFibratus

Security sensor for realtime threat detection and protection

Stars2,557
Forks223
Last commit4 days ago
DVCS RipperDVCS Ripper

Rip web accessible (distributed) version control systems: SVN/GIT/HG...

Stars1,789
Forks314
Last commit2 years ago
USBRipUSBRip

Tracking history of USB events on GNU/Linux

Stars1,184
Forks112
Last commit4 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub