Posts Tagged ‘airport’

Accessing Free Guangzhou Airport Wi-Fi on MacBook Pro

Saturday, December 2nd, 2017

Guangzhou airport has a crazy way of providing free wifi. If you have a Chinese phone you can receive a login account via text, but if you don’t have a Chinese number, then you have to go to a physical ticket machine, scan your passport, and quickly jot down (or photograph) the code that flashes on the screen for 15 seconds.

Once you have this code, you have to click “Ticket Cert” on the login page and enter the info.

This worked fine for me on my iPhone.

But when I tried to follow the same steps on my laptop, the “Ticket Cert” option did not appear on my browser login prompt. I saw a slightly different page that only had the SMS option (and a bunch of half-loaded CSS and javascript errors).

I tried many things including spoofing the UserAgent on my browser. Nothing seemed to work.

Finally, I changed the MAC address on my laptop to match my already-online iphone’s

ifconfig en0 ether [iphone's "Wi-Fi Address"]

This worked.

PS: So far, I have not managed to get any sort of vpn, proxy or ssh tunnelling to work.

Free wifi at Charles de Gaulle airport on laptop

Wednesday, December 25th, 2013

The Charles de Gaulle airport in Paris offers limited free wifi for mobile devices. To use this on your laptop just open your browser and go to the mobile start page: mobile site

I found this by switching my browser to use the iPhone user agent and opening a random page.

Share internet (via wifi Airport) applescript

Sunday, July 17th, 2011

Here’s an applescript we’ve been using at home to share the ethernet internet connection between our two laptops. The computer with the ethernet cord plugged in runs this script, then the other computer can connect to the wireless network of that computer’s name and share its internet connection.

tell application "System Preferences"
end tell

tell application "System Events"
	tell process "System Preferences"
		click menu item "Sharing" of menu "View" of menu bar 1
		delay 2
		tell window "Sharing"
			if value of checkbox 1 of row 11 of table 1 of scroll area 1 of group 1 is 1 then
				click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1
				click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1
			end if
			click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1
			delay 1
			if (exists sheet 1) then
				if (exists button "Turn AirPort On" of sheet 1) then
					click button "Turn AirPort On" of sheet 1
					delay 1
				end if
				click button "Start" of sheet 1
			end if
		end tell
	end tell
	tell application "System Preferences" to quit
end tell

Downloads (zip) Here’s a version wrapped into an app with a nice little icon so you can put it on your dock.

Security bug in Mac OS X 10.5 Airport: use Airport to retrieve username and password

Wednesday, September 9th, 2009

New solution below

I noticed when I wake up my MacBook Pro running Mac OS X 10.5 from sleep it tries to connect to a preferred wireless network. On failure it presents me with a list:

List of wireless networks

Airport has remembered passwords to networks to which I have previously connected. Even my university’s NYU-ROAM2 which uses LEAP has a remembered password (the LEAP username and password are actually remembered together as a WEP password of the form <username/password>).

AirPort reveals previous network's password

By selecting a protected network then checking “Show password” I can not only see passwords to previous wireless networks, but if I select some LEAP protected wireless network like NYU-ROAM2 I can see my username and password! This means anyone with access to your laptop could potential get your username and password, which in turn could allow the fiend to access other private information stored elsewhere using the same username and password.

I guess the lesson is to require a password upon waking up. You can do this by going to System Preferences > Security then making sure “Require password to wake this computer from sleep or screen saver” is checked.

Security preference pane

Though it does seem odd for AirPort to show these passwords without prompting at least for the current user’s password.

Update: It looks like just adding a prompt for the computer’s password at wake up is not enough. A user can bring up the list of previous wireless networks (and the ability to see remembered passwords) just by turning on and off AirPort. Any ideas for solutions to this problem?

New (stronger) solution:
Adding a password on wake up is not quite good enough. Mac does let you (as of some security update?) require administrative privileges to modify airport settings (turn ON of OFF, change/create networks).

Open Network Preferences (either through System Preferences) or by clicking on the airport symbol:
open network preferences using airport icon

In Network Preferences select AirPort on the left and click “Advanced”:
advanced button in network preferences

Under the (default) Airport tab in the advanced window, make sure “Require Administrator password to control AirPort” is selected.
require administrator password to control airport

Be sure to finish by applying the changes.

Applescripted airport connection

Monday, August 31st, 2009

My university uses a closed network connection available in all its buildings. To connect on my Mac I have to set up a a network each time. This only entails

  1. Clicking on the airport symbol
  2. Selecting Other...
  3. Typing in the network name
  4. Selecting LEAP
  5. Entering my username and password

The wireless on my older mac laptop is some what weak so repeating these few steps is tedious and worth script (only my username is ever remembered even after repeated connections).

Here’s a script to connect to a hard-coded network with a hard-coded username (the password of course is not hard-coded):

property passwd : ""
set network_name to "NYU-ROAM2"
set user_name to "abc123"
set results to do shell script "airport -s " & network_name
if results does not start with "No scan results for network" and results is not equal to "No networks found" then
	set passwd to text returned of (display dialog "Username:
" & user_name & "
Password:" default answer passwd default button 2 with icon 2 with title "Airport Roam-o-matic" with hidden answer)
        set results to do shell script "airport -A" & network_name & " --password=\"<" & user_name & "/" & passwd & ">\" 2>&1"
        if results starts with "Error" then
                display dialog "Could not connect to " & network_name & ".

Probably the password you entered did not match your username: " & user_name & "." buttons {"OK"} default button 1 with icon 0 with title "Airport Roam-o-matic"
        end if
        display dialog network_name & " network not found." buttons {"OK"} default button 1 with icon 0 with title "Airport Roam-o-matic"
end if

Note: My network lets me fake a LEAP username and password using this <username/password> WEP password.

Note: For more general use just replace the first two lines with:

set network_name to text returned of (display dialog "Enter the network name:" default answer "" default button 2 with icon 2 with title "Airport Roam-o-matic")
set user_name to text returned of (display dialog "Enter your username:" default answer "" default button 2 with icon 2 with title "Airport Roam-o-matic")

Update: I added passwd as a property so that it is remembered. Also, I made the prompt contain the username and look a little prettier.

Note: If you get an error like sh: airport: command not found, then you’ll need to run this in

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport