
OpenDrop: An Open Source AirDrop Implementation - vsurabhi
https://github.com/seemoo-lab/opendrop
======
felipeerias
If you are interested in possible uses for this kind of technology, my R&D
work until recently has been to find use cases for WiFi Aware and bring them
to life.

Some examples:

* 1-tap file transfers: [https://darker.ink/static/media/uploads/08_awarebeam_1.mp4](https://darker.ink/static/media/uploads/08_awarebeam_1.mp4)

* Sharing presentations, images and drawings: [https://darker.ink/static/media/uploads/05_meshpresenter_1.m...](https://darker.ink/static/media/uploads/05_meshpresenter_1.mp4)

* Playing Quake 3 (OpenArena): [https://darker.ink/static/media/uploads/02_openarena_1.mp4](https://darker.ink/static/media/uploads/02_openarena_1.mp4)

If you want to know more details, this talk is a good starting point:

[https://fosdem.org/2019/schedule/event/device_to_device_netw...](https://fosdem.org/2019/schedule/event/device_to_device_networks/)

[https://darker.ink/blog/mobile-design-with-device-to-
device-...](https://darker.ink/blog/mobile-design-with-device-to-device-
networks/)

------
Fnoord
Interestingly the article on the bottom links to a Usenix 2019 (held Aug 14 -
16) paper with the title "A Billion Open Interfaces for Eve and Mallory: MitM,
DoS, and Tracking Attacks on iOS and macOS Through Apple Wireless Direct Link"

Abstract:

"Apple Wireless Direct Link (AWDL) is a key protocol in Apple's ecosystem used
by over one billion iOS and macOS devices for device-to-device communications.
AWDL is a proprietary extension of the IEEE 802.11 (Wi-Fi) standard and
integrates with Bluetooth Low Energy (BLE) for providing services such as
Apple AirDrop. We conduct the first security and privacy analysis of AWDL and
its integration with BLE. We uncover several security and privacy
vulnerabilities ranging from design flaws to implementation bugs leading to a
man-in-the-middle (MitM) attack enabling stealthy modification of files
transmitted via AirDrop, denial-of-service (DoS) attacks preventing
communication, privacy leaks that enable user identification and long-term
tracking undermining MAC address randomization, and DoS attacks enabling
targeted or simultaneous crashing of all neighboring devices. The flaws span
across AirDrop's BLE discovery mechanism, AWDL synchronization, UI design, and
Wi-Fi driver implementation. Our analysis is based on a combination of reverse
engineering of protocols and code supported by analyzing patents. We provide
proof-of-concept implementations and demonstrate that the attacks can be
mounted using a low-cost ($20) micro:bit device and an off-the-shelf Wi-Fi
card. We propose practical and effective countermeasures. While Apple was able
to issue a fix for a DoS attack vulnerability after our responsible
disclosure, the other security and privacy vulnerabilities require the
redesign of some of their services." [1]

I got nothing to add regarding OpenDrop other than that I love
interoperability, and that I love it when FOSS enables this.

[1]
[https://www.usenix.org/conference/usenixsecurity19/presentat...](https://www.usenix.org/conference/usenixsecurity19/presentation/stute)

~~~
toxik
I can’t hep but think that these seemingly numerous security flaws are a
product of proprietary software development. There is the old “many eyes” idea
for software bugs, but even on a standards level. Did Apple not send out an
RFC? Isn’t this type of architectural level screw up exactly what you want to
avoid with an RFC?

I’m glad Apple are taking the privacy issue to heart, but for every inch we’ve
won in privacy, we lost an inch in openness and interoperability. Apple is
perhaps one of the worst offenders when it comes to vendor lock-in.

I use almost only Apple products out of sheer laziness (and honestly inertia.)
At least their war with Qualcomm and NVIDIA creates some competition in their
respective markets...

~~~
adestefan
The “many eyes” hypothesis is routinely debunked when severe security bugs are
found in things like the Linux kernel that have been there for years. The same
is true for standards that end up being fundamentally broken at later dates.
In the end software and hardware is so overly complicated that we cannot
currently build secure systems.

~~~
imglorp
Debunked is a loaded term.

It's a tradeoff. The point is not MANY eyes, it's ANY eyes. Proprietary
software has NO public eyes on it, zero, and the vendor must (1) report to you
promptly when there's a new vulnerability, (2) produce a fix for it. Most
vendors do neither until forced. How many undisclosed vulns does your vendor
have? You'll never know.

Of course FLOSS has bugs, it's software, and ALL software has bugs. In the
FLOSS case you know what everyone else knows, AND you can fix them, hire
someone to do it, or choose not to use the software, all with that knowledge.

~~~
jodrellblank
> Proprietary software has NO public eyes on it, zero

If that were true, security flaws would never be found in proprietary software
by outsiders. And they are, so it's not true. Eyes have less visibility into
the codebase, but people are looking and do find flaws.

> How many undisclosed vulns does your vendor have? You'll never know.

How many undisclosed vulns does RedHat, Canonical, or Mozilla have in their
FLOSS software? You'll never know.

> Of course FLOSS has bugs, it's software, and ALL software has bugs.

Then "many eyes makes bugs shallow" is at least partly debunked and your "ANY
eyes make bugs shallow" is debunked completely - otherwise the original
developers would see every bug, in FLOSS and proprietary software.

> In the FLOSS case you know what everyone else knows

There may be bugs which nobody knows about. The claim "many eyes make bugs
shallow" suggests that open source software has more eyes on the code, and
that having more eyes on the code is all it takes to reduce bugs. OpenSSL
turned out to have very few eyes on the code, and it wouldn't be too
surprising if codebases with many eyes on them had the developers focused on
the bits they were developing and not looking for security flaws.

------
em3rgent0rdr
This is great, especially considering that AirDrop is used for instance by
Hong Kong protesters to bypass the great firewall [1].

[1] [https://qz.com/1660460/hong-kong-protesters-use-airdrop-
to-b...](https://qz.com/1660460/hong-kong-protesters-use-airdrop-to-breach-
chinas-firewall/)

~~~
est
GFW is only implemented in the mainland China, not Hong Kong.

    
    
        China == (mainland + (Hongkong SAR + Macau SAR) + (... possibly other de jure claims))
    
    

To use Airdrop the main advantage is it can be used to spam everyone nearby.

If it can be used by protestors it also can be used by advertisers.

~~~
arghwhat
They are not using AirDrop to bypass the GFW for themselves, they are using it
to spread information to citizens that are otherwise normally subject to GFW
and therefore only have government-approved or government-generated
information available to them.

Mainland news put HK protesters as violent, rebellious youngsters that are
causing trouble and injury to everyone else by having greedy demands of
something better than what mainland has. Such story leads to minimal sympathy
and curiosity.

Even knowing that this information is filtered, few will end up truly
questioning it, and thus even when they leave GFW, they will not know that
there is conflicting information to find.

~~~
gruez
That’s a very loose definition of the word “evade” and the headline is
definitely misleading. The average person was probably expecting to find some
sort of censorship evasion while current being censored.

~~~
arghwhat
Censorship evasion is doable within minutes for most, which is well known for
those interested in it.

However, many do not feel compelled to evade it, and have no idea of what
happens "on the outside".

~~~
sjnair96
Censorship evasion is no longer trivial. Deep Packet Inspection (DPI) exists
and makes it difficult to use even VPNs. Shadowsocks works but has limited UDP
support out of the box iirc.

~~~
arghwhat
There are massive regional variations, so what I say is likely not universal,
but my non-techie acquaintances still successfully use VPNs, in their case to
use services like Facebook and WhatsApp.

I do not know what provider they use, but their knowledge of VPNs go no
further than knowing that "VPN = facebook access", so it would seem that
"commoners" still manage at least in some bigger regions.

------
micheljansen
I wonder if it's more reliable than Apple's own implementation for MacOs. It
used to be rock solid – and between iOS devices it still is – but between Macs
I regularly have to switch both to "Search for an older Mac" to make them see
each other, with no explanation why.

~~~
shimms
I was complaining about this with a coworker today. AirDrop 1 was flawless,
since 2.0 it has been more often than not unreliable between Macs.

I’d love to know if anyone knows the technical details about what caused this
regression?

~~~
flixic
Interesting, my own experience has been the opposite. From what I remember v1
was constantly broken, initial v2 was not much better but now everything is
very smooth all the time.

~~~
AndrewStephens
I had the same experience. The first AirDrop worked about 30% of the time,
once AirDropv2 came along it works 90% of the time.

The "Share Only With Your Contacts" option still seems broken to me, I usually
have to temporarily allow all access before AirDropping something.

------
mxuribe
It is 2019, and it is quite surprising - and disappointing - that we STILL
haven't universally solved the means to easily, securely, and (yes, I'll use
this term again) universally share files. I wish we could share files in a
peer-to-peer fashion securely without hindrance of mobile platform, nor
blockage of network MiTM, etc. </sigh>

~~~
skrowl
[https://files.google.com/](https://files.google.com/) is a standard and it
works on the vast majority of phone sold this year, by every manufacturer
except Apple. Checks all 3 of peer-to-peer, secure, no MiTM network blockage.
It's only 11MB.

Many popular file manager apps on android have peer-to-peer xfers as well, via
WiFi direct, etc.

EDIT - As people are pointing out this isn't universal because it doesn't work
on Apple devices or desktops / laptops, but it's as close as I can think of
currently.

~~~
ahmedfromtunis
Almost. People need to install the app to use its transfer functionality, and
it does not work with computers. We're still far from the universal, no-
install solution that should've existed for so many years now.

~~~
iforgotpassword
Well, no install basically means every OS vendor needs to ship a proper and
compatible implementation (hah yes that'll surely happen) or you basically
need something web based which means it needs an internet connection for
bootstrapping.

------
andrewstuart
I'm guessing someone will take a $10 esp32 chip and put this code on it and
just drop the esp32 in some hidden location and it just sending images to any
open airdrop that passes by.

~~~
perillamint
ESP32 theoretically can provide all of the hardware requirements (WLAN monitor
mode, BLE) but there is one missing part:

> Triggering macOS/iOS receivers via Bluetooth Low Energy. Apple devices start
> their AWDL interface and AirDrop server only after receiving a custom
> advertisement via Bluetooth LE (see USENIX paper for details). This means,
> that Apple AirDrop receivers may not be discovered even if they are
> discoverable by everyone.

If someone reverse engineer BLE advertisement, yes they can build such
hardware.

~~~
Kliment
This has been reversed - see [https://hexway.io/blog/apple-
bleee/](https://hexway.io/blog/apple-bleee/)

~~~
NKCSS
Thanks, I did not know about this; looks like something fun to play with :)

------
postcynical
Could this technology be used to create a "shadow" internet/network/messaging
service where devices connect and communicate directly with each other. This
way governments can't just block internet access or services during
demonstrations.

~~~
neilalexander
For what it’s worth, I have been able to get the Yggdrasil Network
([https://yggdrasil-network.github.io](https://yggdrasil-network.github.io))
to peer over AWDL, allowing nearby Macs to mesh without even being connected
to the same Wi-Fi network, or any network at all.

It’s not perfect - there are trade offs, like how the wireless performance is
reduced somewhat when AWDL is active due to channel hopping and how AWDL
expects a single node to play the role of clock sync source. It’s also not
very well tested yet.

However, it works and in theory it allows an infrastructure-free IPv6 mesh
network to be built ad-hoc.

~~~
big_chungus
Any chance you could throw together a quick blog post on this? Or maybe a
quick gist; doesn't have to be polished.

~~~
neilalexander
Sure thing - I threw this together over the last hour or so:
[https://yggdrasil-network.github.io/2019/08/19/awdl.html](https://yggdrasil-
network.github.io/2019/08/19/awdl.html)

~~~
big_chungus
Thanks, that was an educational read. Much appreciated.

------
devtanna
I wish we had something like AirDrop to work between android and iOS devices.

~~~
jumelles
iMessage too. It's insane to me that this is still a problem.

~~~
tecleandor
That's not a problem. That was precisely Apple's idea: a not interoperable
message network.

We had XMPP among others, and Apple decided not to be open. We now also have
Signal or Telegram, which are multi-platform.

~~~
spuz
Sorry but how is iMessage being a walled garden not a problem for those
outside that wall?

~~~
snypox
It might be a problem but it’s definitely intended by Apple. FaceTime, too.

~~~
stephenr
Steve (Jobs) _famously_ , and impulsively claimed they were going to release
FT as open source - so impulsive that he never even checked with their lawyers
first, because it never happened due to legal/licensing issues, not because
they didn't want to.

~~~
pbhjpbhj
Do you think that's true, sounds exactly like a publicity stunt to ensure a
big launch in the face of having no answer to "is it interoperable".

If you say "yeah sure it is, we're even releasing it as open source" then you
prevent the product falling at the first hurdle because people want an
interoperable solution. Once you have adoption network effect carries you
through.

Sounds like most probably a standard corporate lie by Jobs; do you have
evidence to the contrary?

~~~
stephenr
Very little original software from apple is open source.

Things that they’ve adopted/forked/bought are but there’s not much they’ve
started from scratch and released as OSS.

There is almost no expectation of it from people who know Apple.

Promising something unexpected and not delivering is undoubtedly more damaging
than saying nothing.

------
ekwogefee
Cross-platform local file transfer alternative with resumable file transfer:

[https://feem.io](https://feem.io)

~~~
amq
Looks great, I wonder why it doesn't have more traction.

~~~
elcomet
Maybe because it's not free: 5$ a year for 4 devices but only the same type,
you cannot install it on your Mac and your iPhone With only one licence. So if
you want to transfer between Mac and iPhone, it's at least 10$ a year.

~~~
jclardy
And the other big problem - that is $5 a year just for your own devices. I
have plenty of ways to move files from one machine to another, but if I have a
file that I want to give to a family member sitting next to me, or a co-worker
across the table the chances of him having the same service is zero unless I
sell them on it. With AirDrop I just look at what hardware they have and
immediately know if it is compatible.

------
epixcz
Xiaomi, Oppo And Vivo just introduced their own version of AirDrop.
[https://www.forbes.com/sites/bensin/2019/08/19/xiaomi-
oppo-a...](https://www.forbes.com/sites/bensin/2019/08/19/xiaomi-oppo-and-
vivo-team-up-introduces-own-version-of-iphones-airdrop/)

~~~
dijit
Seems like theirs is not cross-compatible with airdrop. But OpenDrop is.

~~~
rektide
If there's a standard for this new thing, apple can stuff it.

------
smurfpandey
An HTML5 alternative:
[https://github.com/cowbell/sharedrop](https://github.com/cowbell/sharedrop)

Uses WebRTC for file transfer.

~~~
theomega
Just to make it more obvious: You don’t have to self host it, there is a free
(no registration) Version deployed at
[https://sharedrop.io](https://sharedrop.io)

Works perfect between IOS, Android, Linux, MacOS and Windows.

~~~
explorigin
Why does it need firebase? That doesn't seem to tic the "not-google" box. :-)

~~~
kozziollek
FilePizza also uses WebRTC without Firebase -
[https://file.pizza/](https://file.pizza/)

------
shireboy
Let's talk for a minute about why all the Apple things aren't open. There is
zero about iMessage or AirDrop that should be proprietary. The only reason I
know of is vendor lock-in, and that stinks for users. It would be way more
helpful to way more people if these features were ubiquitous, open, and
standards-based like SMTP or IMAP is for email. We wouldn't except an Apple-
only iMail, why do we accept iChat and iPhotoShare?

~~~
Terretta
OK, I'll talk about why...

What does Apple sell? A commodity computing device running undifferentiated
software? Or the experience of a holistic tool?

When someone distributes a Messenger by itself, you don't ask why it isn't
open. You don't ask why the hardware device isn't open. Why should a vendor
unbundle the two just to make you happy?

What if it doesn't really unbundle, what if the capabilities combine to offer
most buyers something they value more than pieces parts?

~~~
shireboy
I totally get that argument for things that aren’t commodity. Chat and file
share should be interoperable services in 2019. Like Email is and has been for
ages (though not always as any GroupWise or BBS user will tell you). The
vendors can bundle and have closed source implementations, but by definition
they should work with any provider. But I feel the same way about “you can
only iMessage other iPhones” as I would if I could only email other iPhones
(or as a better analogy if emails to non-iPhones were reduced in
functionality.) and yes, they should make me happy- I’m the customer.

------
krtkush
I haven't looked at the OP yet but as convenient as AirDrop is, I find its
reliance on both BT and WiFi confusing. One needs both the devices to be
connected to the same network to be able to able to drop stuff.

Few days back my home router broke down and I was unable to send URLs from my
iPhone to Mac just because there was no common network.

I wish for AirDrop to be more like Pushbullet.

~~~
dannyw
You just have to be within bluetooth distance; AirDrop doesn't require the
same wifi network. It does require wifi to be enabled, because AirDrop creates
its own wifi network side channel for the actual transferring of files.

~~~
krtkush
Really? I'll give it a try again. It was clearly not working for me when the
router was down.

~~~
lawtalkinghuman
Yes, I’ve used it to send photos/videos I’ve taken to friends while outside in
places where there are no wifi networks.

~~~
tonyedgecombe
I wonder if it's different if you have it set to "Contacts only". It may need
to connect to iCloud.

~~~
darrenf
I have mine set to Contacts Only, and regularly use it to move photos between
iPhone and iPad when on flights (and indeed other locations) without wifi or
cellular.

------
neop1x
It's sad there is a certificate involved so it can't be 100% compatible open
alternative. I use Linux with KDE and KDE Connect which offers "send file"
functionality from Android and it's enough for my use case.

------
rolltiide
Get this into Android at the OS level and I would consider one of those sexy
flagship devices

But it would also need to seamlessly mix bluetooth and wifi discovery too.

------
mobilemidget
Would it also be possible to share contacts and links to sites? Thinking of a
new reception desk feature (lots of apple customers)

~~~
dsl
I believe AirDrop defaults to "Contacts Only" so you'd need to have every
customer add your reception phone number.

------
andrewstuart
Is there any valid use cases for something like "legitimate airdrop"?

Maybe things like hyper local advertisements.

~~~
azinman2
I wouldn’t consider that legitimate at all. Legitimate airdrop is its exact
intended use case: p2p transfer between people who are both consenting into
it.

------
edandersen
How hard would it be to use this to spam iOS devices where AirDrop is set to
"Everyone"?

------
new_here
Not all heroes wear capes.

------
rektide
Balls in Android's court to deliver some kind of p2p connectivity that works
beyond Android2android. Can't happen soon enough. Stop playing with yourself &
start doing real computing, Android.

~~~
fulafel
WebRTC has been around for a while.

~~~
rektide
What a dumb reply. Webrtc works on the web for p2p ok. But how do people in
the same area transfer files with each other? There are huge rendezvous
problems webrtc comes no where near addressing.

------
bborud
God, I wish people would stop using Python for these sorts of things.

It is an okay language, but after tracking down why it doesn't build and
considering messing around in my system and making either installing older
versions of libraries or messing around with symlinks I stopped and asked
myself "really? I want to spend my time fixing this?" and just deleted the
entire clone of the git repos.

Python is a nice language and all, but it is not a language suitable for
writing applications that you distribute. (I wish the Python core developer
would devote some time to making Python less horrible for distributing
applications, but after around 30 years, I don't think so).

~~~
djsumdog
I honestly haven't run into this issue in a long time. `pip install --user` is
one of your friends. Just using the official python:3 docker container is
another. If you really want, you can even go back to virtualenvs.

npm was also really bad about nothing building or working a few years back.
It's improved, and there are alternatives like yarn. Rust/Cargo has this issue
as well (whenever I attempted to pick up some Rust; every example I found
would break -- constant language changes were an issue; not sure if that's
still the case).

Package management is a big problem in general, but we have solutions like the
ones I've mentioned. This is a bad argument against not using Python. I
honestly thing this type of application is fine in Python (you might need a
privileged container if you go the docker route; wasn't sure how low level the
Wi-Fi stuff it needs is).

What language do you recommend for this type of application and why?

~~~
bborud
Primarily any language that can produce executable binaries. Preferably
statically linked binaries so that you can ship a unit that will not depend on
the state of the system you try to run things on.

(With disk and memory sizes, dynamically linked binaries aren't really as
relevant anymore since the often trivial cost of size more than makes up for
the nontrivial cost of having to fiddle around to make things actually work)

~~~
hultner
It's possible to produce a self-contained executable with Python, there's
multiple solutions for this it's just not a part of the core language.

I agree that the situation isn't perfect in the python world but it's actively
being worked on and I think PyOxidizer looks like one of the most interesting
recent developments in this space:
[https://pyoxidizer.readthedocs.io/en/latest/](https://pyoxidizer.readthedocs.io/en/latest/)

Some other alternatives (depending on your use case, e.g. target platform) are
PyInstaller, py2exe, py2app, cx_Freeze, Shiv, PEX (basically tooling for
native .pyz), XAR, Nuitka (compiles Python into a native binary), pyninst
(creates windows installer), PEP 441 style .pyz (executable python archive,
can easily vendor in dependencies). Then there's tools like fpm if you want to
create packages for deb, rpm, FreeBSD, macOS .pkg, paceman, tar-archives, etc.

I've used some of these in enterprise settings building rich GUI-applications
being distributed to end users who have no idea of what Python is and to whom
underlying technology choices are invisible.

~~~
bborud
So with so many solutions to the same problem being made: which do you choose?

The thing is: for it to be useful people have to use it. And for people to use
it nothing works better than one clear, idiomatic way.

If you have many solutions you often end up having no solution.

