Security research and open source implementation of the Apple 'Wireless Accessory Configuration' (WAC) protocol

Apple 'Wireless Accessory Configuration' (WAC) research

Introduction

This repository contains some research on how the WAC protocol works. I was mostly interested to know how the WiFi network credentials are protected from being stolen. This lead to two main findings:

  1. The IoT device does not authenticate the client in any way. A malicious configurator can configure any device. A demo video can be found here.
  2. While the iPhone does authenticate the IoT device (with a hardware chip), there is no binding between the device identity and its private key. As such, an extracted key can be used to spoof any device and obtain the credentials. A demo video of this attack can be seen here.

To carry out the second attack you will need to desolder a chip from a legitimate accessory and mount it on another board.

Repository contents

Software:

This repository contains three major parts:

  1. A library for interfacing with the MFI chip.
  2. An application that can share access to the MFI chip over a network. While not needed, this will simplify your experimentation as you can now run the rest of the code on any system, even without attaching the chip to it.
  3. A Golang library that implements the WAC protocol. It contains an implementation of the client and server. Only the server needs access to an MFI chip to work.

Hardware:

A breakout board for the authentication chips that can be mounted on a Raspberry Pi Zero is provided here. To use it you need to add the following to your config.txt:

dtoverlay=i2c-gpio,bus=2,i2c_gpio_sda=27,i2c_gpio_scl=17
dtoverlay=i2c-gpio,bus=3,i2c_gpio_sda=19,i2c_gpio_scl=13

Bus 2 is used to access a MFI337S3959 (2.0C, addr=0x11) chip, while bus 3 is used to access a MFI343S00177 (3.0, addr=0x10) chip. It should be noted the library has only been tested using the 2.0C chip, but the code for 3.0 is likely pretty close to what is needed as it is based on Apple open source code.

When using this breakout board, start the authentication server as follows: authserver/authserver platform:/dev/i2c-2:22 platform:/dev/i2c-3:6:0x10

The finished board can be seen here: MFI chip breakout board

Simply mount the de-soldered chip onto the matching footprint and you should be good to go :).

If you are not confident soldering such a small chip, it may be possible to solder wires to the usually rather large I2C bus pull-up resistors in the accessory. I didn't try this, make sure to check that the voltage levels are compatible...

The library includes support to access the chip using a MCP2221(A) USB to I2C adapter. This can be another option to make an easy experimental setup. At least the 2.0C chip can work with 5V. To use this, run the authentication server as follows: authserver/authserver usb

To ensure the chip is working, the library performs an elaborate self-test while initializing the chip. If you see output like this when running the authentication server, it is working:

-> Chip ready: Type=2.0C FirmwareVersion=1 ProtocolVersion=2.0 Signature=20->128

-> Registering as 'IPA_xxxxxxxxxxxxxxxxxxx' and '0'

The xxxx will be replaced with the unique serial number of your chip.

Software usage

Configuring a device:

Connect the WiFi card of your computer to the accessory you want to configure. It will provide an open access point with DHCP. Run the client example as follows:

waclib/examples/client/client -ssid thessid -password thepassword

Follow the instructions shown on the screen. The device should connect to the network you configure.

Receiving configuration from iPhone:

The first step is setting up an access point that provides the required WAC beacon. A program to encode and decode such beacons is included. Its help is pretty self explanatory:

waclib/examples/beacon/beacon -h

The default flags are for a normal device, if you change the 7 to F the device will also ask for the AirPlay password. After running the beacon program with desired options it will output the WAC IE, for example:

Encode result: dd2400a0400007060011223344550002700301044e616d6502067761636c6962030454797065

If you are using hostapd to make the access point, simply put this hex string as a 'vendor_elements=' configuration entry. Set up the access point to not use any encryption and provide DHCP.

When the hostapd is running you should see your configured accessory parameters in the iPhone WiFi settings application.

Next you need to run the server application. This will handle the actual WAC protocol. Before you continue ensure you have a working MFI chip connected to your workstation in some way.

Proceed to run the WAC server usage command: waclib/examples/server/server -h

The parameters have the following function

  • Network interface configuration:
    • -apiface: Specify name of access point (hostapd) interface. If it is the same as the client interface, you can omit it.
    • -clientiface: Specify the name of the client interface. This is the interface that will join the configured network and is used for confirming the configuration.
  • Chip access:
    • -chip: Use a local chip. The format is the same as for the authserver. For example "-chip usb" will use a local USB to I2C bridge
    • -url: Specify url to access the authentication server. By default localhost with the default authserver configuration is used.
  • Discovery related:
    • -deviceid: A MAC address, should match what was entered in the beacon application.
    • -port: Port to run the WAC HTTP server on, value is not critical but you need to be able to bind to it.
  • Functionality:
    • -cfgscript: A script that will be executed with the configued WiFi SSID and password. It should connect the client interface to the desired network.
    • -honeypot: Just listen for requests and log them but never complete the process. You do not need the client interface.

If the server program is running you should be able to complete the WAC procedure on the iPhone and obtain the configured plaintext credentials.

Owner
Similar Resources

Official Go implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated builds are available for stable releases and the unstable master branch

Jan 8, 2023

RepoETH - Official Golang implementation of the Ethereum protocol

RepoETH - Official Golang implementation of the Ethereum protocol

HANNAGAN ALEXANDRE Powershell Go Ethereum Official Golang implementation of the

Jan 3, 2022

Go-ethereum - Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated b

Jan 4, 2022

Dxc - Go implementation of DxChain3.0 protocol

Dxc - Go implementation of DxChain3.0 protocol

DxChain 3.0 The Ecosystem Powered by DxChain 3.0 Smart Contract Platform While c

Nov 10, 2022

Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated builds are available for stable releases and the unstable master branch

Sep 20, 2022

Koisan-chain - Official Golang implementation of the Koisan protocol

Go Ethereum Official Golang implementation of the Koisan protocol. Building the

Feb 6, 2022

Ethereum go-ethereum - Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated b

Feb 17, 2022

Terra client in golang with multiple protocol implementation (anchor, astroport, prism, ...)

Terra A terra client with some protocol partial implementations (anchor, prism, terraswap type routers, ...) To be able to compile, you need to add th

Apr 11, 2022

This is a close to decentralized RSS3 Network implementation of RSS3 protocol v0.4.0 with full indexing function in Go

This is a close to decentralized RSS3 Network implementation of RSS3 protocol v0.4.0 with full indexing function in Go

This is a close to decentralized RSS3 Network implementation of RSS3 protocol v0.4.0 with full indexing function in Go

Aug 4, 2022
⛓ The security layer for the KYVE protocol.

The KYVE Chain v0.2.0 The chain nodes are the backbone of KYVE. The chain layer is a completely sovereign Proof of Stake blockchain build with Cosmos

Nov 11, 2022
Eunomia is a distributed application framework that support Gossip protocol, QuorumNWR algorithm, PBFT algorithm, PoW algorithm, and ZAB protocol and so on.

Introduction Eunomia is a distributed application framework that facilitates developers to quickly develop distributed applications and supports distr

Sep 28, 2021
hack-browser-data is an open-source tool that could help you decrypt data from the browser.
hack-browser-data is an open-source tool that could help you decrypt data  from the browser.

hack-browser-data is an open-source tool that could help you decrypt data ( password|bookmark|cookie|history|credit card|download

Dec 23, 2022
Open Source Ethereum Mining Pool With Go
Open Source Ethereum Mining Pool With Go

Open Source Ethereum Mining Pool Features This pool is being further developed to provide an easy to use pool for Ethereum miners. This software is fu

Mar 10, 2022
Open Source Etho Mining Pool - tuned for 8000000 block hardfork on EthoProtocol blockchain.
 Open Source Etho Mining Pool - tuned for 8000000 block hardfork on EthoProtocol blockchain.

Open Source Etho Mining Pool - tuned for 8000000 block hardfork on EthoProtocol blockchain. image to be updated soon! Features This pool is being furt

Aug 13, 2022
An open source smart contract platform

EOSIO - The Most Powerful Infrastructure for Decentralized Applications Welcome to the EOSIO source code repository! This software enables businesses

Jan 7, 2023
Interblockchain communication protocol (IBC) implementation in Golang.

ibc-go Interblockchain communication protocol (IBC) implementation in Golang built as a SDK module. Components Core The core/ directory contains the S

Jan 7, 2023
Implementation of the Filecoin protocol, written in Go
Implementation of the Filecoin protocol, written in Go

Project Lotus - 莲 Lotus is an implementation of the Filecoin Distributed Storage Network. For more details about Filecoin, check out the Filecoin Spec

Jan 9, 2023
Go Implementation of the Spacemesh protocol full node. 💾⏰💪
Go Implementation of the Spacemesh protocol full node. 💾⏰💪

A Programmable Cryptocurrency go-spacemesh ?? ⏰ ?? Thanks for your interest in this open source project. This repo is the go implementation of the Spa

Dec 29, 2022
Official Golang implementation of the Ethereum protocol

Go Ethereum Official Golang implementation of the Ethereum protocol. Automated builds are available for stable releases and the unstable master branch

Nov 24, 2021