Access wi-fi raw data

I would like to know if anyone has any idea of how to access live wi-fi raw data from my computer (in monitor and promicuous mode). I would like to develop a code to get the MAC address of every device around me, including cellphones that are not connected to any network (I know every smartphone sends wi-fi signal when they're on). Since I've discovered that the latest versions of MacBooks can use the wi-fi board in monitor and promicuous mode, I'm trying to access it's raw data. I don't even know if it's possible with Mathematica (but if it is, it would be perfect to handle the data the way I want).

If you know whether and how it could be done, please help me. If it can't be done in Mathematica, could you indicate a programming language that allows to access this kind of data?

I'm asking this here because i've done some tests in Wireshark and was able to get the MAC address of my own iPhone when I turned the wi-fi on. The problem is that I can only capture a lot of data and analyse it AFTERWARDS. I would like to analyse the wi-fi data as soon as it's been captured.

I've searched about it on internet and even how to do that with arduino, but without any luck.

UPDATE:

Thanks to rm -rf I'm able to get information from my wifi and display in Mathematica. The next step is sniff all wifi devices (more precisely smartphones) that are on. The important part is that they must not be necessarily connected to any network!

I found the command "airport sniff [channel]" that can be used from Terminal. It creates a temporary .cap file in the /tmp folder, but i'm not able to read it. I'm not quite sure if it's the right path.

I would be glad if someone could help me a little bit further here =]

-
Cool first question! Welcome to SE! –  Murta Jun 7 '14 at 17:48
I think you got very lucky that somebody here knew how to retrieve network information, since it wasn't really a Mathematica solution but more like an OS X solution. Your follow-up is probably better suited on a site about networks. –  Pickett Jun 7 '14 at 20:30
I too see this as a borderline off-topic question and am considering joining the close votes. If we allow this, any question that could be answered using a program that outputs to stdout, with no relation to Mathematica whatsoever, would be on-topic. The question is interesting, though. –  Sjoerd C. de Vries Jun 8 '14 at 9:35
This question appears to be off-topic because it is mostly unrelated to Mathematica. –  Sjoerd C. de Vries Jun 8 '14 at 9:37

The airport utility on your mac (which is not very widely known) gives you programmatic access to all your wireless information. I wrote a fun answer on Ask Different using this command line utility.

To get the information about wireless devices around you, use the -s flag. Here's a simple function to automate it:

getSSID[] := With[{data = Import["!/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s", "Table"]},

This will solve the space issue: lines = Import[ "!/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resour‌​ces/airport -s", "Lines"]; headings = StringSplit@First@lines; data = Rest@lines; splitLine[str_] := StringCases[str, a___ ~~ b : RegularExpression[ "[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}"] ~~ c___ :> Sequence @@ ({StringTrim@a, b}~Join~StringSplit@c)] TableForm[splitLine /@ data, TableHeadings -> {Range@Length@data, headings}] –  Pickett Jun 7 '14 at 20:27