OpenDrop: An Open Source Apple AirDrop Implementation in Python

OpenDrop is a command-line tool that implements the Apple AirDrop protocol in Python, enabling file sharing between devices over Wi-Fi, including with Apple devices.

What is OpenDrop?

OpenDrop is an open-source, command-line tool that implements the Apple AirDrop protocol in Python. Its standout feature is protocol-level compatibility with Apple AirDrop, meaning you can use it to share files directly with Apple devices running iOS and macOS over Wi-Fi. This is achieved by reverse-engineering the proprietary AirDrop protocol, making it a valuable tool for developers, security researchers, and anyone who wants to understand or interact with Apple's file-sharing ecosystem without being locked into Apple hardware.

Why OpenDrop Matters

AirDrop is a convenient, zero-configuration file-sharing feature built into Apple's ecosystem. However, it's closed-source and tightly coupled to Apple's hardware and software. OpenDrop breaks this barrier by providing a portable, cross-platform implementation that can run on Linux and macOS. This is particularly useful for:

  • Security Research: Understanding the AirDrop protocol, its security properties, and potential vulnerabilities.
  • Cross-Platform File Sharing: Sharing files from a Linux machine to an iPhone or Mac without needing a third-party service or cloud upload.
  • Automation: Integrating AirDrop-like functionality into scripts and automated workflows.

How It Works

OpenDrop relies on two key technologies:

  1. Apple Wireless Direct Link (AWDL): AirDrop exclusively runs over AWDL, a proprietary Wi-Fi link layer used by Apple devices for peer-to-peer communication. OpenDrop is supported on macOS natively and on Linux via an open re-implementation of AWDL, such as OWL.

  2. Python and libarchive: The tool is written in Python (>=3.6) and depends on libarchive for handling file archives. On macOS, you may need to install a newer version of libarchive via Homebrew:

brew install libarchive

OpenDrop automatically sets DYLD_LIBRARY_PATH to use the Homebrew version. On Linux, the system's libarchive is typically sufficient.

Installation

Installing OpenDrop is straightforward via pip:

pip3 install opendrop

For the latest development version, clone the repository and install it:

git clone https://github.com/seemoo-lab/opendrop.git
pip3 install ./opendrop

Usage

Sending a File

Sending a file is a two-step process: first discover nearby devices, then send.

  1. Discover receivers:
$ opendrop find
Looking for receivers. Press Ctrl+C to stop ...
Found index 0 ID eccb2f2dcfe7 name John’s iPhone
Found index 1 ID e63138ac6ba8 name Jane’s MacBook Pro
  1. Send a file:
$ opendrop send -r 0 -f /path/to/some/file
Asking receiver to accept ...
Receiver accepted
Uploading file ...
Uploading has been successful

You can also use the device ID or name instead of the index. OpenDrop tries to match the input in the order: index, ID, name.

Sending a Web Link

Since version 0.13, OpenDrop supports sending URLs. When received on an Apple device, the link opens directly in the browser:

$ opendrop send -r 0 -f https://owlink.org --url

Receiving Files

Receiving is simpler. Use the receive command to accept all incoming files automatically. Files are saved in the current directory:

$ opendrop receive

Current Limitations

OpenDrop is a research project and has several known limitations:

  • Bluetooth LE Triggering: Apple devices start their AWDL interface and AirDrop server only after receiving a custom Bluetooth Low Energy advertisement. This means Apple devices may not be discovered even if they are set to "everyone" mode.
  • No Peer Authentication: OpenDrop does not verify that the TLS certificate is signed by Apple's root, nor does it validate the Apple ID record. It also automatically accepts all incoming files due to a missing connection state.
  • Single File Sending: Unlike Apple AirDrop, OpenDrop does not support sending multiple files at once.

Under the Hood: The Research

OpenDrop was developed by the Seemoo Lab at TU Darmstadt as part of the Open Wireless Link project. The team published several academic papers detailing their reverse engineering efforts:

  • PrivateDrop: A privacy-preserving authentication scheme for AirDrop (USENIX Security '21).
  • A Billion Open Interfaces: A study of attacks on iOS and macOS through AWDL (USENIX Security '19).

These papers provide deep insights into the AirDrop protocol's security and privacy properties, making OpenDrop not just a tool but a foundation for further research.

Conclusion

OpenDrop is a remarkable open-source project that democratizes access to Apple's AirDrop protocol. While it has limitations, it serves as an excellent tool for developers, security researchers, and anyone needing cross-platform file sharing without relying on cloud services. Its command-line interface makes it easy to integrate into scripts and automated workflows, and its open-source nature invites contributions to address its current shortcomings.

Source

seemoo-lab/opendrop: An open Apple AirDrop implementation written in Python