The whole architecture you designed in the previous lesson — eleven VLANs, a matrix of twenty-one flows, a firewall that denies by default — rests on an assumption nobody writes down because it seems obvious: to connect to the network you have to plug something in somewhere. A cable, a wall socket, a switch port. If you control the ports, you control who gets in.

The radio medium makes that assumption disappear. The signal from the access point in the Zaragoza warehouse does not stop at the wall: it goes through the load-bearing wall, out into the car park and on to the street. Anybody with a laptop fifty metres away is, physically, as connected to the medium as the person sitting in the office. There is no door to close, and that is why all access control becomes exclusively cryptographic.

This lesson closes module 3, and it has an uncomfortable starting point that is real in most SMEs: the password for Rutalia's wifi is written in marker pen on a whiteboard in the Zaragoza warehouse, next to the incident board. It is Rutalia2020!, it has not been changed since 2019, and it is known by the 45 warehouse employees, the drivers, casual hauliers, suppliers' delivery staff, the technicians who maintain the cold stores and an indeterminate number of former employees. That password gets you straight onto the flat 10.10.0.0/16 network.

  1. Why the radio medium changes the threat model

Compare the two situations using the vocabulary of 01-01:

Wired network Wireless network
To observe the traffic you have to... Get physical access to a cable, a switch or a SPAN port Be within coverage. Nothing more
The attacker leaves a physical trace Yes: somebody has to enter the building No: they can be in a car in the car park
Limit of the reach The building and its cabling The propagation of the signal: tens of metres, more with a directional antenna
Access control Physical (doors, sockets) + 802.1X Cryptographic only
Impersonating the infrastructure It requires access to the comms cabinet Anybody can advertise the same network name
Detecting a failed attempt Hard Hard, and almost nobody tries

The penultimate row is the key to nearly every problem in this lesson. On a wired network, pretending to be the switch requires physical access to the cabinet. On a wireless network, pretending to be the corporate access point only requires advertising the same network name with more power. That asymmetry is structural: it is not fixed with more power or better antennas, but with mutual authentication.

There is a design consequence worth nailing down straight away, because it orders everything else:

A wireless network must always be treated as an untrusted network, the corporate one included. It must terminate at a point where policy is applied — the firewall of 03-04 — and never be connected to the same broadcast domain as the servers. At Rutalia, today, exactly the opposite happens: the wifi delivers the client straight onto the same network as Active Directory and the customer database.


  1. Wifi security standards: from WEP to WPA3

Standard Year Encryption Authentication Status and known weakness Recommendation
Open — None None All the traffic visible to anybody Only with a portal + isolation; better still, OWE
WEP 1997 RC4 with a 24-bit initialisation vector A shared key Broken since 2001: the design of the initialisation vector allows the key to be recovered by analysing traffic Prohibited. Finding it is a critical finding
WPA (TKIP) 2003 RC4 + TKIP PSK or 802.1X An emergency patch on top of WEP; known weaknesses Prohibited
WPA2-Personal 2004 AES-CCMP A shared PSK The encryption is solid; the weak point is the shared password and its exposure to offline analysis. KRACK (2017) fixed by firmware Acceptable only with a high-entropy password and rotation
WPA2-Enterprise 2004 AES-CCMP 802.1X/EAP Solid, except when the clients do not validate the authentication server's certificate Recommended for the corporate network
WPA3-Personal 2018 AES-CCMP/GCMP SAE It removes offline analysis of the password. Dragonblood (2019) affected specific implementations and was fixed Recommended wherever it is supported
WPA3-Enterprise 2018 AES-GCMP-256 (192-bit mode) 802.1X with mandatory suites — A medium-term objective
OWE (Enhanced Open) 2018 AES over an anonymous key agreement None It encrypts without a password, but it does not authenticate the access point For the guest network

Three observations worth being clear about:

  • WPA2 is not broken. AES-CCMP is still solid. What is fragile is the shared password authentication model, for two distinct reasons: the password can be subjected to offline analysis if it is guessable, and — most importantly in practice — a lot of people know it and nobody rotates it.
  • WPA3 is not "WPA2 with more bits". It changes the key agreement mechanism: SAE derives the key by means of a Diffie-Hellman style exchange authenticated with the password, which means trying candidates requires interacting with the network every time. It is a structural difference, not an incremental one.
  • The transition takes years. The warehouse radio frequency terminals, the IoT probes and the 2019 tablets do not support WPA3. Transition mode (WPA2+WPA3 on the same SSID) allows them to coexist, but a compatible client can be induced to negotiate WPA2, so while the transition lasts your real security is WPA2's. It is a stage with an end date, not a destination.

  1. WPA2-Personal: what it protects and where its limit lies

When a client associates with a WPA2-PSK network, both ends run an exchange of four messages (the 4-way handshake) that produces a session key.

sequenceDiagram
    participant C as Client
    participant AP as Access point
    Note over C,AP: Both know the PSK.<br/>The PMK is derived from it:<br/>PMK = PBKDF2(PSK, SSID, 4096 iterations)
    AP->>C: Message 1: the AP's random number
    Note over C: Generates its own random number and computes<br/>the session key (PTK) from<br/>PMK + both random numbers + both MACs
    C->>AP: Message 2: its random number + integrity code
    Note over AP: Computes the same key and<br/>verifies the integrity code
    AP->>C: Message 3: group key + integrity code
    C->>AP: Message 4: confirmation
    Note over C,AP: Traffic encrypted with AES-CCMP

You will recognise the pieces from module 2: PBKDF2 is a key derivation function like the ones in 02-03; the single-use random numbers are the nonces of 02-04; the integrity code is a relative of the HMAC of 02-05.

The two structural limitations of the PSK model

1. The password can be subjected to offline analysis. The messages of the exchange contain information derived from the password. Whoever observes an association has enough material to test candidates on their own machine, without touching the network again. That means there is no attempt limit, no account lockout, no logging and no possible detection. The only defence is that the password is out of reach of that testing.

The orders of magnitude, which are what should guide the policy:

Password Why Resistance
Rutalia2020! Company name + year + symbol: a pattern that appears in any candidate list None
almacen123 A common word + numbers None
8 random characters 62⁸ ≈ 2×10¹⁴ combinations Insufficient with modern hardware
20 random characters ~10³⁵ combinations Sufficient
5 random words (horse-prism-cloud-omelette-clock) ~10²³ combinations, and memorable Sufficient and practical

Derivation with 4096 iterations makes each test more expensive, but it does not save a password that appears among the first candidates on a list.

2. The key is shared, and that has two consequences. The first: whoever knows the PSK and has observed another client's association can derive its session key, so there is no confidentiality between colleagues within the same SSID. The second, more mundane and more serious at Rutalia: there is no identity. You do not know who connects, you cannot revoke one person without changing it for everybody, and every departure leaves the network compromised until the next rotation, which never comes.

The operational conclusion. WPA2-PSK is acceptable for a network of devices — warehouse terminals, probes — with a high-entropy password kept in the corporate manager and rotated at least annually. It is not acceptable for the network of people in a company with staff turnover: there the answer is 802.1X.


  1. WPA2/WPA3-Enterprise: 802.1X, RADIUS and EAP

802.1X solves both of the previous problems: authentication per user or per device, with different session keys for each one.

graph LR
    S[Supplicant<br/>Marta's laptop] -->|EAPOL<br/>over wifi| A[Authenticator<br/>ap-of-zgz02]
    A -->|RADIUS<br/>UDP 1812| R[Authentication server<br/>srv-rad01 - FreeRADIUS]
    R --> AD[Active Directory<br/>dc01 - A003]
    R -.->|Accept + VLAN 40| A
    A -.->|unique session keys| S
    style R fill:#d4edda,stroke:#155724
Actor Who it is at Rutalia Function
Supplicant The wifi client Presents credentials
Authenticator The access point It decides nothing: it carries the dialogue
Authentication server srv-rad01 (FreeRADIUS, 10.10.20.50) It decides, and it can return the assigned VLAN

What Rutalia gains:

  • Individual identity: you know who connected, when and from which access point. The RADIUS accounting log is a first-rate audit source and it does not exist today.
  • Immediate revocation: disabling somebody in Active Directory cuts off their wifi too, without affecting anybody else. It solves the former employee problem at the root.
  • Unique session keys: exposure between colleagues disappears.
  • Dynamic VLAN assignment: the server returns attributes that place the user in the VLAN corresponding to their AD group. It is the junction between the RBAC of 02-02 and the segmentation of 03-04.

EAP methods and the trap to avoid

Method Client credential Certificate on the server Main risk
EAP-TLS A client certificate Yes None of significance; the most secure
PEAP-MSCHAPv2 A username and password inside a TLS tunnel Yes If the client does not validate the server's certificate, the credentials are exposed to a fake authentication server
EAP-TTLS Several options Yes The same as PEAP
EAP-PWD A password with a secure agreement Not mandatory Poorly supported
LEAP Proprietary, old — Obsolete. Do not use

The PEAP row is worth pausing on, because it is where most organisations go wrong. The entire model depends on the client checking which server it is talking to before it sends its credentials. It is exactly the same principle you studied in the PKI of 02-05: without certificate validation, mutual authentication becomes one-way authentication and the attacker fills the gap.

The correct configuration, if PEAP is used, is applied by group policy and it has three parts:

  1. Enable validation of the server's certificate.
  2. Explicitly set the expected name of the server and the CA that issued it (Rutalia's internal CA).
  3. Disable the option that lets the user accept untrusted servers. If they are asked, they will accept.

Or, better, eliminate the problem: EAP-TLS with device certificates, where there is no password for a fake server to ask for. It is the option we will recommend to Rutalia, resting on the internal CA that has existed since module 2 and on the device certificates of phase 8 of the 03-04 roadmap.


  1. WPA3: SAE, OWE and the transition

WPA2-PSK WPA3-SAE
Offline analysis of the password Possible Unworkable: every test requires interacting with the network
Forward secrecy No: whoever knows the PSK compromises old observed sessions Yes
Confidentiality between users of the same SSID No Yes
Management frame protection (PMF, 802.11w) Optional Mandatory

The last row is more important than it looks. The 802.11 management frames (association, disconnection) were not authenticated, and that gap is the basis of client deauthentication attacks. PMF protects them, and with WPA3 it stops being optional. It is probably WPA3's most immediate practical improvement on a real network.

OWE solves a different problem: open networks. It establishes an anonymous key agreement, so that the traffic is encrypted even though there is no password, with a different key per client. What OWE does not do is authenticate the access point, so it does not protect against a fake network advertising the same name. Even so, for a guest wifi it is strictly better than an open network and it costs nothing to enable.


  1. Rutalia's wifi architecture: today and the proposal

What exists today

SSID Security Network it gives access to Who uses it
RUTALIA WPA2-PSK, Rutalia2020! since 2019 The whole of 10.10.0.0/16 Everybody: office, warehouse, tablets, personal mobiles, visitors
RUTALIA-INV WPA2-PSK, Invitados2021 Also 10.10.0.0/16 Visitors, and anybody who does not know the other one
(no SSID of its own) — — The 14 IoT probes are on RUTALIA
Finding Criticality Why
The PSK on a warehouse whiteboard, not rotated since 2019 CRITICAL Former employees and third parties know it; it is impossible to tell how many
Rutalia2020! is a predictable pattern CRITICAL It does not withstand candidate analysis
The guest wifi comes onto the internal network CRITICAL A visitor has the same reach as an employee
IoT probes on the same network as the servers CRITICAL Unpatched firmware and open telnet, next to the customer database (A005)
No 802.1X: there is no individual identity HIGH You do not know who connects and you cannot revoke one person
A home router in Valencia with its own wifi and the factory password (a finding from 03-01) CRITICAL A rogue access point that also hands out DHCP
No access point inventory and no rogue detection HIGH Nobody would detect a fake network impersonating the SSID
PMF disabled and WPS enabled on two access points HIGH Two known weaknesses that are closed with one click

The proposal

Four SSIDs, each anchored to a VLAN from the 03-04 design:

SSID VLAN Authentication Permitted access Devices
Rutalia-Corp 40 (Office) WPA2/3-Enterprise with EAP-TLS (device certificate); PEAP with strict validation only as a transitional step Servers on specific ports, DMZ:443, the internet via proxy The 25 office laptops and managed machines
Rutalia-ALM 50 (Warehouse) WPA3-Personal with a long random PSK, different per site, annual rotation; WPA2 transition while there are still old terminals srv-erp01:8080 and DMZ:443 only Radio frequency terminals, loading bay tablets
Rutalia-IoT 60 (IoT) Its own WPA2-PSK, client isolation enabled The telemetry collector only. No internet 14 probes (A006), cameras
Rutalia-Invitados 70 (Guests) OWE, or open with a portal if there are old devices The internet only, with a bandwidth limit and client isolation Visitors, personal mobiles
graph TB
    subgraph APs["Access points - 802.1Q trunk port"]
        AP1[ap-of-zgz01..04]
        AP2[ap-alm-zgz01..03]
        AP3[ap-alm-val01/02<br/>ap-alm-sev01]
    end
    C[Rutalia-Corp<br/>EAP-TLS] --> APs
    A[Rutalia-ALM<br/>WPA3-PSK] --> APs
    T[Rutalia-IoT<br/>PSK + isolation] --> APs
    G[Rutalia-Invitados<br/>OWE] --> APs
    APs --> FW[fw-zgz01]
    FW --> V40[VLAN 40 - Office]
    FW --> V50[VLAN 50 - Warehouse]
    FW --> V60[VLAN 60 - IoT<br/>no internet]
    FW --> V70[VLAN 70 - Guests<br/>internet only]
    R[srv-rad01<br/>FreeRADIUS + AD] -.->|authentication| APs
    style R fill:#d4edda,stroke:#155724
    style V60 fill:#fff3cd,stroke:#856404
    style V70 fill:#fff3cd,stroke:#856404

Three implementation details that are usually forgotten:

  1. The access points are connected on a trunk port with an explicit VLAN list (allowed vlan 40,50,60,70), never all, and with the native VLAN unused (a defence against VLAN hopping, 03-04).
  2. Each access point's management interface goes on VLAN 10. An AP whose administration panel is reachable from the guest wifi cancels out the entire design.
  3. All four SSIDs are broadcast from the same access points. No equipment needs buying: it is configuration.

  1. Specific attacks and their defences

Threat What it is What it achieves Defence
A compromised shared password Somebody who knows it — or who deduces it because it is predictable — connects Complete access to whatever that SSID gives 802.1X; with a PSK, high entropy, custody in the manager and rotation
Client deauthentication Manipulation of unauthenticated management frames It cuts off service and forces reconnections PMF/802.11w, mandatory in WPA3
Rogue access point Somebody connects an AP or a home router to the corporate network A back door that bypasses every control 802.1X on the wired ports, an inventory, a periodic sweep (03-01)
A fake network impersonating the SSID (evil twin) A machine advertises the same network name with more power It interposes itself in the traffic of whoever associates Validation of the RADIUS server's certificate, mandatory VPN off the premises, detection of unknown BSSIDs
A fake captive portal A login page identical to the legitimate one Corporate credentials Never use company credentials on portals; training (08-03)
WPS A PIN-based pairing mechanism with a known design flaw The network password Disable WPS. No exceptions
KRACK (2017) A flaw in the key reinstallation of the handshake Partial decryption Updated firmware on clients and access points
Open networks No encryption All the traffic exposed OWE on your own; a VPN on other people's

The fake network impersonating the SSID, in detail

It is the threat that most affects Rutalia's mobile staff, because devices reconnect on their own to the networks they remember.

sequenceDiagram
    participant D as Driver's tablet
    participant E as Fake network<br/>same name, more power
    participant R as Legitimate AP
    Note over D: The tablet remembers the SSID<br/>and associates automatically
    E->>D: Advertises the network with a strong signal
    D->>E: Association
    E->>D: DHCP: the attacker's IP, gateway and DNS
    Note over E: The attacker ends up as<br/>the intermediary for the traffic
    D->>E: Traffic towards mirutalia.example
    Note over D,E: TLS protects the content (02-05).<br/>The metadata is exposed,<br/>and anything not going over HTTPS.

Two honest observations:

  • If the tablet uses HTTPS with correct validation, the content is not read. All the work of module 2 and of 03-02 serves exactly this purpose: HSTS prevents downgrade to HTTP and an invalid certificate triggers a warning. A fake network does not break TLS.
  • What it does achieve is seeing the metadata — who the device talks to, when and how much — manipulating anything not encrypted and, above all, collecting credentials if the device tries to authenticate with PEAP without validating the server's certificate.

The defence for mobile staff is three combined measures: disable automatic reconnection to known networks off the premises, a mandatory VPN on any network that is not Rutalia's, and EAP-TLS on the corporate devices, so that there is no password to ask for.


  1. Controls that work and controls that do not

This table saves arguments. There are two measures that appear in every old manual and that are not security controls.

Measure Does it work? Explanation
SSID hiding NO The network name travels in the association frames of any legitimate client, so it does not stay hidden. And it makes the clients less secure: a device configured for a hidden network goes looking for it actively wherever it is, advertising its name, which makes impersonation easier rather than harder
MAC filtering NO MAC addresses travel in the clear and are changed with one command. It works as an inventory control, not an access control, and it generates a considerable management burden
Reducing the transmit power Partially Good design practice: it limits coverage outside the building. A directional antenna defeats it, so it is not a strong control
WPA3, or WPA2 with a high-entropy PSK YES It is the foundation
802.1X with EAP-TLS YES Individual identity, immediate revocation, no passwords to steal
Separation by SSID and VLAN YES It limits the reach of any compromise
Client isolation YES It stops one device talking to another on the same SSID. Essential for guests and IoT
PMF / 802.11w YES It authenticates the management frames and closes off a whole family of attacks
Disabling WPS YES It closes a known design flaw
Rogue access point detection YES The only way of finding out about an AP plugged in by an employee or a network impersonating your name
802.1X on the wired ports YES It stops somebody plugging their own access point into the corporate network

Why labour the point. SSID hiding and MAC filtering consume management time, generate support calls and produce a feeling of security that displaces the controls that do work. If you have two hours, spend them rotating the password and enabling client isolation, not hiding a network name.


  1. Practical configuration: annotated hostapd and FreeRADIUS

hostapd turns a Linux wifi interface into an access point. Even though Rutalia uses commercial access points, the parameters are the same: reading them here teaches you what to look for in any administration panel.

Rutalia-Corp (WPA2/3-Enterprise)

# /etc/hostapd/hostapd-corp.conf
interface=wlan0
driver=nl80211

# ---------- Identification and radio ----------
ssid=Rutalia-Corp
country_code=ES               # mandatory: it sets the legal channels and powers in Spain
ieee80211d=1
hw_mode=a                     # 5 GHz band: less interference and shorter reach outside
channel=36
ieee80211n=1
ieee80211ac=1

# ---------- Security ----------
wpa=2                         # RSN (WPA2/WPA3). Never 1 (original WPA with TKIP)
wpa_key_mgmt=WPA-EAP WPA-EAP-SHA256
# 802.1X only. By not including WPA-PSK, this SSID does NOT accept a shared
# password: either you have your own credential, or you do not get in.

wpa_pairwise=CCMP
rsn_pairwise=CCMP CCMP-256    # AES. No TKIP in any form.

ieee8021x=1                   # enables 802.1X
ieee80211w=2                  # PMF MANDATORY (1 = optional, 2 = mandatory)

# ---------- Authentication server ----------
auth_server_addr=10.10.20.50
auth_server_port=1812
auth_server_shared_secret=<a long random secret, different per AP>
acct_server_addr=10.10.20.50
acct_server_port=1813
acct_server_shared_secret=<another, different secret>
# Accounting records the start and end of each session: it is the audit
# trail of who was connected, when and on which AP.

# ---------- Dynamic VLAN ----------
dynamic_vlan=1                # 1 = use the VLAN RADIUS indicates
                              # 2 = REQUIRE RADIUS to indicate it (stricter)
vlan_file=/etc/hostapd/hostapd.vlan
vlan_tagged_interface=eth0    # trunk interface towards the switch

# ---------- Hardening ----------
wps_state=0                   # WPS DISABLED
ignore_broadcast_ssid=0       # SSID visible: hiding it adds nothing (section 8)
ap_isolate=0                  # allowed on the corporate one: printers, remote desktop
max_num_sta=60
disassoc_low_ack=1

Rutalia-IoT (its own PSK, isolated)

interface=wlan0
ssid=Rutalia-IoT
country_code=ES
hw_mode=g                     # 2.4 GHz: the probes do not support 5 GHz
channel=1

wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=<20+ random characters, held in the corporate manager>
rsn_pairwise=CCMP
ieee80211w=1                  # PMF optional: the old probes cannot take it as mandatory

ap_isolate=1
# ^ CLIENT ISOLATION: one probe cannot talk to another probe.
# If one is compromised, it cannot spread to the remaining thirteen.
# Combined with VLAN 60 having no internet egress, it is complete containment
# of an estate of devices that CANNOT be patched (07-03).

wps_state=0
max_num_sta=30

The password for this SSID is not written on any whiteboard: it lives in the corporate password manager and is entered during the provisioning of each probe, leaving a record of who did it and when.

FreeRADIUS with EAP-TLS

# /etc/freeradius/3.0/mods-enabled/eap  (fragment)
eap {
    default_eap_type = tls        # EAP-TLS: client certificate, no passwords

    tls-config tls-common {
        private_key_file = /etc/freeradius/certs/srv-rad01.key
        certificate_file = /etc/freeradius/certs/srv-rad01.pem
        ca_file          = /etc/freeradius/certs/rutalia-interna-ca.pem
        # ^ The internal CA from 02-05: only client certificates issued
        #   by it are accepted.

        check_crl = yes
        ca_path   = /etc/freeradius/certs/crl/
        # Active revocation: decommissioning a laptop throws it off the wifi
        # immediately. It requires keeping the CRL up to date (03-02).

        tls_min_version = "1.2"
        tls_max_version = "1.3"
        cipher_list = "HIGH:!aNULL:!MD5:!3DES"
    }
}
# /etc/freeradius/3.0/sites-enabled/default  (authorisation fragment)
authorize {
    eap
    ldap                                  # the user must still be active in AD
    if (notfound) { reject }

    # VLAN assignment by AD group: the junction between RBAC and segmentation
    if (LDAP-Group == "cn=wifi-oficina,ou=grupos,dc=rutalia,dc=example") {
        update reply {
            Tunnel-Type             = VLAN
            Tunnel-Medium-Type      = IEEE-802
            Tunnel-Private-Group-Id = "40"
        }
    }
    elsif (LDAP-Group == "cn=wifi-almacen,ou=grupos,dc=rutalia,dc=example") {
        update reply {
            Tunnel-Type             = VLAN
            Tunnel-Medium-Type      = IEEE-802
            Tunnel-Private-Group-Id = "50"
        }
    }
    else {
        update reply { Tunnel-Private-Group-Id = "99" }   # quarantine
    }
}

A check before going into production:

sudo freeradius -X       # debug mode: it prints every step of the authentication

This mode is the most useful diagnostic tool in the whole deployment: it shows which certificate the client presented, whether the chain validated, which AD group was resolved and which VLAN was returned.


  1. Diagnostics and inventory: iw, nmcli and rogue access point detection

Looking at the state of the connection

$ nmcli device wifi list
IN-USE  SSID               MODE   CHAN  RATE        SIGNAL  SECURITY
*       Rutalia-Corp       Infra  36    270 Mbit/s  84      WPA2 802.1X
        Rutalia-Invitados  Infra  36    270 Mbit/s  82      WPA3
        Rutalia-ALM        Infra  1     130 Mbit/s  47      WPA2
        FIBRA-A41C         Infra  6     130 Mbit/s  38      WPA2

The SECURITY column is the first one to look at: WPA2 802.1X indicates enterprise; a bare WPA2, a shared password; -- or WEP, a finding to be fixed the same day. And the last line is precisely the home router in Valencia that turned up in the 03-01 sweep.

$ iw dev wlan0 link
Connected to 04:f0:21:aa:31:02 (on wlan0)
        SSID: Rutalia-Corp
        freq: 5180
        signal: -47 dBm
        tx bitrate: 270.0 MBit/s
Item Security reading
04:f0:21:aa:31:02 BSSID: the access point's MAC. Check it against the inventory: an unknown BSSID broadcasting your SSID is the sign of an impersonated network
signal: -47 dBm The received power. The closer to 0 the better; below -75 dBm the connection is poor
freq: 5180 Channel 36, the 5 GHz band

Inventory and rogue access point detection

This is the detective control specific to wifi, and it is the analogue of the canaries of 03-03: a very low false positive ratio and zero cost.

#!/usr/bin/env python3
"""Compares the visible networks with Rutalia's access point inventory.
   Runs hourly, from a fixed machine at each site (cron)."""
import subprocess, re, sys, datetime

# Inventory: the BSSID (MAC of each radio) of every authorised access point
AUTHORISED_APS = {
    "04:f0:21:aa:31:02": "ap-of-zgz01 (5 GHz)",
    "04:f0:21:aa:31:03": "ap-of-zgz01 (2.4 GHz)",
    "04:f0:21:aa:32:02": "ap-of-zgz02 (5 GHz)",
    "04:f0:21:aa:41:02": "ap-alm-zgz01 (5 GHz)",
    # ... the complete inventory, maintained alongside the asset inventory
}
OWN_SSIDS = {"Rutalia-Corp", "Rutalia-ALM", "Rutalia-IoT", "Rutalia-Invitados"}

scan_output = subprocess.run(["iw", "dev", "wlan0", "scan"],
                             capture_output=True, text=True).stdout

alerts = []
for block in re.split(r"\nBSS ", "\n" + scan_output):   # one block per network seen
    m_bssid = re.match(r"([0-9a-f:]{17})", block)
    m_ssid  = re.search(r"SSID: (.*)", block)
    if not m_bssid or not m_ssid:
        continue
    bssid, ssid = m_bssid.group(1), m_ssid.group(1).strip()

    if ssid in OWN_SSIDS and bssid not in AUTHORISED_APS:
        alerts.append(f"CRITICAL: our own SSID '{ssid}' broadcast by an unknown "
                      f"device ({bssid})")
    elif bssid in AUTHORISED_APS and ssid not in OWN_SSIDS:
        alerts.append(f"WARNING: {AUTHORISED_APS[bssid]} is broadcasting an unexpected SSID '{ssid}'")

now = datetime.datetime.now().isoformat(timespec="seconds")
for a in alerts:
    print(f"[{now}] {a}")
sys.exit(1 if alerts else 0)    # a non-zero exit code -> cron sends an email

Notes on the script and its limits:

  • It detects the most dangerous case: one of your own SSIDs broadcast from a device that is not in the inventory. Like the canaries, it produces almost no false positives.
  • It requires keeping the BSSID inventory up to date. Changing an access point without updating the list generates an alert: a healthy incentive to keep the inventory current.
  • It does not detect a rogue access point broadcasting a different name and plugged into the wired network. For that, the correct controls are 802.1X on the switch ports and the periodic network sweep of 03-01, which is precisely what uncovered the home router in Valencia.

⚠️ An explicit legal warning

In Spain, accessing somebody else's wireless network without authorisation, intercepting its communications or interfering with it are criminal offences under articles 197 bis, 197 ter and 264 of the Spanish Criminal Code. That includes the neighbour's network, the hotel's, a customer's and a supplier's. There is no mitigation for technical curiosity or for "I was just testing".

In addition, capturing wireless traffic means processing personal data, with the obligations of the GDPR and — when it affects workers — those of prior notice and proportionality under the LOPDGDD, Spain's data protection act (06-03).

Any review requires, as a minimum:

  • Prior written authorisation from the network's owner, with a scope (which SSIDs, which locations), a time window and a named owner.
  • Explicit exclusion of tests that degrade service. Interfering with the warehouse wifi would stop the radio frequency terminals working and halt truck loading: it is a real operational incident, not a harmless test.
  • A plan for handling the data collected: minimisation, encryption, restricted access and a destruction date.
  • Notice to the workers' representatives when the review may affect their communications.

Active tests on your own network — and all the more so any offensive exercise — belong to a penetration testing engagement with its own contractual framework, which is the subject of 04-05. What follows is a configuration review, not an attack.

Within that framework, the review Diego carries out on 8 November 2026 — authorised in writing by Andrés Vidal, a window from 20:00 to 23:00, with no tests affecting service — answers seven configuration questions. It is a checklist you can reuse in any organisation:

# Question How it is answered Result at Rutalia
1 Which SSIDs do we really broadcast? An inventory from each site compared against the design Three, not two: FIBRA-A41C turns up, the home router in Valencia
2 Which security method does each one advertise? Reading the parameters advertised by each network RUTALIA and RUTALIA-INV: WPA2-PSK, PMF disabled, WPS enabled on two access points
3 Does the password meet the entropy policy? A documentary review of the password held on file No: a predictable pattern, not rotated since 2019, and written down somewhere visible
4 How far does the coverage reach? Measuring received power around the outside perimeter RUTALIA is received at -62 dBm in the public car park: enough to associate
5 Which network does each SSID deliver onto? Check the VLAN of the AP's port and the IP obtained All of them onto 10.10.0.0/16, the guest one included
6 Where are the APs' management interfaces? A network sweep and configuration inspection On the same user network, with factory credentials on three of them
7 Is there a BSSID inventory and rogue AP detection? A documentary review Neither of the two exists

The result and the prioritisation: of the seven points, five are fixed with configuration and at no cost (disable WPS, enable PMF, move management to VLAN 10, change the factory credentials, create the BSSID inventory). Point 3 requires a small project — rotating the password with a distribution procedure that does not write it on a whiteboard — and point 5, the segmentation project that is already under way.


  1. Bluetooth and other short-range technologies in the fleet

There is more radio at Rutalia than just wifi, and it is worth inventorying even though its risk is lower:

Technology Where it is at Rutalia Main risk Control
Bluetooth / BLE Barcode scanners paired with the tablets, the trucks' hands-free kits, warehouse scales Old pairings nobody reviews; devices permanently in visible mode; firmware vulnerabilities Pair only what is needed, disable visibility, review the list of paired devices at least once a year, keep the firmware updated
BLE beacons Position marking on the loading bay Beacon spoofing: falsifying the location of a load Do not use the beacon as the only source of truth for a decision with a financial impact
RFID / NFC Access cards for the premises Old technologies, cloneable at close range Cards with modern cryptography; two-factor in critical areas (the server room door, which today is held shut with a wedge)
Warehouse terminal radio Radio frequency terminals They are ordinary wifi clients: they inherit the problems of the SSID they connect to Their own SSID with VLAN 50 and access limited to the ERP
Probe telemetry Temperature probes (A006) Unsupported firmware, with a known cryptographic weakness Isolation: VLAN 60, no internet, with client isolation. Dealing with the device itself belongs to 07-03

The general rule for all of them is the same as for wifi: if you cannot secure the device, secure its environment. When the manufacturer publishes no updates — which is the case with the probes and with several cameras — network isolation is the only control left, and that decision has to be documented as an accepted risk with an owner and a review date (08-02).


  1. Good practice for mobile staff

Sixty drivers, five sales staff and a management team that travels: a good part of Rutalia's workforce regularly connects from networks it does not control. These are the rules, written so that they can go straight into the acceptable use policy (06-02) and into the training (08-03).

Situation What to do Why
Wifi at a motorway services, hotel or airport Use the mobile's data connection (tethered) rather than the open wifi; if the wifi is used, a mandatory VPN An open network offers no guarantee whatsoever about who operates it
Any network that is not Rutalia's The VPN always on before opening email or the portal It is the only way of recovering a trusted channel over a medium that is not
Login portals that ask you to register Never with corporate credentials. A personal email address or minimal details A fake portal is trivial to set up and very convincing
Remembered networks Disable automatic reconnection off the premises; delete saved networks periodically A device that looks for known networks makes impersonating them easier
The remote worker's home wifi WPA2/WPA3 with their own password (not the factory one), an updated router It is the segment where the corporate machine spends most of its time
Corporate devices Encrypted disk, automatic lock, updates up to date If it is lost or stolen, encryption is the only thing that protects it (04-01)
Tethering the mobile's connection With its own random password, not the default one A shared hotspot is an access point
On any certificate warning Never continue. Report it to [email protected] That warning is, frequently, the only sign of an interposition

One observation about the last row, which connects with module 2: the certificate system works only if nobody ignores the warnings. The whole PKI of 02-05 is cancelled out by one click on "continue anyway". That is why training is not a complement to the technical control: it is part of the technical control.


  1. Rutalia's plan, prioritised

# Action Cost Timescale Risk it reduces
1 Disable WPS on every access point and enable PMF where the estate supports it €0 1 day Two known and exploitable weaknesses
2 Change the factory credentials on the APs' administration panels €0 1 day Total control of the wifi infrastructure
3 Remove the home router in Valencia and replace it with a corporate AP ~€200 1 week A rogue access point that also hands out DHCP
4 Rotate the password for RUTALIA and RUTALIA-INV to a high-entropy one, held in the corporate manager; wipe the whiteboard €0 1 week Access by former employees and third parties
5 Separate the guest wifi onto VLAN 70 with client isolation €0 With phase 2 of 03-04 Visitors with access to the internal network
6 A dedicated SSID for IoT on VLAN 60, with isolation and no internet egress €0 With phase 3 of 03-04 Unpatched probes next to the servers
7 A BSSID inventory and an hourly detection script €0 2 days Impersonated networks and rogue APs
8 Move the APs' management to VLAN 10 €0 With phase 5 of 03-04 Reconfiguration of the wifi from the user network
9 srv-rad01 with FreeRADIUS integrated with AD; Rutalia-Corp with PEAP and strict validation by policy €0 (free software) 1 month A shared password on the network of people
10 EAP-TLS with device certificates for laptops and tablets, with the internal CA ~€0 3 months Credentials stolen via fake servers
11 A dedicated warehouse SSID per site, WPA3-Personal in transition €0 2 months The reach of the warehouse password
12 802.1X on the wired ports €0-500 6 months Access points and machines connected without authorisation
13 Replace the access points that do not support WPA3 or PMF €1,500-3,000 12 months It closes the transition and eliminates the downgrade

Total cost: less than €3,700, almost all of it in point 13, and the first eight points cost nothing. It is the same pattern we have seen throughout the module: most of the improvement lies in configuration and discipline, not in the budget.


Common Mistakes and Tips

Mistake 1: treating the corporate wifi as if it were the internal network. It is an untrusted network by nature: anybody within range is on the medium. Tip: have it always terminate at a point where policy is applied, never in the same broadcast domain as the servers.

Mistake 2: one single password for everything and forever. It is Rutalia's case: dozens of people know it, several of whom no longer work there. Tip: a password per purpose and per site, held in the corporate manager, with annual rotation and always when a sensitive departure occurs. And 802.1X for the network of people.

Mistake 3: hiding the SSID or filtering by MAC in the belief that they are controls. They are not, and they consume the time the real controls need. Tip: spend that effort on PMF, client isolation and separation by VLAN.

Mistake 4: deploying PEAP without forcing validation of the server's certificate. It is the most profitable mistake for an attacker in corporate environments. Tip: configure it by group policy, set the server name and CA, and remove the option for the user to accept unknown servers. Better still: EAP-TLS.

Mistake 5: leaving the access points' administration on the user network. Whoever controls the APs controls the whole wifi, including the ability to change its VLAN. Tip: a management VLAN and your own credentials from day one.

Mistake 6: forgetting the devices that cannot be updated. Probes, cameras, old terminals. They are never going to get better. Tip: their own SSID, an isolated VLAN, no internet, with client isolation, and the residual risk documented and accepted in writing.

Mistake 7: having no access point inventory. Without inventoried BSSIDs you cannot tell your network from one impersonating it. Tip: an inventory alongside the asset inventory and an automatic periodic check.

Mistake 8: staying in WPA2/WPA3 transition mode indefinitely. It is deployed "so as not to break anything" and then forgotten. Tip: a written end date and a list of the devices holding progress back.

Mistake 9: testing the wifi without written authorisation. Even if it is your own company's and even if you do it in good faith. Tip: prior authorisation, scope, window, exclusion of tests that degrade service, and a destruction plan for the data collected.

Mistake 10: not training mobile staff. All the cryptography in the world is cancelled out by one "continue anyway". Tip: three simple, memorable rules — mobile data rather than open wifi, the VPN always, never corporate credentials on a portal — repeated and practised.


Exercises

Exercise 1: choosing the authentication method for each case

For each of these five groups of Rutalia devices, decide the SSID, the VLAN, the authentication method and justify the choice, noting what trade-off it involves:

a) The 25 corporate laptops in the Zaragoza office. b) The 18 radio frequency terminals in the Valencia warehouse (2018 models, WPA2 only). c) The 14 cold store temperature probes. d) Employees' personal mobiles, which today connect to RUTALIA. e) An external auditor who will be in the office for two weeks and needs the internet and access to the MiRutalia logs.

Exercise 2: diagnosing an access point configuration

A supplier delivers this configuration for a new access point in the Sevilla warehouse:

ssid=RUTALIA
ignore_broadcast_ssid=1
wpa=1
wpa_key_mgmt=WPA-PSK
wpa_passphrase=Sevilla2026
wpa_pairwise=TKIP CCMP
ieee80211w=0
wps_state=2
macaddr_acl=1
accept_mac_file=/etc/hostapd/allowed
ap_isolate=0

a) Identify all the problems, ordered by severity. b) Two of the options were included "for security" and contribute nothing. Which ones, and why? c) Rewrite the configuration assuming the warehouse terminals only support WPA2.

Exercise 3: responding to a wifi incident

On a Monday morning, the access point detection script generates this alert from the Zaragoza office:

[2026-11-23T09:12:04] CRITICAL: our own SSID 'Rutalia-Corp' broadcast by an unknown device (a2:7b:11:04:9c:31)

At the same time, three employees report that "the wifi is behaving oddly" and that a warning has appeared asking them to accept a certificate.

a) What is in all probability happening? b) List the first five actions, in order, within the first hour. c) What information has to be preserved, and from which sources? d) Which two preventive measures would have reduced the impact, and which one would have eliminated the risk almost entirely?


Solutions

Solution 1

Case SSID VLAN Authentication Justification and trade-off
a) Office laptops Rutalia-Corp 40 WPA2/3-Enterprise with EAP-TLS They are managed machines: a device certificate from the internal CA can be deployed to them. It gives individual identity, immediate revocation and no password to steal. Trade-off: it requires maintaining the PKI (issuance, renewal, CRL), which is real work but already planned in 02-05
b) Valencia terminals (2018) Rutalia-ALM 50 WPA2-Personal, a high-entropy password specific to Valencia, annual rotation They do not support WPA3 or, predictably, 802.1X. The mitigation lies not in the method but in the reach: they only get to the ERP and the portal. Trade-off: no individual identity, and rotation means touching 18 devices
c) Cold store probes Rutalia-IoT 60 Their own WPA2-PSK + client isolation, with no internet egress They cannot be updated and they have a known cryptographic weakness. The only realistic defence is isolation. Trade-off: the device is assumed insecure and the residual risk is accepted in writing
d) Personal mobiles Rutalia-Invitados 70 OWE, with client isolation and a bandwidth limit They are not managed devices: they must not be on any internal network. Trade-off: none of significance; corporate access from a mobile, if it is authorised, goes via Microsoft 365 with MFA, not over the local network
e) External auditor Rutalia-Invitados 70, or a temporary segment OWE + a named account with an expiry for the logs It is an unmanaged device: it does not enter any working VLAN. Access to the logs is granted through the application with its own account and an automatic expiry date, and all its activity is logged. Trade-off: a little more friction for the auditor, in exchange for traceability

Solution 2

a) Problems, from most to least serious:

  1. wpa=1: original WPA, with TKIP. Obsolete and prohibited. It must be wpa=2.
  2. wpa_pairwise=TKIP CCMP: allowing TKIP keeps compatibility with broken cryptography open, and it only takes one client negotiating it.
  3. wps_state=2: WPS enabled, with a known design flaw that cancels out the protection of the password.
  4. wpa_passphrase=Sevilla2026: a predictable pattern (place name + year), exactly the same mistake as Rutalia2020!.
  5. ssid=RUTALIA: it reuses the single flat SSID instead of the new design's warehouse SSID, so the device would deliver onto the flat network.
  6. ieee80211w=0: PMF disabled; the management frames are left unprotected.
  7. ap_isolate=0 on a device SSID: it lets a compromised terminal talk to the others.
  8. country_code missing: it may lead to the use of channels or powers not permitted in Spain.

b) The two options included "for security" that contribute nothing are ignore_broadcast_ssid=1 (hiding the SSID) and macaddr_acl=1 with a permitted MAC list (MAC filtering). The first does not really hide the network name — it travels in legitimate clients' associations — and it also makes the devices less secure, as they go actively looking for that network wherever they are. The second relies on an identifier that travels in the clear and is trivially modifiable. Both generate management burden and support calls, and — most damagingly — they create the impression that the network is protected when the real problem lies in points 1 to 4.

c)

ssid=Rutalia-ALM
country_code=ES
hw_mode=g
channel=6

wpa=2                                   # RSN only
wpa_key_mgmt=WPA-PSK
wpa_passphrase=<20+ random characters, specific to Sevilla, in the manager>
wpa_pairwise=CCMP                       # AES exclusively, no TKIP
rsn_pairwise=CCMP
ieee80211w=1                            # PMF optional: the 2018 terminals
                                        # may not accept it as mandatory

wps_state=0                             # WPS disabled
ignore_broadcast_ssid=0                 # SSID visible: hiding it is not a control
macaddr_acl=0                           # no MAC filtering
ap_isolate=1                            # the terminals do not need to talk to each other
max_num_sta=30

And, outside the file: the access point's port configured as a trunk with VLAN 50 permitted, AP management on VLAN 10, and the fw-zgz01 rules limiting VLAN 50 to srv-erp01:8080 and to the DMZ on 443.

Solution 3

a) In all probability, a network impersonating the corporate SSID (evil twin): a device that is not in the inventory is advertising Rutalia-Corp on the premises. The certificate warning the users report is the characteristic sign: their laptops are trying to authenticate over 802.1X against a fake authentication server presenting a certificate not issued by Rutalia's internal CA. If any machine has validation misconfigured, its credentials may have been exposed.

b) The first five actions, in order:

  1. Warn the users immediately over an alternative channel (telephone, tannoy, in person): do not accept any certificate, disconnect from the wifi and use a cable or mobile data. It is the action that stops the exposure.
  2. Preserve the evidence: save the complete output of the scan with the suspect BSSID, the time and the received power, without restarting anything.
  3. Locate the source: measure the received power from several points to narrow down the location. A strong, stable signal suggests a device inside the building or very close to it.
  4. Check on srv-rad01 whether there have been anomalous failed authentications, and in Active Directory whether there is unusual access. Given reasonable doubt about credential exposure, force a password change for the affected users and review their active sessions.
  5. Open the incident formally and follow the procedure of 05-02: classify it, appoint an owner and record the timeline from the outset.

c) Information to preserve, with its source:

  • The detection script's log with the BSSID, the time and the power (the detection machine).
  • The day's RADIUS authentication and accounting logs: attempts, successes and failures by user and by AP (srv-rad01).
  • The Active Directory logs: authentications that are anomalous by time, origin or frequency (dc01/dc02).
  • The firewall logs for VLAN 40 in the affected window (fw-zgz01).
  • The statements of the three users: the exact time, what warning they saw, whether they accepted it. This last point is the most important information and the one that is lost if it is not collected while it is fresh.
  • If available, the CCTV recordings of the entrances in that time window.

d) Two preventive measures that would have reduced the impact:

  1. Strict validation of the RADIUS server's certificate forced by group policy, with no option for the user to accept: the laptops would have rejected the fake network silently, without exposing anything at all.
  2. Rogue access point detection with a more frequent check and an immediate alert, instead of an hourly one, to reduce the exposure window.

And the measure that would have eliminated the risk almost entirely: EAP-TLS with device certificates. With certificate-based authentication there is no password for a fake server to request, and the authentication is mutual: the client validates the server and the server validates the client. The fake network would still exist, but it would get absolutely nothing out of the corporate machines. It is exactly point 10 of the plan in section 14, and this incident is the argument for bringing it forward.


Conclusion

You have closed the module understanding why the radio medium is different: there is no door to close. The signal goes through the wall and reaches the car park, the attacker leaves no physical trace and impersonating the infrastructure no longer requires getting into a comms cabinet, only advertising the same network name with more power. Hence the design consequence that orders everything else: a wireless network is always treated as untrusted, the corporate one included, and it must terminate where policy is applied, never in the same broadcast domain as the servers.

You know the evolution of the standards and — more importantly — why each one failed: WEP because of the design of its initialisation vector, WPA because it was a patch on top of it, and WPA2 not because of its encryption, which is still solid, but because of its shared password model, with its two structural limitations: it is susceptible to offline analysis if it is predictable, and it provides no identity, so you cannot revoke one person without changing it for the whole company. You know that WPA3-SAE is a structural change and not an incremental one, that mandatory PMF is probably its most immediate practical improvement, that OWE encrypts open networks without authenticating them, and that transition mode leaves your real security at WPA2's level for as long as it lasts.

You have mastered 802.1X with its three actors and what it brings to Rutalia: individual identity, revocation from Active Directory, unique session keys and dynamic VLAN assignment, which is literally the junction between the RBAC of 02-02 and the segmentation of 03-04. You know the EAP methods and the trap that makes most corporate deployments fail — PEAP without validation of the server's certificate — and you know that EAP-TLS removes it at the root, resting on the PKI you built in 02-05.

You have Rutalia's wifi map in its two states: today, two SSIDs with 2019 passwords that deliver onto the flat network and fourteen probes living alongside the customer database; and the proposal, four SSIDs anchored to four VLANs, with the detail almost everybody forgets — the access points' management out of the user network. You can tell the real attacks and their defences apart, you know exactly what a network impersonating the SSID achieves and what it does not (it does not break TLS: it gets metadata and, if you let it, credentials), and you are clear about why hiding the SSID and filtering by MAC are not security controls, but they are a distraction from the ones that are.

You have read real hostapd and FreeRADIUS configurations line by line, understanding what each parameter does and why client isolation turns fourteen vulnerable probes into fourteen separate problems instead of one. You can diagnose with nmcli and iw, and you have an inventory script that detects the most dangerous case — your own SSID broadcast by a device that is not yours — with an almost nil false positive ratio, together with the honesty of acknowledging what that control does not cover. You know the legal framework that precedes any review — written authorisation, scope, window, exclusion of tests that degrade service, a data destruction plan — and you have a list of seven configuration questions reusable in any organisation, five of whose answers are fixed for free. And you have extended the reasoning to Bluetooth, beacons and access cards with the rule that sums up the module: if you cannot secure the device, secure its environment.


That closes Module 3. You started out unable to read ip r on a server and you finish with a complete network architecture: you understand how a packet travels and what is exposed at each layer (03-01); you know how to protect what travels with TLS, SSH, secure DNS and the three email records that close off domain spoofing (03-02); you know how to decide what may travel and how to find out about what should not, with firewall rules you have written yourself and detection signatures of your own (03-03); you have broken the flat 10.10.0.0/16 into eleven segments with their flow matrix and their phased plan, you have redesigned the VPN and you have put Zero Trust in its place (03-04); and here you have extended that whole design to the one medium where the boundary cannot be drawn with a cable. The network Rutalia's data travels over is no longer an open space: it is an architecture with boundaries, with policy and — for the first time — with visibility.

But a segmented network does not repair a vulnerable machine. In the 01-04 scenario, everything we have built in this module would have contained the disaster; none of it would have prevented the first click. The macro ran because macros were permitted; the loader installed itself because the user had local administrator rights; nobody detected it because the antivirus only looked at signatures; and the credentials were extracted from the memory of an unhardened operating system. Those are problems of the endpoints, not of the network.

Module 4 goes there. You will start with Operating System Security, where you will harden Windows and Linux properly: permissions, services, updates, disk encryption, group policies and the host firewall managed centrally across Rutalia's 140 machines — including, at last, the removal of local administrator rights from twelve administrative staff and the macro blocking that would have cut the attack off on its second day. After that will come malware defence and EDR, web application security — where we will finally take apart hypotheses H4 of injection and improper access in MiRutalia — the cloud where the nightly export to S3 lives, and the testing that lets you check whether all of this really works. The road is protected; now it is time to protect the endpoints.

© Copyright 2026. All rights reserved