Mac O’Clock
Published in

Mac O’Clock

Air Warrior

Airport utility is one of those hidden Wi-Fi tools on your MAC Terminal that can make you an AIR Warrior in a Wi-Fi crowded world

The following is a list of 6 useful airport commands that you need to know to get around.

Airport is a strong tool in the hand of wi-fi experts, so treat it carefully

Screens are taken using my home MAC and my TP-Link router

First setup

Your airport utility is hidden under the /usr/libexec/airportd on your terminal.

If you want to use it through the airport command without the full path, then you can create a link using the following

Once you do so, you can now, use the airport command straight in the terminal itself

1. Airport help — airport -h

The basic command to list all possible commands and arguments in the airport Man page. very useful

2. Scan the Air — airport -s

That is probably the very first command to use, airport -s will scan your environment and show you a list of the available wi-fi networks around.

The list will contain:

  • The network name ( SSID )
  • It’s received signal strength indicator ( RSSI ) — It’s the received power, the signal amplitude as our wireless card circuitry senses it
  • MAC address of the wi-fi network ( BSSID )
  • The channel it works on
  • Country Code
  • Security type ( WPA2, WPA3…) .

This simple command will show you so much information in very a simple manner

3. Get information on your current connected wi-fi network — airport -I

Now that you know the networks around you, let’s look at the network that we are connected to

This command will show you :

  • The name of the network you are connected to
  • Received signal strength indicator ( RSSI )
  • Noise level — Now this one is important, it shows you the signal to noise ratio. Other devices that broadcast wireless signals in the air create noise that may interfere with your wireless signal, sometimes, it may corrupt it.

You should have at least 20–25 dB space between the RSSI and the noise level, less than that may harm your connection. Currently, I have a Noise level of -98, and an RSSI of -73, which means that the SNR ( signal to noise ratio is 25). very good

4. Di-associate from the network you are connected to — airport -z

If for some reason, you want to detach from the network you are connected to, you can do that directly from the terminal, but you will need to use your root privileges

5. Show your wireless card interface — airport prefs

This command will show you the current preferences of your wireless card as

  • Remembering the recent network- yes/no
  • Disconnect on logout — yes/no

To change the different preferences settings, you will need to use your admin privileges

6. Capture Packets on a specific channel

This command is quite advanced and requires your admin ( root ) privileges, it also puts your wireless card into a monitor mode, where it listens to the packets that flow around. that will lead Di-Association from your wireless access point or router

warning — don’t use that command, if you are not sure, what you are doing

It allows you full control of your wireless card and to capture packets on specific channels. Remember that your wireless card supports both the 2.4ghz and the 5Ghz frequency.

So the first thing we will do, is “ifconfig”, to see the list of network cards in our MAC

Our wireless card is the en0, and now we will use the following command:

Sudo airport en0 sniff 6 ( capture packets on channel 6 )

The first screen shows that your wireless card starts to capture packets on channel 6. When you escape it using command-c, you will see where the packet capture is saved.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store