### Build and Install wmediumd Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/vm/example-vm-setup.txt Downloads, builds, and installs the wmediumd tool for wireless medium simulation. ```bash cd git clone https://github.com/bcopeland/wmediumd.git cd wmediumd make sudo cp wmediumd/wmediumd /usr/local/bin ``` -------------------------------- ### Install Hostapd/WPA Supplicant Build Tools Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/vm/example-vm-setup.txt Installs essential build tools and libraries required for compiling hostapd and wpa_supplicant. ```bash sudo apt install build-essential git libpcap-dev libssl-dev libxml2-dev \ libcurl4-openssl-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev \ libsqlite3-dev binutils-dev libiberty-dev zlib1g-dev libpcsclite-dev \ flex bison libconfig-dev ``` -------------------------------- ### Install KVM for VM Guests Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/vm/example-vm-setup.txt Installs KVM and enables user access for running virtual machine guests. ```bash # If using kvm and VM instead of UML (though, UML is the recommended option) # kvm for running the VM guests sudo apt install qemu-kvm #Enable kvm use for the user sudo adduser $USER kvm ``` -------------------------------- ### Install Test Script Prerequisites Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/vm/example-vm-setup.txt Installs network utilities, debugging tools, and Python libraries needed by the test scripts. ```bash sudo apt install net-tools bridge-utils ebtables iw tshark \ python3-openssl python3-pyrad python3-cryptography python3-pycryptodome ``` -------------------------------- ### Start wpasvc Service Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Start the wpasvc service using the 'net start' command. This can be done manually or configured for automatic startup. ```bash net start wpasvc ``` -------------------------------- ### Start Test Software and Load hwsim Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Load the mac80211_hwsim module and start the test software to prepare for hardware simulation testing. ```bash ./start.sh ``` -------------------------------- ### Run a Quick Test Case Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/vm/example-vm-setup.txt Executes a single test case 'ap_open' to verify the test framework setup. ```bash cd ~/hostap/tests/hwsim/vm ./vm-run ap_open ``` -------------------------------- ### Install Prerequisite Packages for Hostapd/wpa_supplicant Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Installs essential development and networking packages required for building and running the hostapd/wpa_supplicant test framework. Includes optional package for network interface information. ```bash sudo apt-get install build-essential git libpcap-dev libsqlite3-dev binutils-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libssl-dev libiberty-dev libdbus-1-dev iw bridge-utils python-pyrad python-crypto tshark ``` ```bash sudo apt-get install python-netifaces ``` -------------------------------- ### Configure and Install mac80211_hwsim Kernel Module Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Downloads, configures, and installs the mac80211_hwsim kernel module from Linux backports. This step ensures the necessary wireless simulation capabilities are available. ```bash wget http://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.19-rc1/backports-3.19-rc1-1.tar.xz tar xJf backports-3.19-rc1-1.tar.xz cd backports-3.19-rc1-1 cat > defconfigs/mac80211_hwsim < vm-config < GET anonce df8c61d1f1f7aca9f1739dd888199547f4af2b8b07f8bf15b45ea271da0072b2 > raw KEY_REQUEST 0 1 OK > GET anonce d8ddcb716f28abfdf1352a05d51e7a70f58802122e99d13c730c3c0f09594aac ``` -------------------------------- ### Run All Test Cases Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Execute the entire suite of available test cases, which may take a significant amount of time. Consider parallel execution for faster results. ```bash ./run-all.sh ``` -------------------------------- ### hostapd.eap_user Configuration for EAP Methods Source: https://github.com/cgit/hostap/blob/main/hostapd/hlr_auc_gw.txt This file maps user identifiers to EAP methods (SIM, AKA, AKA'). The asterisk (*) indicates a wildcard match for any user within a given category. ```ini "0"* AKA "1"* SIM "2"* AKA "3"* SIM "4"* AKA "5"* SIM "6"* AKA' "7"* AKA' "8"* AKA' ``` -------------------------------- ### Build and Link sigma_dut Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/vm/example-vm-setup.txt Clones the sigma-dut repository, builds it, and creates symbolic links for testing. ```bash cd git clone https://github.com/qca/sigma-dut.git cd sigma_dut make cd ~/hostap/tests/hwsim ln -s ~/sigma_dut/sigma_dut ln -s ~/sigma_dut/dpp-ca.py ``` -------------------------------- ### Register wpasvc.exe (Current Location) Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Register wpasvc.exe as a Windows service using its current location. This is a shortcut if wpasvc.exe is in the current directory. ```bash wpasvc.exe reg ``` -------------------------------- ### Run All Test Cases in Parallel VMs Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/vm/example-vm-setup.txt Launches all available test cases concurrently using a specified number of parallel virtual machines. ```bash cd ~/hostap/tests/hwsim/vm ./parallel-vm.py 7 ``` -------------------------------- ### Test GTK Reinstallation Protection (4-Way Handshake, Variant 1) on Station Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Variant 1 for testing GTK reinstallation protection on a station. Includes an extra Message 1/4 by using RESEND_M1 before RESEND_M3. ```bash > raw RESEND_M1 OK > raw RESEND_M3 OK ``` -------------------------------- ### Test GTK Reinstallation Protection (4-Way Handshake, Variant 2) on Station Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Variant 2 for testing GTK reinstallation protection on a station. Includes two extra Message 1/4 by using RESEND_M1 twice before RESEND_M3. ```bash > raw RESEND_M1 change-anonce OK > raw RESEND_M1 OK > raw RESEND_M3 OK ``` -------------------------------- ### Control Interface with SDDL (Authenticated Users) Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Configure the control interface to grant permissions to all authenticated users on the machine using an SDDL string. ```ini ctrl_interface=SDDL=D:(A;;GA;;;AU) ``` -------------------------------- ### Control Interface with SDDL (Admins and Power Users) Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Configure the control interface to grant permissions to both local administrators and the 'power users' group using SDDL strings. ```ini ctrl_interface=SDDL=D:(A;;GA;;;BA)(A;;GA;;;PU) ``` -------------------------------- ### Control Interface with SDDL (All Users - Not Recommended) Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Configure the control interface to grant permissions to all users, including anonymous users. This is not recommended due to security risks. ```ini ctrl_interface=SDDL=D:(A;;GA;;;BU)(A;;GA;;;AN) ``` -------------------------------- ### SQLite Database Initialization for hlr_auc_gw Source: https://github.com/cgit/hostap/blob/main/hostapd/hlr_auc_gw.txt These SQL commands are used to initialize the SQLite database for hlr_auc_gw. The 'milenage' table stores authentication parameters like IMSI, Ki, OPC, AMF, and SQN. ```sql CREATE TABLE milenage( imsi INTEGER PRIMARY KEY NOT NULL, ki CHAR(32) NOT NULL, opc CHAR(32) NOT NULL, amf CHAR(4) NOT NULL, sqn CHAR(12) NOT NULL ); ``` ```sql INSERT INTO milenage(imsi,ki,opc,amf,sqn) VALUES( 232010000000000, '90dca4eda45b53cf0f12d7c9c3bc6a89', 'cb9cccc4b9258e6dca4760379fb82581', '61df', '000000000000' ); ``` ```sql INSERT INTO milenage(imsi,ki,opc,amf,sqn) VALUES( 555444333222111, '5122250214c33e723a5dd523fc145fc0', '981d464c7c52eb6e5036234984ad0bcf', 'c3ab', '16f3b3f70fc1' ); ``` -------------------------------- ### Update iw Utility from Source Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Replaces the default iw utility with a custom build from source to include features like flushing cfg80211 scan results, which are required by some test cases. This is optional but recommended for full test coverage. ```bash wget https://www.kernel.org/pub/software/network/iw/iw-3.17.tar.gz tar xf iw-3.17.tar.gz cd iw-3.17 make sudo mv /sbin/iw{,-distro} sudo cp iw /sbin/iw cd .. ``` -------------------------------- ### Test TK Reinstallation Protection (Basic) Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Tests TK reinstallation protection for unicast traffic by resetting the packet number. Connectivity should work after reset. ```bash > raw RESEND_M3 OK > raw RESET_PN OK ``` -------------------------------- ### hostapd.radius_clients Configuration Source: https://github.com/cgit/hostap/blob/main/hostapd/hlr_auc_gw.txt This file configures the RADIUS server clients for hostapd. It allows access from any IP address (0.0.0.0/0) and specifies 'radius' as the client type. ```ini 0.0.0.0/0 radius ``` -------------------------------- ### hlr_auc_gw Command Line Usage Source: https://github.com/cgit/hostap/blob/main/hostapd/hlr_auc_gw.txt This shows the available command-line options for configuring and running the hlr_auc_gw utility. Use -s for socket path, -g for triplet file, -m for Milenage file, and -D for SQLite database. ```bash hlr_auc_gw [-hu] [-s] [-g] [-m] \ [-D] [-i] ``` -------------------------------- ### Verify Regulatory Database Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Use this command to verify that the new version of the regulatory database is trusted. ```bash regdbdump /lib/crda/regulatory.bin ``` -------------------------------- ### Control Interface with SDDL (Local Admins) Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Configure the control interface to grant permissions only to the local administrators group using an SDDL string. ```ini ctrl_interface=SDDL=D:(A;;GA;;;BA) ``` -------------------------------- ### Run wpasvc.exe as a Debug Application Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Execute the wpasvc.exe program as a normal command-line application for debugging purposes. ```bash wpasvc.exe app ``` -------------------------------- ### Test Broadcast Replay Protection on Station with hostapd_cli Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Verify broadcast traffic replay protection on a station device. This involves resetting the packet number for broadcast traffic and checking if it stops working, indicating correct protection. ```bash > raw RESET_PN ff:ff:ff:ff:ff:ff OK ``` -------------------------------- ### Test GTK Reinstallation Protection (4-Way Handshake) on Station Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Test protection against delayed retransmission of 4-way handshake EAPOL-Key Message 3/4 on a station device. This involves sending RESEND_M3 followed by RESET_PN. ```bash > raw RESEND_M3 OK > raw RESET_PN ff:ff:ff:ff:ff:ff OK ``` -------------------------------- ### Test GTK Reinstallation Protection (Group Handshake) on Station Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Test protection against delayed retransmission of Group Key Message 1/2 on a station device. This involves sending a RESEND_GROUP_M1 command followed by RESET_PN. ```bash > raw RESEND_GROUP_M1 OK > raw RESET_PN ff:ff:ff:ff:ff:ff OK ``` -------------------------------- ### Test Unicast Replay Protection on Station with hostapd_cli Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Verify unicast traffic replay protection on a station device. This involves resetting the packet number and checking if traffic continues to work, indicating a potential vulnerability. ```bash > raw RESET_PN OK ``` -------------------------------- ### Enable Hidden SSID Association Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Configuration to enable wpa_supplicant to associate with an SSID without scanning, useful for hidden SSIDs. Uncomment the 'ap_scan=2' line. ```ini #ap_scan=2 ``` -------------------------------- ### Register wpasvc.exe as a Service Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Register wpasvc.exe as a Windows service using its full path. This allows it to be managed by the Windows Services control panel. ```bash wpasvc.exe reg ``` -------------------------------- ### Stop Test Software and Unload hwsim Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Stop the test software and unload the mac80211_hwsim module to clean up the testing environment. ```bash ./stop.sh ``` -------------------------------- ### Test Unicast Replay Protection on AP with wpa_cli Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Verify unicast traffic replay protection on an AP device. This involves resetting the packet number using wpa_cli and checking if unicast traffic is blocked. ```bash > raw RESET_PN OK ``` -------------------------------- ### Update wireless-regdb for Enhanced Regulatory Support Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Updates the wireless regulatory database to a newer snapshot. This is optional but enables additional VHT and DFS test cases that might be skipped with older versions. ```bash wget http://kernel.org/pub/software/network/wireless-regdb/wireless-regdb-2014.10.07.tar.xz tar xJf wireless-regdb-2014.10.07.tar.xz sudo mv /lib/crda/regulatory.bin{,-distro} sudo cp wireless-regdb-2014.10.07/regulatory.bin /lib/crda/regulatory.bin ``` -------------------------------- ### Test Unicast Data Connectivity with Ping Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Use ping to verify unicast data frame transmission. This command tests connectivity to a device at 192.168.1.2. ```bash $ ping -n -c 5 192.168.1.2 PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data. 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=43.7 ms 64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=67.9 ms 64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=900 ms 64 bytes from 192.168.1.2: icmp_seq=4 ttl=64 time=5.81 ms 64 bytes from 192.168.1.2: icmp_seq=5 ttl=64 time=135 ms --- 192.168.1.2 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4004ms rtt min/avg/max/mdev = 5.811/230.605/900.223/337.451 ms ``` ```bash $ ping -n -c 5 192.168.1.2 PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data. --- 192.168.1.2 ping statistics --- 5 packets transmitted, 0 received, 100% packet loss, time 4033ms ``` -------------------------------- ### Test Broadcast Data Connectivity with Arping Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Use arping to verify broadcast data frame transmission. This command tests connectivity to a device at 192.168.1.2 on the wlan0 interface. ```bash $ arping -b -I wlan0 192.168.1.2 -c 5 ARPING 192.168.1.2 from 192.168.1.1 wlan0 Unicast reply from 192.168.1.2 [] 119.695ms Unicast reply from 192.168.1.2 [] 144.496ms Unicast reply from 192.168.1.2 [] 166.788ms Unicast reply from 192.168.1.2 [] 2.283ms Unicast reply from 192.168.1.2 [] 2.234ms Sent 5 probes (5 broadcast(s)) Received 5 response(s) ``` ```bash $ arping -b -I wlan0 192.168.1.2 -c 5 ARPING 192.168.1.2 from 192.168.1.1 wlan0 Sent 5 probes (5 broadcast(s)) Received 0 response(s) ``` -------------------------------- ### Decrypt and Analyze Sniffer Capture with wlantest Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Use wlantest to decrypt and analyze a wireless sniffer capture. This is useful for confirming DUT behavior when data tests indicate unexpected issues. ```bash wlantest -r wlan0.pcap -n decrypted.pcap -p 12345678 ``` -------------------------------- ### Unregister wpasvc Service Source: https://github.com/cgit/hostap/blob/main/wpa_supplicant/README-Windows.txt Unregister the wpasvc service from the Windows system. ```bash wpasvc.exe unreg ``` -------------------------------- ### Mask systemd-rfkill Service Source: https://github.com/cgit/hostap/blob/main/tests/hwsim/example-setup.txt Mask the systemd-rfkill service to prevent it from blocking network devices, which can cause test failures. This is a troubleshooting step for systemd-based distributions. ```bash systemctl mask systemd-rfkill.service ``` -------------------------------- ### Test FT Reassociation Request Frame Retransmission Source: https://github.com/cgit/hostap/blob/main/tests/cipher-and-key-mgmt-testing.txt Tests FT Reassociation Request frame retransmission on an AP device. This test requires a sniffer for analysis. It involves verifying unicast traffic, reissuing a reassociation request, and then verifying traffic again, looking for PN resets. ```bash wpa_cli "raw RESEND_ASSOC" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.