flyinva/mozlosh

A Mac version

Opened this issue · 11 comments

It would be great to have a Mac version, where airport is used instead of iwlist.

http://wlanbook.com/mac-os-x-wifi-wireless-scanner/

After checking on http://wlanbook.com/mac-os-x-wifi-wireless-scanner/ I think it should not be very difficult. I could try to had this but I can't test (no Mac around me). Stay tuned.

PS : which kind of shell is installed by default ?

@nhoizey : could you try last version and give me a feedback ?
Commit 312159d

AFAIK, bash is the default shell.

The latest version gives the following result:

{ "wifi": []}

An airport scan actually gives:

                            SSID BSSID             RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
                    Livebox-bf04 d0:ae:ec:41:10:5a -74  6       N  FR WPA(PSK/TKIP/TKIP) 
                NUMERICABLE-D4E1 18:f4:6a:b7:0e:4e -79  11      N  -- WEP
                        FreeWifi f4:ca:e5:a0:f0:29 -83  12      Y  -- NONE
                 FreeWifi_secure f4:ca:e5:a0:f0:2a -82  12      Y  -- WPA2(802.1x/AES,TKIP/TKIP) 
                    Livebox-bc09 5c:33:8e:8e:32:d8 -73  6       Y  FR WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
                        BenjoBPA e0:91:f5:5a:76:ca -80  11      N  GB WPA2(PSK/AES/AES) 
                    Livebox-f120 5c:33:8e:ea:69:6a -80  11      N  FR WEP
                  Freebox-5B3F35 f4:ca:e5:a0:f0:28 -83  12      Y  -- WPA(PSK/AES/AES) 
                         linksys 00:18:f8:bc:98:1f -75  11      N  -- NONE
                        FreeWifi f4:ca:e5:f0:5c:29 -80  11      Y  -- NONE
                  Airport BELDEV 88:1f:a1:31:3d:b8 -80  11      Y  FR WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
                       NTM_Guest 16:9a:dd:8d:c7:f3 -52  7       Y  FR WPA2(PSK/AES/AES) 
                    Livebox-39ac 00:19:4b:75:3a:18 -59  6       Y  FR WPA(PSK/AES,TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
                     Bbox-AB5A3B 00:1f:9f:f5:f1:ff -60  6       N  -- WPA(PSK/AES/AES) WPA2(PSK/AES/AES) 
          Bouygues Telecom Wi-Fi 5a:1f:9f:f5:f1:fc -60  6       N  -- NONE
                 FreeWifi_secure 14:0c:76:e7:b7:8e -60  3       Y  -- WPA2(802.1x/AES,TKIP/TKIP) 
                        FreeWifi 14:0c:76:e7:b7:8d -60  3       Y  -- NONE
                         Garon55 00:1d:6a:49:4e:23 -52  3       N  FR WEP
          Bouygues Telecom Wi-Fi c0:ac:54:03:ce:b1 -73  2       Y  EU NONE
                   Bbox-48B39BF5 c0:ac:54:03:ce:b0 -73  2       Y  EU WPA(PSK/AES/AES) WPA2(PSK/AES/AES) 
                  Freebox-6A50D5 14:0c:76:e7:b7:8c -60  3       Y  -- WPA(PSK/AES/AES) 
                         BELDEV2 00:24:b2:67:e8:60 -81  1       Y  FR WPA(PSK/TKIP/TKIP) 
                    Livebox-F540 00:14:a4:5e:bf:9b -81  1       N  -- WPA(PSK/TKIP/TKIP) 
                           PRONY 00:11:24:0e:75:b1 -84  1       N  -- WPA(PSK/TKIP/TKIP) WPA2(PSK/AES,TKIP/TKIP) 
              Bbox-48B39BF5-5GHz c0:ac:54:03:ce:b4 -85  48      Y  EU WPA(PSK/AES/AES) WPA2(PSK/AES/AES) 
                       NTM_Guest 16:9a:dd:8d:c7:f4 -59  36,+1   Y  FR WPA2(PSK/AES/AES) 

Where is aiport stored on the disk ? Is it in the PATH ?

It is not in the PATH. It is here /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport

I guess we have to run airpplay with -s option for scanning. I've added this option in fafb943

What is the 36+1 on the last line ? It's supposed to be a channel number… (json cloud not be valid because of that)

Not sure, but 36+1 might be the channel and the band (in this case, it would be channel 36 at 5GHz)

The coma in "36,+1" is an issue. Enclosing in double quote might fix it.
Also, SSID names with spaces in them seem to break parsing.

Space should be the field delimiter. Is there an option to only show needed fields (bssid, rssi, channel) ?

Is there an man command or an description of all options somewhere ?

xml format note very useless :-(

<key>BSSID</key>
<string>0:33:44:55:66:77</string>
<key>CHANNEL</key>
<integer>6</integer>
<key>NOISE</key>
<integer>-85</integer>