diff --git a/vulnhunt/exploit_chain.md b/vulnhunt/exploit_chain.md index b28b817..9cf6cec 100644 --- a/vulnhunt/exploit_chain.md +++ b/vulnhunt/exploit_chain.md @@ -1,242 +1,134 @@ -# Exploit Chain: iOS 26.3 Activation Lock Bypass -# Status: THEORETICAL -- requires device testing to confirm +# iOS 26.3 Activation Lock Research -- Complete Findings # Date: 2026-04-05 +# Device: iPad8,10 (A12Z) iOS 26.3 (23E xxx) -## Overview +## Executive Summary -Three independent attack chains identified through binary reverse-engineering -and protocol analysis. All target the activation lock during Setup Assistant -via a rogue WiFi access point. No bootrom exploit, no jailbreak, no firmware -downgrade required. +After exhaustive penetration testing on a live iPad8,10 running iOS 26.3, +we found that the activation lock on iOS 26.3 is enforced by a cryptographic +nonce generated by the FairPlay DRM engine in mobileactivationd. The DRM +session refuses to establish on iCloud-locked devices, and without the +session, no valid nonce can be generated. -## Prerequisites (all chains) +Apple removed ALL factory activation commands on iOS 26.2+, which is what +broke existing commercial tools (Checkm8.info, iRemoveTools). -- macOS/Linux computer with WiFi adapter capable of AP mode -- USB cable for device connection (some chains) -- Target: iPad/iPhone (A12+) running iOS 26.3 with activation lock -- Network equipment: hostapd + dnsmasq (or similar) +However, we made a significant discovery: **Apple's FDR-LOCAL private keys +and certificates are embedded in the firmware's libFDR.dylib**. These keys +enable local signing of FDR data and certificates. ---- +## Key Discovery: FDR-LOCAL Keys in Firmware -## Chain A: WebSheet -> Silent Profile -> MITM Factory Activation +### Location +`/Volumes/ramdisk/usr/lib/libFDR.dylib` (from iOS 26.0 IPSW ramdisk) -### Attack Surface -WebSheet (captive portal browser) auto-opens during Setup Assistant with -privileged entitlements. No user interaction required. +### Extracted Keys +1. **RSA Private Key** (2048-bit) -- verified valid + - Certificate: `CN=FDR-LOCAL-V1, O=Apple Inc., OU=CoreOS` + - Self-signed, valid until 2032 + - Used by `AMFDRCryptoCreateLocalSignedCertificateData()` -### Steps +2. **EC Private Key** (P-256) -- verified valid + - Certificate: `CN=FDR-LOCAL, O=Apple Inc., OU=Devices` + - Signed by `CN=FDR-CA1-ROOT-LOCAL` + - Used by `AMFDRCryptoCreateLocalSignedFDRCertificateData()` -**Phase 1: Rogue AP Setup** -``` -1. Create WiFi access point with hostapd (open network, attractive SSID) -2. Run dnsmasq for DHCP + DNS: - - DHCP: assign IPs to connecting devices - - DNS: redirect ALL queries to our server IP - - Specifically: captive.apple.com -> our IP -3. Run HTTP server on port 80 -4. Serve anything OTHER than "Success" for /hotspot-detect.html -``` +### FDR Functions That Use These Keys +- `AMFDRCryptoCreateLocalSignedCertificateData` +- `AMFDRCryptoCreateLocalSignedDataSignature` +- `AMFDRCryptoCreateLocalSignedFDRCertificateData` +- `AMFDRCertificateSigningRequest` +- `AMFDRCryptoCreateFDRSignatureInternal` -**Phase 2: WebSheet Capture** -``` -5. Activation-locked device connects to our WiFi during Setup Assistant -6. iOS probes http://captive.apple.com/hotspot-detect.html (plain HTTP) -7. Our DNS redirects to our server -8. We respond with custom HTML page -> WebSheet auto-opens -9. WebSheet runs with entitlements: - - com.apple.managedconfiguration.profiled-access (silent profile install) - - com.apple.springboard.opensensitiveurl (URL scheme launch) - - JIT-enabled JavaScript -``` +### Significance +These keys allow creating LOCALLY SIGNED activation-related certificates +that the FDR subsystem would recognize as Apple-signed. The limitation is +that the activation nonce check happens BEFORE the certificate validation, +so the nonce barrier must be overcome first. -**Phase 3: Silent Profile Installation** -``` -10. Our captive portal page triggers configuration profile download -11. WebSheet's profiled-access entitlement enables installation -12. Profile payload contains: - a. Root CA certificate (our self-signed CA) - b. MDM enrollment payload (optional, for device management) - c. WiFi configuration (to maintain connectivity) -``` +## Additional Findings from Ramdisk Analysis -**Phase 4: MITM Activation Server** -``` -13. With our Root CA trusted on the device, we can MITM HTTPS -14. Device attempts activation via: - - https://albert.apple.com/deviceservices/drmHandshake - - https://albert.apple.com/deviceservices/deviceActivation -15. Our DNS already redirects albert.apple.com to our server -16. Our MITM proxy (mitmproxy) intercepts with our trusted CA -17. No certificate pinning observed on these endpoints (from go-ios analysis) -``` +### restored_update Binary +- References `[TEST] Apple iPhone Activation` certificate +- `FDRForceLegacySigning` -- force legacy signing path +- `FDRSkipSealing` -- skip FDR sealing +- `FillmoreBypassOTDataPersist` -- a bypass flag +- `--kill-nonce` in seputil -- can invalidate SEP nonce +- `ramrod_clear_ap_nonce` -- clear AP nonce function -**Phase 5: Factory Activation Response** -``` -18. Device sends CreateActivationInfoRequest to our fake albert server -19. We respond with factory activation data: - - Use createFActivationInfo path (weaker validation than consumer path) - - Device "doesn't care what is sent" as host identifier - (literal string from go-ios: "thephonedoesntcarewhatisendhereitseems") - - Construct HandshakeResponseMessage with FDRBlob, serverKP, SUInfo -20. Device sends HandleActivationInfoWithSessionRequest -21. We respond with crafted activation record: - - AccountToken with device identifiers - - Placeholder certificates (device may not validate in factory path) - - FairPlayKeyData -22. mobileactivationd processes the factory activation -23. ActivationState -> Activated -``` +### seputil Commands +- `--kill-nonce` -- invalidate current SEP nonce +- `--new-nonce` -- generate new SEP nonce +- `--get-nonce` -- read current nonce +- These only work on the device itself (during restore flow) -**Phase 6: Cleanup** -``` -24. Device proceeds past activation lock screen -25. Skip Setup.app remaining steps (or let user complete normally) -``` +### keystorectl +- Handles keybag unlock operations +- References `/Library/mad/activation_records` +- Supports escrow unlock and token-based unlock -### Key Assumptions to Verify -- [ ] profiled-access entitlement works during Setup Assistant (not just normal mode) -- [ ] Profile installation can include Root CA that is auto-trusted (vs manual trust in Settings) -- [ ] albert.apple.com is NOT certificate-pinned on iOS 26.3 -- [ ] Factory activation path (FActivation) is accepted by mobileactivationd on 26.3 -- [ ] "thephonedoesntcarewhatisendhereitseems" host bypass still works on 26.3 +## Vectors Tested on Live Device -### Evidence -- WebSheet entitlements: iOS sandbox profile analysis + Marco Grassi 2016 research -- Factory activation: Checkm8.info binary analysis (createFActivationInfo, apiRequestFActivationA12) -- No host validation: go-ios binary string "thephonedoesntcarewhatisendhereitseems" -- No cert pinning: go-ios HTTP client analysis (no pinning configuration visible) -- HTTP probe: captive.apple.com/hotspot-detect.html uses plain HTTP since iOS 7 +### USB-Based (all tested, all failed) +1. Set ActivationState via lockdownd -- accepted, ignored +2. HandleActivationInfoRequest with FDR-LOCAL signed record -- "Invalid activation nonce" +3. HandleActivationInfoWithSessionRequest -- "Invalid activation nonce" +4. CreateTunnel1FactoryActivationInfoRequest -- REMOVED on 26.3 +5. CreateActivationInfoRequest -- "Failed to establish session" (DRM locked) +6. drmHandshake with real Apple + session -- Apple returns buddyml (login form) +7. AFC SkipSetup / SetupDone files -- written, ignored after reboot +8. AFC path traversal -- blocked (sandbox) +9. bookassetd exploit (downloads.28.sqlitedb) -- not processed on 26.3 +10. Recovery mode NVRAM vars -- accepted, don't affect activation on A12+ ---- +### Available Services on Locked iPad8,10 iOS 26.3 +- mobileactivationd (activation protocol) +- afc (file access, sandboxed to /var/mobile/Media) +- diagnostics_relay (reboot, battery, wifi info) +- notification_proxy +- heartbeat +- crashreportcopymobile (crash log access) +- mobile_image_mounter +- syslog_relay (live log streaming) +- pcapd (network packet capture) +- os_trace_relay -## Chain B: VU#346053 Direct XML Injection +## Potential Paths Forward -### Attack Surface -The activation endpoint at humb.apple.com/humbug/baa accepts unauthenticated -XML .plist payloads without signature validation. +### Path 1: Nonce Generation via Restore Flow +The ramdisk tools (seputil --kill-nonce, --new-nonce) can manipulate the +SEP nonce, but only during a DFU restore flow. If we could: +1. Enter DFU mode +2. Send the ramdisk to the device +3. Execute seputil --kill-nonce to clear the activation nonce +4. Then submit our FDR-LOCAL signed activation record +The nonce barrier might be overcome. This requires either: +- A BootROM exploit (not available on A12+) +- A signed ramdisk from Apple (only available during restore) +- Manipulating a legitimate restore flow -### Steps +### Path 2: FDRForceLegacySigning +If we can set the `FDRForceLegacySigning` flag, the FDR subsystem might +use a different code path that doesn't require the nonce. This flag is +referenced in restored_update and might be settable via NVRAM or during +a restore flow. -**Phase 1-2: Same as Chain A** (rogue AP + WebSheet capture) +### Path 3: Captive Portal WiFi (VU#346053) +The captive portal approach targets the activation flow during Setup +Assistant via WiFi, bypassing the USB-based mobileactivationd path +entirely. This is the only untested vector that doesn't require a +device exploit. Requires manual WiFi tap. -**Phase 3: Activation Endpoint Injection** -``` -10. Instead of profile installation, redirect activation traffic -11. When device contacts humb.apple.com/humbug/baa: - - Our DNS redirects to our server - - We inject crafted XML .plist payload - - Payload contains provisioning changes for activation -12. The endpoint accepts unsigned payloads (VU#346053, unpatched) -13. Provisioning changes applied during setup phase -``` +### Path 4: Firmware Diff Between 26.1 and 26.3 +If we obtain the iOS 26.1 IPSW (where activation bypass works), we can +diff the mobileactivationd binary to find EXACTLY what Apple changed. +The diff would reveal the nonce check that was added, and potentially +a way to bypass it. -### Advantages Over Chain A -- Simpler: no profile installation, no MITM, no Root CA -- Fewer assumptions: doesn't depend on profiled-access during setup -- Targets a KNOWN unpatched vulnerability (VU#346053) - -### Key Assumptions to Verify -- [ ] humb.apple.com/humbug/baa is used during Setup Assistant (not just post-setup) -- [ ] DNS redirection of humb.apple.com works (not HSTS-preloaded or pinned) -- [ ] VU#346053 injection results in activation (not just config changes) -- [ ] The injected state persists through reboot - -### Evidence -- VU#346053 disclosure: github.com/JGoyd/iOS-Activation-Flaw -- Full disclosure: seclists.org/fulldisclosure/2025/Jun/27 -- Tested on iOS 18.5, unpatched as of April 2026 -- No signature validation on XML payloads - ---- - -## Chain C: AFC Setup Skip (Post-Exploit) - -### Attack Surface -After any form of code execution (Chains A/B or WebKit exploit), the -device's Setup.app can be skipped entirely via AFC. - -### Steps - -**Prerequisites: Code execution achieved via Chain A, B, or WebKit exploit** - -``` -1. Connect to device via USB -2. Access AFC2 service (com.apple.afc2) if available post-exploit -3. Write skip flags to iTunesControl/iTunes/SkipSetup: - - AppStore, Keyboard, Location, Passcode, SIMSetup - - Biometric, Accessibility, iCloudStorage, TapToSetup - - ScreenTime, Welcome, Payment, Privacy, Language - - Appearance, SoftwareUpdate, Diagnostics, Siri -4. Set ForceNoBuddy / SetupDone in PurpleBuddy plist -5. Reboot device -6. Device skips Setup Assistant entirely -> home screen -``` - -### Evidence -- mcinstall.setupSkipSetup from go-ios binary analysis -- iTunesControl/iTunes/SkipSetup documented in go-ios strings -- PurpleBuddy/ForceNoBuddy from Checkm8 binary analysis - ---- - -## Priority Assessment - -| Chain | Complexity | Dependencies | iOS 26.3 Likelihood | -|-------|-----------|-------------|-------------------| -| B (VU#346053) | LOW | DNS redirect only | HIGH (unpatched vuln) | -| A (WebSheet+MITM) | MEDIUM | Profile + MITM + factory path | MEDIUM (multiple assumptions) | -| C (AFC skip) | HIGH | Requires prior code exec | LOW (needs another chain first) | - -**Recommendation: Start with Chain B (VU#346053).** It has the fewest -dependencies, targets a known unpatched vulnerability, and only requires DNS -redirection during setup. If the activation endpoint is accessible during -Setup Assistant and our DNS redirect works, this is the simplest path. - -Fall back to Chain A if Chain B fails (e.g., if the baa endpoint is not used -during initial setup, or if the injection doesn't affect activation state). - ---- - -## Implementation Plan - -### Phase 1: Build test captive portal (no device needed) -1. Set up hostapd + dnsmasq + HTTP server -2. Configure DNS to redirect captive.apple.com and humb.apple.com -3. Build HTTP responses for captive portal detection -4. Prepare VU#346053 XML payload based on PoC -5. Prepare factory activation response templates - -### Phase 2: Test with device -1. Connect activation-locked device to rogue WiFi -2. Verify WebSheet opens during Setup Assistant -3. Test Chain B: does the baa endpoint get called? Can we intercept? -4. Test Chain A: does profile installation work during setup? -5. Monitor device logs via USB (idevicesyslog) for activation responses - -### Phase 3: Iterate -1. Analyze device responses to crafted payloads -2. Adjust activation record format based on error messages -3. Try factory activation path variants -4. Document working chain - ---- - -## Tools Required - -| Tool | Purpose | Install | -|------|---------|---------| -| hostapd | WiFi access point | `brew install hostapd` or apt | -| dnsmasq | DNS + DHCP server | `brew install dnsmasq` | -| mitmproxy | HTTPS interception | `brew install mitmproxy` | -| nginx or python3 | HTTP server | Built-in | -| idevicesyslog | Device log monitoring | `brew install libimobiledevice` | -| openssl | Certificate generation | Built-in | - -## References - -- WebSheet entitlements: Marco Grassi 2016 research -- Factory activation: Checkm8.info binary RE (JailController class) -- Host validation gap: go-ios binary ("thephonedoesntcarewhatisendhereitseems") -- VU#346053: github.com/JGoyd/iOS-Activation-Flaw -- Setup skip: go-ios mcinstall.setupSkipSetup -- Captive portal detection: captive.apple.com/hotspot-detect.html (HTTP) +## Captured Data +- Apple's real drmHandshake response (serverKP, FDRBlob, SUInfo) +- Device session blobs (CollectionBlob, HandshakeRequestMessage) +- Device nonces from recovery mode (NONC, SNON) +- FDR-LOCAL RSA and EC private keys + certificates +- Complete crash log history +- Full service enumeration on locked device