• Stars
    star
    138
  • Rank 264,508 (Top 6 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 3 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

AirTag instrumentation including AirTechno and firmware downgrades.

AirTag Scripts & Resources

FЯIDA Script Overview

AirTag: Play custom sound, UWB, firmware version, downgrade

Prerequisites

The scripts require a jailbroken iPhone, paired with an AirTag, and a host system, running FЯIDA.

AirTag support was introduced as of iOS 14.5. So far, we tested the scripts provided here on various iOS versions (14.6, 14.7, 14.8) on checkm8-supported devices. The scripts might run on Fugu14 as well, but we didn't test that yet.

Run custom tasks, enumerate commands

Use hook_durian.js to play custom sounds aka AirTechno, and also run and decode all other L2CAP commands. Commands are described by opcodes, and opcodes can be enumerated to list their meanings.

It's possible to run raw commands. However, some commands require a mutex or special state. Thus, ideally, create a task, which will take care of creating a command, including mutex handling. Objective-C allows to extract a full command list, included in the comments of hook_durian.js, so that you don't need to enumerate them. For example, unpairTask, stopSoundTask, etc.

// run a predefined task
d.performTaskByName('stopSoundTask');

// run a task with custom opcode 0x01 and payload 0x02030405
d.performTaskWithCommand([1, 2, 3, 4, 5]);

Some tasks require parameters. These aren't fully reverse engineered yet. Depending on the command, you might need to add a custom function. For example, you can play custom sounds:

// play sound sequence id 1, twice, with 0 offset, and 0 pause
d.playSoundSequence[1, 2, 0, 0];

To set the DurianService etc. to call task, manually play a sound via the Find My app on the AirTag once.

Hook the firmware update process for downgrades

A detailed description of the downgrade process including script explanations is available on YouTube.

1. Download the firmware version you want

The iPhone Wiki hosts an up-to-date list of all firmware updates released for the AirTag. Note that the very first stock version (1.0.225) was never released as OTA, so you cannot use the method here to downgrade to the very first version that did not have any anti-stalking protections.

2. Extract the U1 firmware (aka Rose) from the super binary (optional)

If you want to downgrade the U1 firmware as well, you can extract it using DurianFirmware_extract.py.

mkdir airtag_firmware_1A276d
cd airtag_firmware_1A276d
wget https://updates.cdn-apple.com/2021/patches/071-45785/4132D4FE-1C5A-498E-8A6D-678A026679AF/com_apple_MobileAsset_MobileAccessoryUpdate_DurianFirmware/ae34f4b8aec8a4d4562227109be101728b7bef20.zip
python3 DurianFirmware_extract.py AssetData/DurianFirmware.acsw/DurianFirmwareMobileAsset.bin

This will extract the following files, with ftab being the U1 firmware.

tag : blap    offset : 0x9c       size : 0x38340
tag : sftd    offset : 0x383dc    size : 0x1b400
tag : bldr    offset : 0x537dc    size : 0x5f9c
tag : basg    offset : 0x59778    size : 0x47
tag : sdsg    offset : 0x597c0    size : 0x48
tag : blsg    offset : 0x59808    size : 0x47
tag : ftab    offset : 0x59850    size : 0x924c5

3. Overwrite the U1 firmware while the downgrade is running (optional)

Replace the sha384sum of rkos and dsp1 in the hook_durian_update_fud.js script with the matching ones. For this, you also have to split the ftab using the external ftab_split.py script.

ftab_split.py ftab.bin 
sha384sum rkos 
    1fcb05b377eb405eeffc5ad60efce6aeed3b83d834e0403bd88a142d84c6082ea6c649ebf14ae05b1a87d159e9dc167c  rkos
sha384sum sbd1 
    928a226b85b52c75f07fb3cd89f1c38a783bb9834de647407b935a952359d36b243a58fa43a172d1e39c3d432d1a3030  sbd1

Now we can use the TOCTOU to overwrite the firmware. Double-check which firmware is being used for the update, the folder might differ. The following is running on the iPhone:

iPhone:/private/var/MobileAsset/AssetsV2/com_apple_MobileAsset_MobileAccessoryUpdate_DurianFirmware/[your_version].asset/AssetData/DurianFirmware.acsw root#
   while true; do cp /var/root/ftab_rose_airtag_old.bin ftab.bin; sleep 1; done

4. Run the downgrade

If you're not downgrading Rose and only the nRF parts, you might need to adapt overwrite_firmware.py. Otherwise, simply run:

python3 overwrite_firmware.py

Now, remove your AirTag from your account and pair it again. The update should start within 5 minutes. If this wasn't the case, check your idevicesyslog. Possible reasons:

  • Concurrent interaction with the AirTag that delayed the update process by 2h 30min. Just pair again.
  • The current AirTag firmware version has a deploymentLimit. Can probably fixed by overwriting the xml file in the same folder as the asset location on the iPhone.

L2CAP command opcodes

The full list of L2CAP opcodes, since they might also be useful for reverse engineering and building clients independent of iOS. Note that Durian opcodes are for AirTags, and Hawkeye opcodes are likely for third-party Find My devices.

Durian opcode list: 
[d] 0: Acknowledge
[d] 1: Rose Init
[d] 2: Rose Ready
[d] 3: Rose Start Ranging
[d] 4: Rose Ranging Complete
[d] 6: Rose Stop
[d] 7: Get Firmware Version
[d] 8: Stop Sound
[d] 10: Leashing
[d] 11: Set Max Connections
[d] 12: Get Multi Status
[d] 13: Set Obfuscated Identifier
[d] 14: Set Mutex
[d] 15: Set Near Owner Timeout
[d] 18: Get Firmware Version (Deprecated)
[d] 19: Unpair
[d] 21: Rose Set Paramaters
[d] 22: Rose Stop Ranging
[d] 24: Get User Stats
[d] 32: Abort FWDL
[d] 34: Rose Error
[d] 36: Rose P2P Timestamp
[d] 37: Rose Debug P2P Timestamp
[d] 38: Set Tag Type
[d] 39: Get Battery Status
[d] 40: Play Sound Sequence
[d] 42: Set Wild Mode Configuration
[d] 43: Roll Wild Key
[d] 45: Set Absolute Wild Mode Configuration
[d] 174: Fetch Current Key Index
[d] 175: Play Unauthorized Sound
[d] 177: Set Key Rotation Timeout
[d] 180: Dump Logs
[d] 181: Check Crashes
[d] 185: Induce Crash
[d] 195: Enable/Disable UT PlaySound Rate Limit
[d] 197: Set Central Reference Time
[d] 199: Set Accelerometeter Slope Mode Configuration
[d] 200: Set Accelerometer Orientation Mode Configuration
[d] 201: Get Accelerometer Slope Mode Configuration
[d] 202: Get Accelerometer Orientation Mode Configuration
[d] 203: Get Accelerometer Mode
[d] 209: Fetch ProductData AIS
[d] 210: Fetch ManufacturerName AIS
[d] 211: Fetch ModelName AIS
[d] 212: Fetch ModelColorCode AIS
[d] 213: Fetch AccessoryCategory AIS
[d] 214: Fetch AccessoryCapabilities AIS
[d] 215: Fetch FirmwareVersion AIS
[d] 216: Fetch FindMyVersion AIS
[d] 217: Fetch BatteryTyp AIS
[d] 218: Fetch BatteryLevel AIS
[d] 219: Send UARP message to accessory
[d] 220: Stop Unauthorized Sound

Hawkeye opcode list: 
[h] 512: Sound Start
[h] 513: Sound Stop
[h] 514: Persistent Connection Status
[h] 515: Nearby Timeout
[h] 516: Unpair
[h] 517: Configure Separated State
[h] 518: Latch Separated Key
[h] 519: Set Max Connections
[h] 520: Set UTC
[h] 521: Get Multi Status
[h] 523: Command Response
[h] 524: Multi Status Response
[h] 525: Sound Complete
[h] 768: Non-Owner Sound Start
[h] 769: Non-Owner Sound Stop
[h] 770: Non-Owner Command Response
[h] 771: Non-Owner Sound Complete
[h] 1024: Get Current Primary Key
[h] 1025: Get iCloud Identifier
[h] 1026: Get Current Primary Key Response
[h] 1027: Get iCloud Identifier Response
[h] 1028: Get Serial Number
[h] 1029: Get Serial Number Response
[h] 1280: Key Rotation
[h] 1281: Retrieve Logs
[h] 1282: Log Response
[h] 1283: Debug Command Response
[h] 1284: Reset
[h] 1285: UT Motion Config

More Repositories

1

opendrop

An open Apple AirDrop implementation written in Python
Python
8,572
star
2

openhaystack

Build your own 'AirTags' 🏷 today! Framework for tracking personal Bluetooth devices via Apple's massive Find My network.
Swift
8,225
star
3

nexmon

The C-based Firmware Patching Framework for Broadcom/Cypress WiFi Chips that enables Monitor Mode, Frame Injection and much more
C
2,406
star
4

AirGuard

Protect yourself from being tracked 🌍 by AirTags 🏷 and Find My accessories 📍
Kotlin
1,904
star
5

owl

An open Apple Wireless Direct Link (AWDL) implementation written in C
C
1,217
star
6

openwifipass

An open source implementation of Apple's Wi-Fi Password Sharing protocol in Python.
Python
802
star
7

mobisys2018_nexmon_software_defined_radio

Proof of concept project for operating Broadcom Wi-Fi chips as arbitrary signal transmitters similar to software-defined radios (SDRs)
Shell
763
star
8

internalblue

Bluetooth experimentation framework for Broadcom and Cypress chips.
Python
684
star
9

frankenstein

Broadcom and Cypress firmware emulation for fuzzing and further full-stack debugging
C
430
star
10

nexmon_csi

Channel State Information Extraction on Various Broadcom Wi-Fi Chips
C
302
star
11

toothpicker

Python
234
star
12

privatedrop

Practical Privacy-Preserving Authentication for Apple AirDrop
Swift
217
star
13

polypyus

Python
215
star
14

BTLEmap

Nmap for Bluetooth Low Energy
Swift
159
star
15

bcm-rpi3

DEPRECATED: Monitor Mode and Firmware patching framework for the Raspberry Pi 3, development moved to: https://github.com/seemoo-lab/nexmon
C
157
star
16

wireshark-awdl

Wireshark Dissector for Apple Wireless Direct Link (AWDL) and Apple's CoreCapture logging framework. Note: the AWDL dissector is part of Wireshark 3.0!
134
star
17

VirtFuzz

VirtFuzz is a Linux Kernel Fuzzer that uses VirtIO to provide inputs into the kernels subsystem. It is built with LibAFL.
Rust
109
star
18

frida-scripts

JavaScript
101
star
19

mobisys2018_nexmon_channel_state_information_extractor

Example project for extracting channel state information of up to 80 MHz wide 802.11ac Wi-Fi transmissions using the BCM4339 Wi-Fi chip of Nexus 5 smartphones.
MATLAB
98
star
20

airdrop-keychain-extractor

Extracting Apple ID Validation Record, Certificate, and Key for AirDrop
Objective-C
96
star
21

bcm-public

DEPRECATED: Monitor Mode and Firmware patching framework for the Google Nexus 5, development moved to: https://github.com/seemoo-lab/nexmon
C
75
star
22

fitness-app

Java
70
star
23

apple-continuity-tools

Reverse engineering toolkit for Apple's wireless ecosystem
JavaScript
63
star
24

nexmon_debugger

Debugger with hardware breakpoints and memory watchpoints for BCM4339 Wi-Fi chips
C
54
star
25

satellite-messenger

A free satellite messenger for iPhone 14
Swift
50
star
26

wisec2017_nexmon_jammer

This project contains the nexmon-based source code required to repeat the experiments of our WiSec 2017 paper.
C
48
star
27

aristoteles

A Wireshark dissector for the Apple Remote Invocation (ARI) protocol, used between Intel base band chips and the iOS CommCenter for various management purposes, SMS, telephony and much more.
Lua
45
star
28

talon-tools

Talon Tools: The Framework for Practical IEEE 802.11ad Research
TeX
41
star
29

mmTrace

mmTrace: Millimeter Wave Propagation Simulation
MATLAB
40
star
30

fitness-firmware

HTML
40
star
31

AirGuard-iOS

Protect yourself from being tracked 📍by Samsung SmartTags and Tile Trackers
Swift
39
star
32

apple_u1

JavaScript
38
star
33

chirpotle

A LoRaWAN Security Evaluation Framework
Jupyter Notebook
35
star
34

dtrace-memaccess_cve-2020-27949

C++
35
star
35

proxawdl

Tunnels a regular TCP connection through an AWDL link by exploiting the NetService API
Objective-C
31
star
36

pyshimmer

pyshimmer provides a Python API to work with the wearable sensor devices produced by Shimmer.
Python
24
star
37

mobisys2018_nexmon_covert_channel

Wi-Fi based covert channel that hides information in hand crafted acknowledgement frames imitating additional channel effects that can be extracted from channel state information at the intended receiver.
C
23
star
38

uwb-sniffer

A UWB Sniffer with accurate timestamps
C
22
star
39

h4bcm_wireshark_dissector

Wireshark dissector for Broadcom specific H4 diagnostic commands
C
22
star
40

owlink.org

Opening up Apple's wireless ecosystem around the Apple Wireless Direct Link (AWDL) protocol
HTML
20
star
41

wisec2017_nexmon_jammer_demo_app

This project contains source code of our Nexmon-based jammer app presented as a demo at WiSec 2017.
Java
19
star
42

nexmon-arc

The nexmon C-based firmware patching framework adapted for the ARC architecture.
C
19
star
43

seemoo-mobile-sensing

Sensor data collector for Android devices
Java
19
star
44

plist17lib

Python
18
star
45

BTLEmap-Framework

BTLEmap's Bluetooth Low Energy framework that powers the app
Swift
17
star
46

csicloak

Python
15
star
47

seemoo-wearable-sensing

Sensor data collector for Samsung Gear S3
JavaScript
15
star
48

talon-sector-patterns

Antenna Sector Patterns as obtained by Measurements in the CoNEXT'17 paper
MATLAB
14
star
49

pairsonic

Helping groups securely exchange contact information.
Dart
13
star
50

fido2ext

Bring Your Own FIDO2 Extensions!
JavaScript
12
star
51

wifi-password-sharing

An open source implementation of Apple's Wi-Fi Password Sharing protocol in Swift.
Swift
12
star
52

privatefind

Lost and Found: Stopping Bluetooth Finders from Leaking Private Information
C
12
star
53

nexmon_tx_task

Scheduled frame transmission on Broadcom Wi-Fi Chips
C
11
star
54

pico-nexmon

Applications for the Raspberry Pi Pico W related to Nexmon the C-based firmware patching framework for Broadcom/Cypress WiFi chips.
CMake
11
star
55

wisec2017_nexmon_jammer_demo_firmware

This project contains the nexmon-based source code of the jammer used in our WiSec 2017 demo Android app.
C
10
star
56

bcm_misc

10
star
57

opennan

OpenNAN - An open source NAN stack for Linux
C
9
star
58

Hardwhere

snipeit-it based asset management app
Kotlin
8
star
59

ubicomp19_zero_interaction_security

Source code for experiments and evaluation of five zero-interaction security schemes, for our Ubicomp 2019 paper "Perils of Zero-Interaction Security in the Internet of Things"
Jupyter Notebook
8
star
60

offline-finding-evaluation

Quantitative analysis of location reports from Apple's offline finding (OF) location tracking system
Jupyter Notebook
7
star
61

myo-keylogging

Code for "My(o) Armband Leaks Passwords: An EMG and IMU Based Keylogging Side-Channel Attack" paper
Python
7
star
62

natural-disaster-mobility

Natural Disaster Mobility Model and Scenarios in the ONE
Java
6
star
63

wisec2017_nexmon_jammer_reproducibility

This project contains all measured data and scripts to recreate the plots used in our WiSec 2017 paper.
MATLAB
6
star
64

nexmon_energy_measurement

This repository contains patched Linux kernel sources to run energy measurements on the Wi-Fi chip of a Nexus 5 smartphone.
C
6
star
65

next2you

Source code for experiments and evaluation of Next2You copresence detection scheme, for our TIOT 2021 paper "Next2You: Robust Copresence Detection Based on Channel State Information".
C
6
star
66

d11-emu

D11emu: A BCM43 D11 Emulation Framework
Rust
6
star
67

aic-prototype

Proof of concept implementation of Acoustic Integrity Codes (AICs) for Android smartphones
Kotlin
6
star
68

CellGuard

CellGuard is a research project that analyzes how cellular networks are operated and possibly surveilled
5
star
69

powerpc-ose

C++
5
star
70

PrivateDrop-Base

The framework that powers PrivateDrop
C
4
star
71

fastzip

Source code for experiments and evaluation of FastZIP zero-interaction pairing scheme, for our Mobisys 2021 paper "FastZIP: Faster and More Secure Zero-Interaction Pairing".
Python
4
star
72

graphics

3
star
73

tpy

A Lightweight Framework for Agile Distributed Network Experiments
Python
3
star
74

wintech23_nexmon_d11debug

Pawn
3
star
75

woot24_cfi_coverage_tools

The artifacts for the 'On the Effectiveness of CFI in Practice' paper to be published at WOOT'24.
Python
2
star
76

click-castor

Click implementation of LIDOR/SEMUD (based on the Castor routing protocol)
C++
2
star
77

privatedrop-evaluation

Jupyter Notebook
2
star
78

wisec23-speaker-bootstrapping

Software repository for our WiSec '23 demo: Secure Bootstrapping of Smart Speakers Using Acoustic Communication
C
2
star
79

caret

CARET: The Crisis and Resilience Evaluation Tool
Python
2
star
80

hardzipa

Source code for experiments and evaluation of HardZiPA system for our EWSN 2023 paper "Hardening and Speeding UpZero-interaction Pairing and Authentication".
Python
2
star
81

kardia-demod

Python
1
star
82

talon-library-measurements

Large-Scale Talon Measurements at Library
1
star
83

handoff-authentication-swift

C++
1
star
84

wintech2017_nexmon_ping_offloading

This project contains the nexmon-based source code of the ping offloading application used in our WiNTECH 2017 paper.
C
1
star
85

python-msp430-tools

This is a fork of the original python-msp430-tools repository on Launchpad. It features a patchset that is required to use the tools with the Shimmer3 devices.
Python
1
star
86

Please-Unstalk-Me

User Data and Online Survey results
Jupyter Notebook
1
star