WiFi

The WiFi modules use a WiFi interface supporting monitor mode and packet injection in order to:

  • scan the 802.11 spectrum
  • perform deauthentication attacks on connected client stations
  • perform RSN PMKID based clientless attacks on vulnerable access points
  • automatically sniff and save key material either from complete WPA/WPA2 handshakes or PMKID packets.
  • send spoofed management beacons to create fake access points or fake client probes.

The interface only needs to support monitor mode and packet injection, it’ll be bettercap itself to switch it to the right mode, just make sure there aren’t other processes using the same wifi interface.

This modules are natively supported on macOS with the default interface en0. Just make sure the interface is not connected to any WiFi network and then start bettercap with:
sudo bettercap -iface en0

Commands

wifi.recon on

Start 802.11 wireless base stations discovery and handshakes/PMKID capture.

wifi.recon off

Stop 802.11 wireless base stations discovery.

wifi.clear

Clear all access points collected by the WiFi discovery module.

wifi.recon BSSID

Set 802.11 base station address to filter for.

wifi.recon clear

Remove the 802.11 base station filter.

wifi.assoc BSSID

Send an association request to the selected BSSID in order to receive a RSN PMKID key (use all, * or ff:ff:ff:ff:ff:ff to iterate for every access point).

wifi.deauth BSSID

Start a 802.11 deauth attack, if an access point BSSID is provided, every client will be deauthenticated, otherwise only the selected client (use all, * or ff:ff:ff:ff:ff:ff to deauth everything).

wifi.probe BSSID ESSID

Send a fake client probe with the given station BSSID, searching for ESSID.

wifi.show

Show current wireless stations list (default sorting by RSSI).

wifi.show.wps BSSID

Show WPS information about a given station (use all, * or ff:ff:ff:ff:ff:ff to select all).

wifi.recon.channel CHANNEL

Comma separated list of channels to hop on.

wifi.recon.channel clear

Enable channel hopping on all supported channels.

wifi.ap

Inject fake management beacons in order to create a rogue access point ( requires wifi.recon to run ).

Parameters

parameterdefaultdescription
wifi.interfaceIf filled, the module will use this interface instead of the one provided by the -iface argument or detected automatically.
wifi.regionBOSet the WiFi region to this value before activating the interface.
wifi.txpower30Set WiFi transmission power to this value before activating the interface.
wifi.rssi.min-200Minimum WiFi signal strength in dBm.
wifi.show.manufacturerfalseIf true, wifi.show will also show the devices manufacturers.
wifi.show.filterDefines a regular expression filter for wifi.show.
wifi.show.sortrssi ascDefines sorting field (rssi, bssid, essid, channel, encryption, clients, seen, sent, rcvd) and direction (asc or desc) for wifi.show.
wifi.show.sortascDefines sorting direction for wifi.show.
wifi.show.limit0If greater than zero, defines limit for wifi.show.
wifi.hop.period250If channel hopping is enabled (empty wifi.recon.channel), this is the time in millseconds the algorithm will hop on every channel (it’ll be doubled if both 2.4 and 5.0 bands are available).
wifi.handshakes.file~/bettercap-wifi-handshakes.pcapFile path of the pcap file to save handshakes to.
wifi.source.fileIf set, the wifi module will read from this pcap file instead of the hardware interface.
wifi.skip-brokentrueIf true, dot11 packets with an invalid checksum will be skipped.
wifi.assoc.skipComma separated list of BSSID to skip while sending association requests.
wifi.assoc.silentfalseIf true, messages from wifi.assoc will be suppressed.
wifi.assoc.openfalseSend association requests to open networks.
wifi.deauth.skipComma separated list of BSSID to skip while sending deauth packets.
wifi.deauth.silentfalseIf true, messages from wifi.deauth will be suppressed.
wifi.deauth.opentrueSend wifi deauth packets to open networks.
wifi.ap.ssidFreeWifiSSID of the fake access point.
wifi.ap.bssid<random mac>BSSID of the fake access point.
wifi.ap.channel1Channel of the fake access point.
wifi.ap.encryptiontrueIf true, the fake access point will use WPA2, otherwise it’ll result as an open AP.

Examples

Run bettercap using eth0 as the main interface but start the wifi module on wlan0 instead:

  1. sudo bettercap -iface eth0 -eval "set wifi.interface wlan0; wifi.recon on"

Keep deauthing clients from the access point with BSSID DE:AD:BE:EF:DE:AD every five seconds:

  1. > set ticker.period 5; set ticker.commands "wifi.deauth DE:AD:BE:EF:DE:AD"; ticker on

Use the ticker and wifi.recon modules to create a WiFi scanner (performing channel hopping on every supported frequency):

  1. > set ticker.commands "clear; wifi.show"; wifi.recon on; ticker on

Sort by BSSID and filter for BSSIDs starting with F4:

  1. > set wifi.show.sort bssid asc
  2. > set wifi.show.filter ^F4
  3. > wifi.show

Only recon on channels 1, 2 and 3:

  1. > wifi.recon.channel 1,2,3; wifi.recon on

Will send management beacons as the fake access point “Banana” with BSSID DE:AD:BE:EF:DE:AD on channel 5 without encryption:

  1. > set wifi.ap.ssid Banana
  2. > set wifi.ap.bssid DE:AD:BE:EF:DE:AD
  3. > set wifi.ap.channel 5
  4. > set wifi.ap.encryption false
  5. > wifi.recon on; wifi.ap