Categories
SysOps

How to scan wireless networks

Scan wireless networks.

Use iwlist utility to scan wireless networks.

$ sudo iwlist wlan0 scanning
wlan0     Scan completed :
          Cell 01 - Address: 00:78:CD:91:BA:30
                    Channel:6
                    Frequency:2.437 GHz (Channel 6)
                    Quality=70/70  Signal level=-20 dBm  
                    Encryption key:on
                    ESSID:"Searching..."
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 16ms ago
                    IE: Unknown: 000C536561726368696E672E2E2E
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030106
                    IE: Unknown: 050400010000
                    IE: Unknown: 0706504C20010D14
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
                    IE: Unknown: 460573D000000C
                    IE: Unknown: 2D1AAC011BFFFFFF0000000000000000000100000000000000000000
                    IE: Unknown: 3D1606000500000000000000000000000000000000000000
                    IE: Unknown: 7F0800000F0200000040
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
[...]
          Cell 05 - Address: 00:78:CD:14:C7:DA
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=66/70  Signal level=-44 dBm  
                    Encryption key:off
                    ESSID:""
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 16ms ago
                    IE: Unknown: 0000
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 03010B
                    IE: Unknown: 050400010000
                    IE: Unknown: 0706504C20010D14
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2D1A2D011BFF000000000000000000000001000000000406E6070C00
                    IE: Unknown: 3D160B080000000000000000000000000000000000000000
                    IE: Unknown: 7F080000000000000040
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
[...]
          Cell 09 - Address: 00:78:CD:F1:B3:EB
                    Channel:52
                    Frequency:5.26 GHz (Channel 52)
                    Quality=70/70  Signal level=-32 dBm  
                    Encryption key:on
                    ESSID:"Hidding..."
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 16ms ago
                    IE: Unknown: 00115769746F6C6420476F6D62726F7769637A
                    IE: Unknown: 01088C129824B048606C
                    IE: Unknown: 030134
                    IE: Unknown: 073C504C202401142801142C01143001143401143801143C011440011464011B68011B6C011B70011B74011B78011B7C011B80011B84011B88011B8C011B
                    IE: Unknown: 200103
                    IE: Unknown: 460573D000000C
                    IE: Unknown: 2D1AEF0903FFFFFFFF00000000000000000100000000000000000000
                    IE: Unknown: 3D1634050000000000000000000000000000000000000000
                    IE: Unknown: 7F0800000F0200000040
                    IE: Unknown: BF0CF2618033AAFF0000AAFF0000
                    IE: Unknown: C005013A00FCFF
                    IE: Unknown: C30503D8D8D8D8
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
[...]
          Cell 12 - Address: 06:78:CD:21:BA:3E
                    Channel:6
                    Frequency:2.437 GHz (Channel 6)
                    Quality=70/70  Signal level=-20 dBm  
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Extra:Mesh Network Path Selection Protocol ID: 0x01
                    Extra:Path Selection Metric ID: 0x01
                    Extra:Congestion Control Mode ID: 0x00
                    Extra:Synchronization ID: 0x01
                    Extra:Authentication ID: 0x00
                    Extra:Formation Info: 0x00
                    Extra:Capabilities: 0x09
                    ESSID:"I7GrvBkvJjjd55kf"
                    Mode:Unknown/bug
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 16ms ago
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 030106
                    IE: Unknown: 050400010000
                    IE: Unknown: 0706504C20010D14
                    IE: Unknown: 2A0100
                    IE: Unknown: 32043048606C
                    IE: Unknown: 2D1AAC011BFFFFFF0000000000000000000100000000000000000000
                    IE: Unknown: 3D1606000500000000000000000000000000000000000000
                    IE: Unknown: 7F080000000000000040
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
                    IE: Unknown: 710701010001000009
                    IE: Unknown: 72104937477276426B764A6A6A6435356B66
[...]
          Cell 15 - Address: 06:78:CD:0E:B2:30
                    Channel:52
                    Frequency:5.26 GHz (Channel 52)
                    Quality=70/70  Signal level=-32 dBm  
                    Encryption key:on
                    ESSID:""
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000000000000
                    Extra: Last beacon: 16ms ago
                    IE: Unknown: 0000
                    IE: Unknown: 01088C129824B048606C
                    IE: Unknown: 030134
                    IE: Unknown: 050400010000
                    IE: Unknown: 073C504C202401142801142C01143001143401143801143C011440011464011B68011B6C011B70011B74011B78011B7C011B80011B84011B88011B8C011B
                    IE: Unknown: 200103
                    IE: Unknown: 460573D000000C
                    IE: Unknown: 2D1AEF0903FFFFFFFF00000000000000000100000000000000000000
                    IE: Unknown: 3D1634050000000000000000000000000000000000000000
                    IE: Unknown: 7F0800000F0200000040
                    IE: Unknown: BF0CF2798333AAFF0000AAFF0000
                    IE: Unknown: C005013A00FCFF
                    IE: Unknown: C30503D8D8D8D8
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
                    IE: Unknown: DD0900037F01010000FF7F
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD0B8CFDF00000000300000000
                    IE: Unknown: DD178CFDF0000100104937477276426B764A6A6A6435356B66

Use grep to extract specific information.

$ sudo iwlist wlan0 scanning | grep -e Cell -e Frequency -e Quality -e ESSID
          Cell 01 - Address: 00:78:CD:91:BA:30
                    Frequency:2.437 GHz (Channel 6)
                    Quality=70/70  Signal level=-20 dBm  
                    ESSID:"Searching..."
          Cell 02 - Address: 06:78:CD:21:BA:3E
                    Frequency:2.437 GHz (Channel 6)
                    Quality=39/70  Signal level=-71 dBm  
                    ESSID:"I7GrvBkvJjjd55kf"
[...]
          Cell 04 - Address: 00:78:CD:14:C7:DA
                    Frequency:2.462 GHz (Channel 11)
                    Quality=64/70  Signal level=-46 dBm  
                    ESSID:""
[...]
          Cell 12 - Address: 00:78:CD:F1:B3:EB
                    Frequency:5.26 GHz (Channel 52)
                    Quality=70/70  Signal level=-32 dBm  
                    ESSID:"Hidding..."
[...]
          Cell 18 - Address: 06:78:CD:0E:B2:30
                    Frequency:5.26 GHz (Channel 52)
                    Quality=70/70  Signal level=-32 dBm  
                    ESSID:""

Simple as that.