Passive sniffing in 802.11 networks
In this experiment, we will observe the level of confidentiality provided by four kinds of WiFi networks - an open WiFi network, a WEP network, a WPA2 network, and a WPA3-Personal network.
You will have to download and install Wireshark to run this experiment. You should do this before your reservation on the wireless testbed.
It should take about 120 minutes to run this experiment, but you will need to have reserved that time in advance. This experiment uses wireless resources, and you can only use wireless resources on COSMOS during a reservation.
To reproduce this experiment on COSMOS, you will need an account, and you will need to have joined a project. You should have already uploaded your SSH keys to your profile. Finally, you must have reserved time on the sb5 or sb6 testbed at COSMOS, and you must run this experiment during your reserved time.
Background
In public places, you may encounter WiFi networks that are password-protected, but the password is posted for everyone to see. Does this offer any protection over an unprotected network? In this lab, we'll investigate this further.
WiFi is a broadcast medium: every frame that a device sends can be received by any other WiFi device that is in range. An attacker does not have to join a network, or transmit anything at all, in order to record the frames that are sent on it. This is called passive sniffing, and since the attacker never sends anything, the users of the network have no way to notice it. Whether the attacker can read what she has recorded depends on how the network encrypts its frames, and on what the attacker knows.
We will try this with four kinds of network:
- An open network has no password, and does not encrypt frames.
- A WEP network encrypts frames using a key that is shared by every device on the network. WEP was part of the original 802.11 standard in 1997. It has other serious weaknesses that are not the subject of this experiment, and it should not be used anymore.
- A WPA2 network that uses a passphrase (WPA2-Personal) also has one secret that is shared by every device on the network. But each client encrypts its frames with a key of its own, which it sets up with the AP in a 4-way handshake when it joins.
- A WPA3-Personal network also has a passphrase that is shared by every device on the network. But before the 4-way handshake, each client and the AP use the passphrase in a key exchange called SAE (Simultaneous Authentication of Equals).
In each case, we will ask what a passive attacker can read if she does not know the key or passphrase, and what she can read if she does (as in a network with its password posted on the wall). For the WPA2 and WPA3-Personal networks, we will also ask whether it matters if the attacker was listening at the moment when the client joined the network, and whether an attacker who does not know the passphrase can recover it from what she captures.
Results
We observe that with an open WiFi network, a passive sniffer can read any traffic sent over the network:

In a WiFi network protected by WEP, the data is encrypted:

but if the attacker finds out the WEP key, she can decrypt it:

(note that the same frame, no. 2103, is highlighted in the two screenshots above.)
In a WiFi network protected by WPA2, the data is encrypted, and even with the WPA2 key the attacker cannot decrypt it:

However, if the attacker has captured the 4-way handshakes between AP and client when the client associates AND knows the WPA2 key, then the attacker can decrypt user traffic:

If the attacker does not know the passphrase, but has captured the 4-way handshake, she can recover it with an offline dictionary attack, as long as the passphrase is a common one.
In a WiFi network protected by WPA3-Personal, the data is encrypted, and the attacker cannot decrypt it even if she knows the passphrase AND has captured every message that the AP and client exchanged when the client joined the network. The same dictionary attack does not work against WPA3-Personal.
Run my experiment
This experiment uses four WiFi devices:
- an access point (AP)
- Alice and Bob, two clients of the AP, who will send messages to one another
- and Mallory, who will attempt to passively sniff communications between Alice and Bob.
You may run it on sb5 or sb6, both of which have two nodes with two WiFi NICs each (allowing us to create up to four WiFi devices). We will set up these devices in the following configuration:
The AP and Alice are on the same node, but they use separate WiFi cards, so every frame between them is sent over the air. The AP does not have an IP address in this experiment; it only relays frames between Alice and Bob. Mallory does not join the network at all. She only listens to the channel.
Prepare the testbed
At your reserved time, SSH with your username and associated keys into
sbX.cosmos-lab.orgwhere you substitute your sandbox number in place of X.
Load the baseline.ndz disk image onto both nodes:
# runs on sb5 or sb6 console
omf load -i baseline.ndz -t node1-1,node1-2(Note that the command above is all one line, and there are no spaces between the commas and the node names.)
After this process is finished, turn your nodes on:
# runs on sb5 or sb6 console
omf tell -a on -t node1-1,node1-2Open SSH sessions
Wait a few minutes for your nodes to boot. Then open five terminals, and SSH into the console of your sandbox with your username and keys in each one.
- In two of them, SSH from the console into node1-1 (using the username "root", for example:
ssh root@node1-1). We will call these the "AP" terminal and the "Alice" terminal. - In two more, SSH from the console into node1-2. We will call these the "Bob" terminal and the "Mallory" terminal.
- Leave the fifth terminal at the console. You will use it to retrieve files from the nodes.
Prepare the nodes
In the AP terminal (on node1-1) and in the Mallory terminal (on node1-2), install the software for running an AP, for joining a WiFi network, and for the dictionary attack that we will do later:
# runs in AP terminal and in Mallory terminal
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y hostapd wpasupplicant aircrack-ngThen, in the same two terminals, load the drivers for both WiFi cards, and set the regulatory domain:
# runs in AP terminal and in Mallory terminal
modprobe ath9k
modprobe iwlwifi
iw reg set USThen run
# runs in AP terminal and in Mallory terminal
iw devin each of these and verify that you see two interfaces, wlp3s0 (for the Atheros AR928X card) and wlp5s0 (for the Intel Centrino Advanced-N 6250). It may take a few seconds for both to appear.
Run an open WiFi network
In the AP terminal, create a configuration file for an open network. (The sb5 and sb6 sandboxes are in close enough proximity that their WiFi signals reach one another, so we use a sandbox-specific network name and WiFi channel. The SB variable is filled with the name of your sandbox, and the CH variable with the WiFi channel for your sandbox.)
# runs in AP terminal
SB=$(hostname -f | cut -d. -f2)
[ $SB = sb6 ] && CH=11 || CH=1
cat > hostapd-open.conf <<EOF
interface=wlp3s0
driver=nl80211
ssid=wifi-open-$SB
hw_mode=g
channel=$CH
EOFThen, run
# runs in AP terminal
hostapd hostapd-open.confto start the wireless AP. You should see wlp3s0: AP-ENABLED in the output. Leave this running.
In the Alice terminal and in the Bob terminal, run
# runs in Alice terminal and in Bob terminal
SB=$(hostname -f | cut -d. -f2)
ip link set wlp5s0 up
iw dev wlp5s0 connect wifi-open-$SBto connect to the network. You should see a line of output in the AP terminal like
wlp3s0: AP-STA-CONNECTED 00:23:15:81:fa:f0(with the client's MAC address) each time a client connects. Make sure both Alice and Bob have connected; run
# runs in Alice terminal and in Bob terminal
iw dev wlp5s0 linkon each. When the client is connected, the first line of the output says Connected to, followed by the MAC address of the AP, and the second line shows the name of the network. If it says Not connected. instead, run the iw dev wlp5s0 connect command again.
Also assign an IP address to each client. In the Alice terminal, run
# runs in Alice terminal
ip addr add 192.168.0.3/24 dev wlp5s0and in the Bob terminal, run
# runs in Bob terminal
ip addr add 192.168.0.4/24 dev wlp5s0In the Mallory terminal, put the Atheros card into monitor mode, and tune it to the channel that the AP uses:
# runs in Mallory terminal
iw dev wlp3s0 set type monitor
ip link set wlp3s0 up
SB=$(hostname -f | cut -d. -f2)
[ $SB = sb6 ] && CH=11 || CH=1
iw dev wlp3s0 set channel $CHIn monitor mode, a WiFi card passes every 802.11 frame that it receives on the channel to the operating system, including frames that belong to a network it has not joined. Then run
# runs in Mallory terminal
tcpdump -i wlp3s0 -w wifi-open.pcapto save all of these frames to a file. Leave this running.
Now we will pass some user data between Alice and Bob. In the Bob terminal, run
# runs in Bob terminal
netcat -l 4000and leave that running. In the Alice terminal, run
# runs in Alice terminal
netcat 192.168.0.4 4000to connect to Bob. Then, type a message into the terminal window on either Alice or Bob and hit Enter. You should see your message appear in the terminal of the other host.
Use Ctrl+C to stop the running processes in all four terminals. On node1-2, you should now have a file named wifi-open.pcap. Use scp to transfer this file to your own computer, and open it with Wireshark.
Note: To retrieve a file from a node on COSMOS, you need to use scp in two steps:- First, in the terminal that is logged in to the testbed console, transfer the file from the node to your home directory on the console:
# runs on sb5 or sb6 console
scp root@node1-2:/root/wifi-open.pcap .- Then, in a terminal on your own device (e.g. laptop), transfer the file from the testbed console to your device, substituting your own username and your sandbox number:
# runs on your own device
scp USERNAME@sbX.cosmos-lab.org:~/wifi-open.pcap .Look for the data packets containing the secret message - is the attacker, who is not connected to the network, able to see the data in plaintext? (Use the Wireshark filter bar to filter on Alice's and Bob's MAC addresses, to more easily find the relevant packets. Mallory captures each frame twice: once when the sender transmits it to the AP, and again when the AP relays it to the receiver.)
Run a WEP network
Next, we will repeat the experiment with a WEP network.
In the AP terminal, create a configuration file for a WEP network:
# runs in AP terminal
SB=$(hostname -f | cut -d. -f2)
[ $SB = sb6 ] && CH=11 || CH=1
cat > hostapd-wep.conf <<EOF
interface=wlp3s0
driver=nl80211
ssid=wifi-wep-$SB
hw_mode=g
channel=$CH
auth_algs=2
wep_default_key=0
wep_key0="12345"
EOFthen run
# runs in AP terminal
hostapd hostapd-wep.confAnd in the Alice terminal and in the Bob terminal, run
# runs in Alice terminal and in Bob terminal
SB=$(hostname -f | cut -d. -f2)
iw dev wlp5s0 connect wifi-wep-$SB auth shared key 0:12345to connect to the network. Watch the terminal output on the AP and make sure you see the "AP-STA-CONNECTED" message for each client. (You can also check with iw dev wlp5s0 link, and if a client is not connected, run the iw dev wlp5s0 connect command again.) Alice and Bob still have the IP addresses that you assigned earlier, 192.168.0.3 and 192.168.0.4, so you do not need to assign them again.
In the Mallory terminal, the wireless interface should still be in monitor mode from the previous experiment. So we need only run
# runs in Mallory terminal
tcpdump -i wlp3s0 -w wifi-wep.pcapNow we will pass some user data between Alice and Bob. In the Bob terminal, run
# runs in Bob terminal
netcat -l 4000and leave that running. In the Alice terminal, run
# runs in Alice terminal
netcat 192.168.0.4 4000to connect to Bob. Then, type a message into the terminal window on either Alice or Bob and hit Enter. You should see your message appear in the terminal of the other host.
Use Ctrl+C to stop the running processes in all four terminals.
From node1-2, transfer the file wifi-wep.pcap to your own computer, and open it with Wireshark. Look for the data packets containing the secret message - is the attacker able to see the data in plaintext when the attacker does not know the WEP key? (Use the Wireshark filter bar to filter on Alice's and Bob's MAC addresses, to more easily find the relevant packets.)
If the attacker later finds out the WEP key, will she be able to decrypt the traffic?
In Wireshark, add the key for the WEP network and see if it is able to decrypt the packets. The following instructions are for Wireshark version 2.2.6, but should work with minor modifications for other versions of Wireshark:
- Open the "Preference" menu with "Edit > Preferences", then in the "Protocols" section choose "IEEE 802.11".
- Click on the "Edit" button next to "Decryption Keys".
- Then click on the "+" to add a key.
- Set the type of key to WEP, and then enter the WEP key in hex format -
31:32:33:34:35- so that it looks something like this:

Hit OK, and close Wireshark. Then open the packet capture again, and find the relevant packets. Look for a "Decrypted WEP data" tab on the bottom, and see if the attacker is able to read the message sent between Alice and Bob.
Run a WPA2 network
Next, we will try the experiment again for a WPA2 network.
In the AP terminal, create a configuration file for a WPA2 network:
# runs in AP terminal
SB=$(hostname -f | cut -d. -f2)
[ $SB = sb6 ] && CH=11 || CH=1
cat > hostapd-wpa.conf <<EOF
interface=wlp3s0
driver=nl80211
ssid=wifi-wpa-$SB
hw_mode=g
channel=$CH
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=123456789
EOFthen run
# runs in AP terminal
hostapd hostapd-wpa.confto start the AP.
In a WPA2 network using a pre-shared key, a binary key is derived from a combination of the SSID and the passphrase, using the PBKDF2 key derivation function. The wpa_passphrase tool is used to generate a config file which includes the SSID and this binary key. To use it, in the Alice terminal and in the Bob terminal, run
# runs in Alice terminal and in Bob terminal
SB=$(hostname -f | cut -d. -f2)
wpa_passphrase wifi-wpa-$SB 123456789 > wpa.confYou can inspect the contents of this configuration file with
# runs in Alice terminal and in Bob terminal
cat wpa.confand notice the binary key. For example, on sb6:
network={
ssid="wifi-wpa-sb6"
#psk="123456789"
psk=44626b6493b787d7140875bc605dda9347fae8717ba4c26ee18b3c380c721392
}
The key depends on the SSID, so it is not the same on sb5 as on sb6. Make a note of the key in your own wpa.conf; you will need it later.
Then, to connect to the network, in the Alice terminal and in the Bob terminal, run
# runs in Alice terminal and in Bob terminal
wpa_supplicant -i wlp5s0 -c wpa.conf -BWatch the terminal output on the AP and make sure you see the "AP-STA-CONNECTED" message for each client. It may take a few seconds. (You can also check with iw dev wlp5s0 link.) Alice and Bob still have the IP addresses 192.168.0.3 and 192.168.0.4.
Note: the WPA supplicant utility will remain running as a background process, and will attempt to reconnect if the client is disconnected from the network. Be careful not to run it more than once - if you have two supplicants running at the same time, they will conflict and cause connectivity issues.
In the Mallory terminal, the wireless interface should still be in monitor mode from the open network experiment. So we need only run
# runs in Mallory terminal
tcpdump -i wlp3s0 -w wifi-wpa.pcapNow we will pass some user data between Alice and Bob. In the Bob terminal, run
# runs in Bob terminal
netcat -l 4000and leave that running. In the Alice terminal, run
# runs in Alice terminal
netcat 192.168.0.4 4000to connect to Bob. Then, type a message into the terminal window on either Alice or Bob and hit Enter. You should see your message appear in the terminal of the other host.
Use Ctrl+C to stop the running processes in all four terminals. (The WPA supplicant is still running in the background on Alice and Bob.)
From node1-2, transfer the file wifi-wpa.pcap to your own computer, and open it with Wireshark. Look for the data packets containing the secret message - is the attacker able to see the data in plaintext?
Let us add the WPA2 key to Wireshark, to see if the attacker will be able to decrypt the traffic given the key. Open the "Decryption Keys" menu, and add a key with type "wpa-psk". For its value, use the binary key from your wpa.conf file (this is the key derived from the combination of SSID and passphrase). It should look like this, with your own key in place of the one that is shown:

Press "OK" and re-open the WPA2 packet capture. Is Mallory able to read the message in plaintext?
In the WPA2 network, an attacker needs to have captured the client's 4-way handshake in order to read data sent by the client over the network. Let's try again, in a scenario where Mallory is able to start capturing before Alice and Bob join the network.
In the Alice terminal and in the Bob terminal, run
# runs in Alice terminal and in Bob terminal
killall wpa_supplicantto stop the WPA supplicant process.
In the Mallory terminal, start capturing traffic with
# runs in Mallory terminal
tcpdump -i wlp3s0 -w wifi-wpa-with-handshake.pcapThen, in the AP terminal, run
# runs in AP terminal
hostapd hostapd-wpa.confagain. Then in the Alice terminal and in the Bob terminal, run
# runs in Alice terminal and in Bob terminal
wpa_supplicant -i wlp5s0 -c wpa.conf -BWatch for the "AP-STA-CONNECTED" message to appear with Alice's and Bob's MAC addresses in the AP terminal output. Run netcat again on Alice and Bob and send a message from one to the other. Then, use Ctrl+C to stop the running processes in all four terminals.
From node1-2, transfer the file wifi-wpa-with-handshake.pcap to your own computer, and open it with Wireshark. First, use the "eapol" Wireshark filter and make sure that the 4-way handshakes between the AP and Alice and between the AP and Bob are captured:

Then, look for the data packets containing the secret message, and specifically look for a "Decrypted CCMP data" tab on the bottom - is Mallory able to read the data if she has captured the 4-way handshakes?
Recover the passphrase with a dictionary attack
So far, we have assumed that the attacker already knows the passphrase. But what if she has captured the 4-way handshake, and does not know the passphrase? She can try to recover it, without ever joining the network, using an offline dictionary attack. She guesses a passphrase, derives the key from it and the SSID, and checks whether that key is consistent with the handshake she captured. She can try as many guesses as she likes, as fast as her computer allows, and if one of her guesses is correct, she learns the passphrase and can decrypt the traffic.
We will try this on the wifi-wpa-with-handshake.pcap capture, using the aircrack-ng tool. We do this on the Mallory node, where the capture file already is, so there is no need to transfer it first.
First, in the Mallory terminal, create a small wordlist of candidate passphrases:
# runs in Mallory terminal
cat > wordlist.txt <<EOF
password
letmein
12345678
123456789
qwerty
secretpassword
EOFThen run aircrack-ng on the capture, with the BSSID of your AP:
# runs in Mallory terminal
aircrack-ng -w wordlist.txt -b 00:15:6D:84:FB:7A wifi-wpa-with-handshake.pcap(substitute the BSSID of your own network). aircrack-ng tries each passphrase in the wordlist against the captured handshake. Since our passphrase, "123456789", is in the wordlist, it finds the key almost immediately:
Aircrack-ng 1.7
[00:00:00] 1/6 keys tested (116.00 k/s)
Time left: 0 seconds 16.67%
KEY FOUND! [ 123456789 ]
Master Key : 44 62 6B 64 93 B7 87 D7 14 08 75 BC 60 5D DA 93
47 FA E8 71 7B A4 C2 6E E1 8B 3C 38 0C 72 13 92
Once the attacker has the key, she can decrypt the traffic in Wireshark, exactly as we did above. A real wordlist is much larger than ours, with millions of common passwords, but it is still far smaller than the number of possible passphrases. The attack works because our passphrase is a weak, common one; a long, random passphrase would not be in any wordlist, and would take far too long to guess.
Run a WPA3-Personal network
Finally, we will try the experiment again for a WPA3-Personal network, with the same passphrase. This time, Mallory will know the passphrase, and she will be listening from before Alice and Bob join the network.
In a WPA3-Personal network, the key is not derived from the SSID and the passphrase alone. When a client joins, the client and the AP first use the passphrase in a key exchange called SAE: each one sends a commit message and then a confirm message. Then, they do a 4-way handshake, as in a WPA2 network.
In the Alice terminal and in the Bob terminal, run
# runs in Alice terminal and in Bob terminal
killall wpa_supplicantto stop the WPA supplicant process from the previous part.
In the AP terminal, create a configuration file for a WPA3-Personal network:
# runs in AP terminal
SB=$(hostname -f | cut -d. -f2)
[ $SB = sb6 ] && CH=11 || CH=1
cat > hostapd-wpa3.conf <<EOF
interface=wlp3s0
driver=nl80211
ssid=wifi-wpa3-$SB
hw_mode=g
channel=$CH
auth_algs=1
wpa=2
wpa_key_mgmt=SAE
rsn_pairwise=CCMP
sae_password=123456789
EOFIn the Mallory terminal, start capturing traffic with
# runs in Mallory terminal
tcpdump -i wlp3s0 -w wifi-wpa3.pcapThen, in the AP terminal, run
# runs in AP terminal
hostapd hostapd-wpa3.confto start the AP.
In the Alice terminal and in the Bob terminal, create a configuration file for the client:
# runs in Alice terminal and in Bob terminal
SB=$(hostname -f | cut -d. -f2)
cat > wpa3.conf <<EOF
network={
ssid="wifi-wpa3-$SB"
key_mgmt=SAE
sae_password="123456789"
}
EOFNotice that this file has the passphrase itself, and not a binary key that is derived from the passphrase and the SSID. Then, to connect to the network, run
# runs in Alice terminal and in Bob terminal
wpa_supplicant -i wlp5s0 -c wpa3.conf -BWatch for the "AP-STA-CONNECTED" message to appear with Alice's and Bob's MAC addresses in the AP terminal output. Alice and Bob still have the IP addresses 192.168.0.3 and 192.168.0.4.
Now we will pass some user data between Alice and Bob. In the Bob terminal, run
# runs in Bob terminal
netcat -l 4000and leave that running. In the Alice terminal, run
# runs in Alice terminal
netcat 192.168.0.4 4000to connect to Bob. Then, type a message into the terminal window on either Alice or Bob and hit Enter. You should see your message appear in the terminal of the other host.
Use Ctrl+C to stop the running processes in all four terminals.
From node1-2, transfer the file wifi-wpa3.pcap to your own computer, and open it with Wireshark.
First, make sure that Mallory has captured everything that was exchanged when Alice and Bob joined the network. Use the Wireshark filter
wlan.fixed.auth.alg == 3to find the SAE messages. For each client, you should see four "Authentication" frames: one from the client and one from the AP with "Authentication SEQ: 0x0001" (these are the commit messages), and then one from each with "Authentication SEQ: 0x0002" (these are the confirm messages). Look inside a commit message, and note the "Scalar" and "Finite Field Element" values that it carries. Then use the "eapol" filter, and make sure that the 4-way handshakes between the AP and Alice and between the AP and Bob are also captured.
Now give Wireshark the passphrase. Open the "Decryption Keys" menu, and add a key with type "wpa-pwd". Its value is the passphrase and the name of the network, with a colon between them. For example, on sb6:
123456789:wifi-wpa3-sb6Press "OK" and re-open the WPA3 packet capture. Look for the data packets containing the secret message - is Mallory able to read the data, even though she knows the passphrase and has captured the SAE messages and the 4-way handshakes?
Finally, let us try the same dictionary attack that recovered the WPA2 key, this time against the WPA3-Personal capture. In the Mallory terminal, run
# runs in Mallory terminal
aircrack-ng -w wordlist.txt -b 00:15:6D:84:FB:7A wifi-wpa3.pcap(substitute the BSSID of your own network). This time, even though our passphrase is in the wordlist and the capture contains the 4-way handshake, aircrack-ng cannot test the passphrases against it:
Reading packets, please wait... Opening wifi-wpa3.pcap Read 529 packets. 1 potential targets Unsupported key version 0 encountered. May be WPA3 - not yet supported.
In a WPA2 network, the key that protects the traffic is derived from the passphrase and the SSID alone, so each guessed passphrase can be checked against the captured handshake offline. In a WPA3-Personal network, the SAE exchange mixes in secret values that each side chooses at random and never sends in the clear, so the captured messages do not let the attacker test a guessed passphrase. The offline dictionary attack does not work, no matter how weak the passphrase is.
Notes
Exercise
Show the results of your own experiment, similar to what is shown in the Results section on this page.
Answer the following questions:
- Why is knowledge of the key alone sufficient to decrypt traffic in a WEP network, but not in a WPA2 network? Explain the differences between the encryption keys used in WEP and WPA2.
- Why does capturing the 4-way handshake help the attacker with knowledge of the WPA2 key decrypt the WPA2 traffic? What information from the 4-way handshake does the attacker need, and how is that information used?
- The dictionary attack recovered our WPA2 passphrase from the captured handshake. Why did the same attack fail against the WPA3-Personal capture, even though the passphrase was the same and the 4-way handshake was captured? What would an attacker have to do instead to guess a WPA3-Personal passphrase?
- Why is the attacker not able to decrypt the WPA3-Personal traffic, even with knowledge of the passphrase and a capture of the SAE messages and the 4-way handshake? What would she need to know that she cannot get from the passphrase and the messages that she captured?
- Consider a WiFi network in a public place that is password-protected, but with the password posted for everyone to see. Does this offer any protection against a passive attacker, compared to an open network? How does your answer depend on the kind of network?
Using sb4
You can also run this experiment on the sb4 sandbox at COSMOS, with the following changes. On sb4, the two WiFi cards on each node share a single RF port, so instead of two nodes with two cards each, we use four nodes and one card on each node: the Atheros card. The AP runs on node1-3, Alice on node1-4, Bob on node1-5, and Mallory on node1-6.
Prepare the testbed: SSH into sb4.cosmos-lab.org, and load the baseline image onto the four nodes, then turn them on:
# runs on the sb4 console
omf load -i baseline.ndz -t node1-3,node1-4,node1-5,node1-6
omf tell -a on -t node1-3,node1-4,node1-5,node1-6Open one terminal for each node — the AP terminal on node1-3, the Alice terminal on node1-4, the Bob terminal on node1-5, and the Mallory terminal on node1-6 — and leave a fifth terminal at the console for retrieving files. On sb4, run the software installation and the driver commands in all four node terminals, not only two.
Connect the cards through the RF matrix: On sb4, the WiFi cards are connected to one another by cables through an RF matrix, instead of over the air. After you turn the nodes on, set the attenuation to 0 dB on every path between the four ports. (Port 3 is node1-3, port 4 is node1-4, and so on.) On the sb4 console, run
# runs on the sb4 console
for pair in "3 4" "3 5" "3 6" "4 5" "4 6" "5 6"; do
set -- $pair
curl -s -X POST -H "Content-Type: application/json" \
-d "{\"portA\":$1,\"portB\":$2,\"att\":0}" \
http://am-rt1.cosmos-lab.org:5054/rfmatrix/set
doneAlice and Bob use the Atheros card: On sb4, the Intel card does not work well as a client of an access point on a different node, so Alice and Bob use the Atheros card instead. In the Alice terminal and in the Bob terminal, run modprobe ath9k, and use wlp3s0 in place of wlp5s0 in every command. (The AP and Mallory already use the Atheros card, wlp3s0.)
Everything else is the same. As on sb5, the SB variable sets the channel to 1 on sb4.
Updates to this experiment
This experiment was updated in December 2026 for the new COSMOS sandbox layout, to add WPA3-Personal, and to add an offline dictionary attack against the captured WPA2 handshake. It runs on the two nodes of sb5 or sb6, each of which has two WiFi cards, or on four nodes of sb4 (see "Using sb4" above).