Check security mode of connected Wi-Fi network
I got it! :)
sudo wpa_cli status
command gives me information exactly that I want.
Selected interface 'wlan0'
bssid=80:1f:72:95:d2:b2
ssid=whatever
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.25.27.111
address=a4:4f:31:15:5f:44
uuid=6099d6ff-4b7d-538a-9e69-3479e250e401
Output of that command is easy to grep.
You can try below command from CLI to list SSIDs.
sudo iwlist wlan0 scan
Or you can also use
nmcli -f all dev wifi | grep SSID | awk '{ print $1 " - " $9 }'
or
nmcli -f all dev wifi | awk '/SSID/{ print $1 " - " $9}'
replace SSID with ssid you need information for.
Please open a terminal and run:
sudo iwlist wlan0 scan
Your network will appear, along with others in range, similar to this example:
Cell 04 - Address: xx:C1:50:78:B7:xx
Channel:11
Frequency:2.462 GHz (Channel 11)
Quality=30/70 Signal level=-80 dBm
Encryption key:on
ESSID:"ATT630"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=00000021823cba79
Extra: Last beacon: 4340ms ago
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
So we see that the encryption is WPA and WPA2 mixed mode with TKIP.