Last active
July 18, 2024 07:46
-
-
Save buhman/7162560 to your computer and use it in GitHub Desktop.
all wpa_cli ommands can be tab-completed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localhost ~ # cat <<EOF> /etc/wpa_supplicant.conf | |
ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel | |
update_config=1 | |
EOF | |
localhost ~ # wpa_supplicant -iwlp1s0 -Dnl80211 -c/etc/wpa_supplicant.conf -B | |
Successfully initialized wpa_supplicant | |
localhost ~ # wpa_cli | |
wpa_cli v2.0 | |
Copyright (c) 2004-2012, Jouni Malinen <[email protected]> and contributors | |
This software may be distributed under the terms of the BSD license. | |
See README for more details. | |
Selected interface 'wlp1s0' | |
Interactive mode | |
> status | |
wpa_state=DISCONNECTED | |
p2p_device_address=00:15:6d:85:5b:1f | |
address=00:15:6d:85:5b:1f | |
> scan | |
OK | |
<3>CTRL-EVENT-SCAN-RESULTS | |
> scan_results | |
bssid / frequency / signal level / flags / ssid | |
f8:1a:67:78:4b:af 2462 -34 [WPA2-PSK-CCMP][ESS] buhman | |
> add_network | |
0 | |
> list_network | |
network id / ssid / bssid / flags | |
0 any [DISABLED] | |
> set_network 0 ssid "buhman" | |
OK | |
> set_network 0 psk "world domination" | |
OK | |
> list_network | |
network id / ssid / bssid / flags | |
0 buhman any [DISABLED] | |
> enable_network 0 | |
OK | |
<3>CTRL-EVENT-SCAN-RESULTS | |
<3>WPS-AP-AVAILABLE | |
<3>SME: Trying to authenticate with f8:1a:67:78:4b:af (SSID='buhman' freq=2462 MHz) | |
<3>Trying to associate with f8:1a:67:78:4b:af (SSID='buhman' freq=2462 MHz) | |
<3>Associated with f8:1a:67:78:4b:af | |
<3>WPA: Key negotiation completed with f8:1a:67:78:4b:af [PTK=CCMP GTK=CCMP] | |
<3>CTRL-EVENT-CONNECTED - Connection to f8:1a:67:78:4b:af completed [id=0 id_str=] | |
> status | |
bssid=f8:1a:67:78:4b:af | |
ssid=buhman | |
id=0 | |
mode=station | |
pairwise_cipher=CCMP | |
group_cipher=CCMP | |
key_mgmt=WPA2-PSK | |
wpa_state=COMPLETED | |
p2p_device_address=00:15:6d:85:5b:1f | |
address=00:15:6d:85:5b:1f | |
> list_networks | |
network id / ssid / bssid / flags | |
0 buhman any [CURRENT] | |
> save_config | |
OK | |
> quit | |
localhost ~ # cat /etc/wpa_supplicant.conf | |
ctrl_interface=/run/wpa_supplicant | |
update_config=1 | |
network={ | |
ssid="buhman" | |
psk="world domination" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localhost ~ # wpa_cli | |
wpa_cli v2.0 | |
Copyright (c) 2004-2012, Jouni Malinen <[email protected]> and contributors | |
This software may be distributed under the terms of the BSD license. | |
See README for more details. | |
Selected interface 'wlp1s0' | |
Interactive mode | |
> add_network | |
1 | |
> set_network 1 ssid "starbucks" | |
OK | |
> set_network 1 key_mgmt NONE | |
OK | |
> list_networks | |
network id / ssid / bssid / flags | |
0 buhman any | |
1 starbucks any [DISABLED] | |
> enable_network 1 | |
OK | |
<3>CTRL-EVENT-SCAN-RESULTS | |
<3>WPS-AP-AVAILABLE | |
<3>SME: Trying to authenticate with 3e:20:1d:c6:0e:d2 (SSID='starbucks' freq=2412 MHz) | |
<3>Trying to associate with 3e:20:1d:c6:0e:d2 (SSID='starbucks' freq=2412 MHz) | |
<3>Associated with 3e:20:1d:c6:0e:d2 | |
<3>CTRL-EVENT-CONNECTED - Connection to 3e:20:1d:c6:0e:d2 completed [id=0 id_str=] | |
> save_config | |
OK | |
> quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@modulitos To find the number of a given ssid, you can grep for it in non-interactive mode like so
wpa_cli list_networks | grep ssid
.