HORST(8)

HORST(8) β€” System Manager's Manual πŸ’–

okay bestie, this is the HORST(8) manual page, and we're gonna make it make sense. no cap. πŸ’…


🌸 NAME 🌸

horst β€” Highly Optimized Radio Scanning Tool ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

horst [-v] [-h] [-q] [-D] [-a] [-c file] [-C channel] [-i interface] [-t
sec] [-V view] [-d ms] [-b bytes] [-M file] [-s] [-u] [-N] [-n IP] [-p
port] [-o file] [-X name] [-x command] [-e mac] [-f pkt_name] [-m mode]
[-B BSSID]

πŸ”₯ DESCRIPTION πŸ”₯

horst is a small, lightweight IEEE802.11 wireless LAN analyzer with a text interface. Its basic function is similar to tcpdump, Wireshark or Kismet, but it's much smaller and shows different, aggregated information which is not easily available from other tools. It is mainly targeted at debugging wireless LANs with a focus on ad-hoc (IBSS) mode in larger mesh networks. It can be useful to get a quick overview of what's going on on all wireless LAN channels and to identify problems.

  • Shows signal values per station. πŸ“Ά
  • Calculates channel utilization ("usage") by adding up the amount of time the packets actually occupy the medium. ⏳
  • "Spectrum Analyzer" shows signal levels and usage per channel. 🌈
  • Text-based "graphical" packet history, with signal, packet type and physical rate. πŸ“œ
  • Shows all stations per ESSID and the live TSF per node as it is counting. πŸ‘€
  • Detects IBSS "splits" (same ESSID but different BSSID - this is a common driver problem). πŸ’”
  • Statistics of packets/bytes per physical rate and per packet type. πŸ“Š
  • Has some support for mesh protocols (OLSR and batman). πŸ¦‡
  • Can filter specific packet types, source MAC addresses or BSSIDs. 🎯
  • Client/server support for monitoring on remote nodes. πŸ›°οΈ
  • Can be controlled via a named pipe. πŸͺ„

See MONITOR MODE below for more information about the network interface setup.


πŸ’… OPTIONS πŸ’…

  • -v β€” Show version. ✨
  • -h β€” Show summary of options. 🫢
  • -q β€” Quiet mode. Don't show user interface. This is only useful in conjunction when running in server mode (-C) or writing to a file (-o). 🀫
  • -D β€” Show lot's of debugging output, including a full package dump. Only available when compiled with DEBUG=1. πŸ›
  • -a β€” Always add virtual monitor interface. Don't try to set existing interface to monitor mode. πŸ› οΈ
  • -c configfile β€” Use configfile instead of the default "/etc/horst.conf". πŸ“
  • -C channel β€” Set inital channel (number not frequency). πŸ“‘
  • -i intf β€” Operate on the given network interface instead of the default "wlan0". 🧡
  • -t sec β€” Timeout (remove) nodes after not receiving packets from them for this time in seconds (default: 60 sec). ⏰
  • -V view β€” Display 'view'. Valid view names are "history", "hist", "essid", "statistics", "stats", "spectrum", "spec". πŸ‘οΈ
  • -d ms β€” Display update interval. The default value of 100ms can be increased to reduce CPU load caused by redrawing the screen. πŸ–₯️
  • -b bytes β€” Receive buffer size. The receive buffer size can be set to tune memory consumption and reduce lost packets under load. 🧠
  • -M filename β€” MAC address to host name mapping file. The file can either be a dhcp.leases file from dnsmasq or contain mappings in the form "MAC<space>name" (e.g.: "00:01:02:03:04:05 test") line by line (default filename: /tmp/dhcp.leases). 🏷️
  • -s β€” Show a poor mans "spectrum analyzer". The same can be achieved by running horst as normal and pressing the button 's' (Spec); then 'c' (Chan) and 'a' (Automatically change channel). 🌈
  • -u β€” Upper channel limit for the automatic channel change. ⬆️
  • -N β€” Allow client connections. Server mode. Only one client connection is supported at the moment (default: off). πŸ–‡οΈ
  • -n IP β€” Connect to a horst instance running in server-mode at the specified IP address. 🌐
  • -p port β€” Use the specified port (default: 4444) for client/server connections. πŸ”Œ
  • -o filename β€” Write a information about each received packet into filename. Note that you can send to STDOUT by using -o /dev/stdout. See OUTPUT FILE FORMAT below. πŸ“
  • -X β€” Accept control commands on a named pipe (default /tmp/horst). πŸͺˆ
  • -X name β€” Accept control commands on a named pipe with given name or set pipe name used with -x. 🏷️
  • -x command β€” Send control command to another horst process who was started with -X and then exit. Multiple commands can be concatenated with ';'. Currently implemented commands are:
    • pause β€” Pause horst processing
    • resume β€” Resume horst processing
    • reset β€” Reset all history, statistics and views
    • channel=X β€” Set channel channel number
    • channel_scan=X β€” Automatically change channels (1 or 0)
    • channel_dwell=X β€” Set channel dwell time when automatically changing channel (ms)
    • channel_upper=X β€” Set max channel when automatically changing channel
    • outfile=X β€” Write to outfile named X. If the file is already open, it is cleared and re-openend. If filename is not specified ("outfile=") any existing file is closed and no file is written.
  • -e MAC β€” Filter all MAC addresses except these, to show only packets originating from the specified MAC addresses. This option can be specified multiple times. 🎯
  • -f pkt_type β€” Filter all packets except these. This option can be specified multiple times. For valid packet names see NAMES AND ABBREVIATIONS below. πŸ§ͺ
  • -m (AP|STA|ADH|PRB|WDS|UNKNOWN) β€” Only show/include packets and nodes of this mode. Note that the mode is infered by the information of packets we received and it may take some time until a node is properly classified. This option can be specified multiple times. 🏷️
  • -B BSSID β€” Only show/include packets which belong to the given BSSID. 🎯

πŸŽ€ TEXT USER INTERFACE πŸŽ€

The ncurses-based text interface tries to display a lot of information, so it may look confusing at first. Below we describe the different screens and options. 🫢

Main screen

The initial (main) screen is split into three parts. The upper area shows a list of aggregated "node" information, the most useful information about each sender which was discovered, one per line:

  • / β€” "Spinner" to show activity
  • Pk β€” Percentage of this node's packets in relation to all received packets
  • Re% β€” Percentage of retried frames of all frames this node sent
  • Cha β€” Channel number
  • Sig β€” Signal value (RSSI) in dBm
  • RAT β€” Physical data rate
  • TRANSMITTER β€” MAC address of sender
  • MODE β€” Operating Mode (AP, AHD, PRB, STA, WDS), see "NAMES AND ABBREVIATIONS"
  • ENCR β€” Encryption (WPA1, WPA2, WEP)
  • ESSID β€” ESSID
  • INFO β€” Additional info like "BATMAN", IP address...

The lower area shows a scrolling list of packets as they come in:

  • Cha β€” Channel number
  • Sig β€” Signal value (RSSI) in dBm
  • RAT β€” Physical data rate
  • TRANSMITTER β€” MAC address of sender
  • BSSID β€” BSSID
  • TYPE β€” Packet type, see "NAMES AND ABBREVIATIONS"
  • INFO β€” Additional info like ESSID, TFS, IP address...

The lower right box shows bar graphs for:

  • Signal of last received packet in green 🟒
  • bps β€” Bits per second of all received packets
  • Usage β€” Percentage of channel use

The lower edge is the menu and status bar, it shows which keys to press for other screens. The status shows ">" when horst is running or "=" when it is paused, then "F" when any kind of filter is active, the Channel, the monitor interface in use and the time. ⏱️

Pause ('p' or <space>)

Can be used to pause/resume horst. When horst is paused it will loose packets received in the mean time. 😭

Reset ('r')

Clears all history and aggregated statistical data. 🧹

History ('h')

The history screen scrolls from right to left and shows a bar for each packet indicating the signal level. In the line below that, the packet type is indicated by one character (See NAMES AND ABBREVIATIONS below) and the rough physical data rate is indicated below that in blue. πŸ’™

ESSID ('e')

The ESSID screen groups information by ESSID and shows the mode (AP, IBSS), the MAC address of the sender, the BSSID, the TSF, the beacon interval, the channel, the signal, a "W" when encrytoion is used and the IP address if known. 🏷️

Statistics ('a')

The statistics screen groups packets by physical rate and by packet type and shows other kinds of aggregated and statistical information based on packets. πŸ“Š

Spectrum Analyzer ('s')

The "poor mans spectrum analyzer" screen is only really useful when horst is started with the -s option or the "Automatically change channel" option is selected in the "Chan" settings, or the config option channel_scan is set. 🌈

It shows the available channels horizontally and vertical bars for each channel:

  • Signal in green 🟒
  • Physical rate in blue πŸ”΅
  • Channel usage in orange/brown 🟠

By pressing the 'n' key, the display can be changed to show only the average signal level on each channel and the last 4 digits of the MAC address of the individual nodes at the level (height) they were received. This can give a quick graphical overview of the distance of nodes. πŸ“

Filters ('f')

This configuration dialog can be used to define the active filters. πŸŽ›οΈ

Channel Settings ('c')

This configuration dialog can be used to change the channel changing behaviour of horst or to change to a different channel manually. πŸ“‘

Sort ('o')

Only active in the main screen, can be used to sort the node list in the upper area by Signal, Time, BSSID or Channel. πŸ”€

πŸŽ€ NAMES AND ABBREVIATIONS πŸŽ€

802.11 standard frames

Management frames

okay bestie, so every management frame has a lil one-letter code, right? here's the whole roster, no gatekeeping:

  • a β€” ASOCRQ, Association request
  • A β€” ASOCRP, Associaion response
  • a β€” REASRQ, Reassociation request
  • A β€” REASRP, Reassociation response
  • p β€” PROBRQ, Probe request
  • P β€” PROBRP, Probe response
  • T β€” TIMING, Timing Advertisement
  • B β€” BEACON, Beacon
  • t β€” ATIM, ATIM
  • D β€” DISASC, Disassociation
  • u β€” AUTH, Authentication
  • U β€” DEAUTH, Deauthentication
  • C β€” ACTION, Action
  • c β€” ACTNOA, Action No Ack

Control frames

the control girlies, they're short and sweet and lowkey carrying the whole network:

  • w β€” CTWRAP, Control Wrapper
  • b β€” BACKRQ, Block Ack Request
  • B β€” BACK, Block Ack
  • s β€” PSPOLL, PS-Poll
  • R β€” RTS, RTS
  • C β€” CTS, CTS
  • K β€” ACK, ACK
  • f β€” CFEND, CF-End
  • f β€” CFENDK, CF-End + CF-Ack

Data frames

the data frames, aka the ones actually doing the work πŸ’… (and yes, letters repeat, because the codes overlap β€” iykyk):

  • D β€” DATA, Data
  • F β€” DCFACK, Data + CF-Ack
  • F β€” DCFPLL, Data + CF-Poll
  • F β€” DCFKPL, Data + CF-Ack + CF-Poll
  • n β€” NULL, Null (no data)
  • f β€” CFACK, CF-Ack (no data)
  • f β€” CFPOLL, CF-Poll (no data)
  • f β€” CFCKPL, CF-Ack + CF-Poll (no data)
  • Q β€” QDATA, QoS Data
  • F β€” QDCFCK, QoS Data + CF-Ack
  • F β€” QDCFPL, QoS Data + CF-Poll
  • F β€” QDCFKP, QoS Data + CF-Ack + CF-Poll
  • N β€” QDNULL, QoS Null (no data)
  • f β€” QCFPLL, QoS CF-Poll (no data)
  • f β€” QCFKPL, QoS CF-Ack + CF-Poll (no data)
  • * β€” BADFCS, Bad frame checksum

Packet types

so this is like the 802.11 frames above but a glow-up β€” higher level, and it's a bit field, which means the types can overlap (like DATA + IP at the same time, iconic behaviour fr fr). it also scoops up more info: IP, ARP, BATMAN, OLSR, all of it πŸ¦‹

  • CTRL β€” 0x000001, WLAN Control frame
  • MGMT β€” 0x000002, WLAN Management frame
  • DATA β€” 0x000004, WLAN Data frame
  • BADFCS β€” 0x000008, WLAN frame checksum (FCS) bad
  • BEACON β€” 0x000010, WLAN beacon frame
  • PROBE β€” 0x000020, WLAN probe request or response
  • ASSOC β€” 0x000040, WLAN associaction request/response frame
  • AUTH β€” 0x000080, WLAN authentication frame
  • RTSCTS β€” 0x000100, WLAN RTS or CTS
  • ACK β€” 0x000200, WLAN ACK or BlockACK
  • NULL β€” 0x000400, WLAN NULL Data frame
  • QDATA β€” 0x000800, WLAN QoS Data frame (WME/WMM)
  • ARP β€” 0x001000, ARP packet
  • IP β€” 0x002000, IP packet
  • ICMP β€” 0x004000, IP ICMP packet
  • UDP β€” 0x008000, IP UDP
  • TCP β€” 0x010000, IP TCP
  • OLSR β€” 0x020000, OLSR protocol
  • BATMAN β€” 0x040000, BATMAND Layer3 or BATMAN-ADV Layer 2 frame
  • MESHZ β€” 0x080000, MeshCruzer protocol

Operating modes

this one's a bit field too, and it gets inferred from the packets that actually show up. so yeah, modes overlap β€” it's genuinely normal to see STA and PRB living together at the same time, no drama 🫢

  • AP β€” 0x01, Access Point (AP)
  • ADH β€” 0x02, Ad-hoc node
  • STA β€” 0x04, Station (AP client)
  • PRB β€” 0x08, Sent PROBE requests
  • WDS β€” 0x10, WDS or 4 Address frames
  • UNKNOWN β€” 0x20, Unknown e.g. RTS/CTS or ACK

πŸ›°οΈ MONITOR MODE πŸ›°οΈ

to capture and analyze 802.11 traffic, your interface has got to be in monitor mode. that's the whole vibe. you can either set it up manually beforehand like a responsible icon, or just let horst do it automatically at startup. heads up: you usually need root privileges to mess with an interface setup, so ✨sudo✨ is your friend.

horst should work with any wireless LAN card and driver that supports monitor mode, with either "prism2" or "radiotap" headers. that includes most modern mac80211-based drivers β€” we love to see it.

if the interface isn't already in monitor mode at startup, horst first tries to put it in monitor mode itself. if that fails (for example when the interface is already in use πŸ™ˆ), it adds a new virtual monitor interface called horst0 and uses that instead. that virtual monitor interface gets removed when horst exits, so no leftovers. but β€” and this is the important bit β€” changing the channel via a virtual monitor interface is not allowed by the wireless driver, so options -C and -s do not work when a virtual monitor interface is being used. periodt.

Examples of how to setup an interface manually:

Using iw:

iw wlan0 interface add mon0 type monitor

or

sudo iw wlan1 set type monitor
sudo iw wlan1 set channel 6

Using iwconfig:

iwconfig wlan0 mode monitor
iwconfig wlan0 channel 1
ifconfig wlan0 up

Using madwifi:

wlanconfig wlan0 create wlandev wifi0 wlanmode monitor

Using hostap:

iwconfig wlan0 mode monitor
iwpriv wlan0 monitor_type 1

πŸ“ NOTES πŸ“

signal values and ranges may differ between wireless drivers and versions. so don't come for horst if your numbers look different, okay? different drivers, different vibe πŸ’€


πŸ“ OUTPUT FILE FORMAT πŸ“

the format of the output file (that's the -o flag, bestie) is a comma separated list of the following fields, in the following order, one packet per line. no cap, that's the exact order:

  • timestamp β€” Local time, including microseconds (e.g. 2015-05-16 15:05:44.338806 +0300)
  • packet_type β€” 802.11 MAC packet type name as defined in the section "NAMES AND ABBREVIATIONS".
  • wlan_src β€” Source MAC address
  • wlan_dst β€” Destination MAC address
  • wlan_bssid β€” BSSID
  • pkt_types β€” Higher level packet name as defined in section "NAMES AND ABBREVIATIONS".
  • phy_signal β€” Signal strength in dBm
  • wlan_len β€” Packet length (MAC)
  • phy_rate β€” Physical data rate
  • phy_freq β€” Received while tuned to this frequency.
  • wlan_tsf β€” TFS timer value
  • wlan_essid β€” ESSID, network name
  • wlan_mode β€” Operating modes as defined in "NAMES AND ABBREVIATIONS".
  • wlan_channel β€” Channel number
  • wlan_wep β€” Encryption in use
  • wlan_wpa β€” WPA1 Encryption in use
  • wlan_rsn β€” RSN (WPA2) Encryption in use
  • ip_src β€” IP source address (if available)
  • ip_dst β€” IP destionation address (if available)

πŸ‘€ SEE ALSO πŸ‘€

go read these too, they're all part of the extended universe:


πŸ’– AUTHOR πŸ’–

horst was written by Bruno Randolf <br1@einfach.org>.

This manual page was written by Antoine BeauprΓ© <anarcat@debian.org>, for the Debian project (and may be used by others).


okay that's the whole page bestie, you made it to the end πŸŽ€ this was HORST(8), dated July 22, 2015 β€” go forth and monitor some packets, you absolute legend πŸ‘‘βœ¨