Skip to content

Driftnet

Driftnet is a network packet sniffing tool that captures images, audio, and video from network traffic in real-time. It passively listens to network traffic and extracts visual content transmitted over unencrypted protocols, making it valuable for security awareness and understanding the risks of unencrypted communications.

sudo apt-get update
sudo apt-get install driftnet
git clone https://github.com/deiv/driftnet.git
cd driftnet
./configure
make
sudo make install
sudo pacman -S driftnet
sudo driftnet -i eth0
sudo driftnet -i eth0 -d /path/to/output/directory

Capture from Specific Network Interface (Wireless)

Section titled “Capture from Specific Network Interface (Wireless)”
sudo driftnet -i wlan0
sudo driftnet -i eth0 -x
sudo driftnet -i eth0 -v
CommandDescription
-i <interface>Specify network interface to sniff (eth0, wlan0)
-d <directory>Save captured images to specified directory
-xRun in X11 mode with graphical display
-vVerbose output showing captured content info
-m <number>Maximum number of images to capture
-nCapture audio streams instead of images
-pInclude PPP connections in capture
-lListen-only mode (no X display)
sudo driftnet -i eth0
sudo driftnet -i eth0 -d ~/captured-images
sudo driftnet -i eth0 -l -d /tmp/images
ip link show
# Output shows available interfaces
sudo driftnet -i eth0
# Run separate instances for each interface
sudo driftnet -i eth0 -d /tmp/eth0-images &
sudo driftnet -i eth1 -d /tmp/eth1-images &
sudo driftnet -i eth0 -x -m 100

Driftnet captures visual content from the following unencrypted protocols:

ProtocolContent TypeDefault Port
HTTPWeb images, embedded media80
FTPFile transfers with images21
SMTPEmail attachments25
RTSPStreaming video554
MJPEGMotion JPEG streams8080
NNTPUsenet images119
# Demonstrate risks of unencrypted connections
sudo driftnet -i eth0 -d /tmp/demo-images
# Show captured content to employees
# Monitor suspicious network activity
sudo driftnet -i eth0 -v
# Analyze what content is being transmitted
# Identify unencrypted media transmission
sudo driftnet -i eth0 -l -d /tmp/pentest-results
# Study network traffic patterns
sudo driftnet -i eth0 -m 1000 -d /tmp/research
# Use tcpdump for more granular packet capture
sudo tcpdump -i eth0 -w packets.pcap
sudo driftnet -f packets.pcap
# Capture only VLAN traffic
sudo driftnet -i eth0.100 -d /tmp/vlan-images
# Use with arp-scan to identify subnet
sudo arp-scan -l
sudo driftnet -i eth0 -d /tmp/subnet-images
# Capture and immediately process images
sudo driftnet -i eth0 -x
# Images display in real-time window
# Driftnet requires root/sudo access
sudo driftnet -i eth0
# List available network interfaces
ip link show
# or
ifconfig
# Verify traffic is flowing
sudo tcpdump -i eth0 -c 10
# Check for HTTPS traffic (encrypted, won't be captured)
# Ensure directory exists and is writable
mkdir -p ~/driftnet-output
sudo driftnet -i eth0 -d ~/driftnet-output
# May need to change ownership after capture
sudo chown -R $USER ~/driftnet-output
  • Require authorization before monitoring network traffic
  • Comply with local privacy laws and regulations
  • Inform network users about monitoring policies
  • Document legal basis for network captures
# Only capture on networks you own or have permission to monitor
# Protect captured images containing sensitive information
# Store results securely with restricted access
sudo driftnet -i eth0 -d /tmp/images
# Encrypt sensitive captures
tar czf images.tar.gz /tmp/images
gpg -c images.tar.gz
  • Never share captured content without consent
  • Delete captures after analysis period
  • Implement access controls on captured data
  • Use VPN/HTTPS to protect personal traffic
# Monitor memory consumption
free -h
# Driftnet uses minimal memory per captured image
# Check CPU usage during capture
top -p $(pgrep driftnet)
# Usually low overhead for real-time capture
# Estimate storage needed
# Average image: 50-200 KB
# Plan accordingly: sudo driftnet -i eth0 -d /data/images
ToolPurposeCapture Type
DriftnetVisual content captureReal-time images
tcpdumpPacket captureRaw packets
WiresharkNetwork analysisDetailed packets
URLsnarfURL extractionText URLs
EttercapMITM attacksFull traffic
# Capture packets and extract images
sudo tcpdump -i eth0 -w capture.pcap
# Later analyze with driftnet
driftnet -f capture.pcap -d /tmp/images
#!/bin/bash
# Automated network monitoring
INTERFACE="eth0"
OUTPUT_DIR="/var/log/driftnet"
mkdir -p $OUTPUT_DIR
sudo driftnet -i $INTERFACE -d $OUTPUT_DIR -l

Driftnet is a powerful tool for demonstrating network security risks and understanding what content travels unencrypted across networks. Its real-time capture capabilities make it valuable for security training, threat detection, and network analysis. Always use ethically and legally within authorized network environments.