Skip to content

Instantly share code, notes, and snippets.

@therokh
Created June 29, 2023 14:03
Show Gist options
  • Save therokh/1f69a05723cc69f56c8036330063d265 to your computer and use it in GitHub Desktop.
Save therokh/1f69a05723cc69f56c8036330063d265 to your computer and use it in GitHub Desktop.
Put all WLAN interfaces into monitor mode
#!/bin/bash
for interface in $(iw dev | grep wlan | grep -v mon | awk '{ print $2 }')
do
mon_interface="${interface}mon"
echo "Interface: $interface"
echo "Monitor interface: $mon_interface"
ip link set ${interface} down
iw dev ${interface} set type monitor
ip link set ${interface} name "${mon_interface}"
ip link set "${mon_interface}" up
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment