Alex Yancey

Did you lose your AirPods?

A friend found some AirPods on the ground and tapped them to his phone, revealing only the serial number and the last four digits of the owner's number. He turned to me for help.

All Out

Could I really brute-force spam all phone numbers ending in 1234 and find the right owner? This seemed a bit impractical, so I had to think of ways to whittle the number down to something more manageable.

Area Code

I started with the assumption that the owner lived near me in the Portland metropolitan area. With that, I restricted the search to our local area code*. Sure, they could be from out of town, but hey, let's give it a shot.

999 numbers is a manageable list, but I wanted to trim the number a bit more. Sure, sending a thousand SMS messages isn't much to a determined spammer, but I didn't want to be that noisy or piss off Twilio.

Possible matches: 999

Prefixes

Next, I narrowed it down by central office code (commonly called prefix) (those three digits after the area code). Most of Portland’s are assigned, but only 26% to wireless carriers. Also, 000-199 are reserved codes that aren't available for telcos. I lied earlier, sorry.

Possible matches: 232

iMessage Lookup API

firefox_pReKil9SPG

It's a safe bet that the owner has an iPhone with iMessage turned on. We can use this assumption to narrow down the list further by filtering out any non-iMessage phone numbers. I ran a check using this API. (The API is probably used for shady stuff, but my intentions were pure.)

Total matches: 84

Did you lose your AirPods?

With the list whittled down, I avoided Twilio entirely by using a script on my MacBook to send iMessages in bulk. Now we wait.

1 Match

Bingo! I found the owner, relayed the contact info to my friend, and the AirPods were returned to the right ears.

Notes