Commit graph

93 commits

Author SHA1 Message Date
debian
7d65a2d2b9 fix(checkm8): run the DFU manifest cycle in stage 1
Stage 1 only did GETSTATUS + reset-to-idle, which on a fresh dfuIDLE entry is a no-op. The reference drives the state machine through DNLOAD(16), DNLOAD(0) and the MANIFEST_SYNC -> MANIFEST -> MANIFEST_WAIT_RESET transition, then DNLOAD(64).

Without the cycle the device can leave dfuIDLE on its own and the final control transfer returns NO_DEVICE. This keeps the existing stage order and adds no bus reset; it only makes the reset stage actually reach a known state.
2026-11-29 09:28:10 -03:00
debian
1896733217 chore(exploit): trace every control transfer with monotonic timing
The only trace of a failed sequence was the stage-4 error line. LIBUSB_ERROR_NO_DEVICE is ambiguous: it is the same code whether the device left the bus mid-transfer or between stages, and that distinction decides which stage to look at.

Log request, result and elapsed microseconds for every control transfer, plus whether the async setup transfer completed or was cancelled. Everything is log_debug, so the default output does not change.
2026-11-29 09:18:58 -03:00
debian
34fd49dcbb fix(checkm8): only pause after the spray on usbipd-win
Stage 3 ended with an unconditional 1 s sleep before stage 4. The delay was added for usbipd-win, where the vhci layer frees the spray buffers late, but on a native host the reference implementation goes straight from the spray to the overwrite.

An idle second between the last confirmed STALL and the overwrite is a window in which the device can leave dfuIDLE on its own. When it does, the next control transfer returns LIBUSB_ERROR_NO_DEVICE (-4) and the sequence fails at stage 4 with no other trace. Keep the pause only where it is needed.
2026-11-29 09:18:00 -03:00
Moussa Ouallaf
c11210d73f docs: add a centred X profile badge to the README
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G7BBLpEnZmor9fVAKqMi2d
2026-10-25 13:25:49 +00:00
Moussa Ouallaf
67cf5a4654
Merge pull request #136 from tr4m0ryp/fix/double-free-devlist
fix: remove double-free of libusb device list in EBUSY path
2026-09-19 10:28:02 +00:00
Moussa Ouallaf
208ecfec9e fix: remove double-free of libusb device list in EBUSY path
The device list 'devs' is already freed at line 165 after the for-loop.
The second free inside the LIBUSB_ERROR_BUSY block corrupts the heap,
especially on WSL where a stale claimed interface from a previous run
triggers this path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-09-19 12:27:46 +02:00
Moussa Ouallaf
55769a8d1c
Sync worktree fixes into main (Kali + checkm8 pipeline)
Sync worktree fixes into main (Kali + checkm8 pipeline)
2026-09-19 10:03:25 +00:00
Apocrypha12
e494b484ca test: update reconnect delay expectation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-08-01 17:11:03 -08:00
Apocrypha12
c4d2b5d9d1 Sync worktree updates into main repo folder 2026-08-01 17:06:56 -08:00
Moussa Ouallaf
bc1a502c1d merge(group2): agent 003-dfu-serial-parsing - runtime iSerial index + manual override consultation 2026-07-17 03:05:06 +02:00
Moussa Ouallaf
03d352d7f5 fix(dfu): read iSerial index at runtime; honor --cpid/--ecid overrides
Retire the three hardcoded DFU_SERIAL_INDEX = 3 constants in
usb_dfu.c, path_b_identity.c, and checkm8_internal.h. usb_dfu_find()
now captures bDeviceDescriptor.iSerialNumber into device_info_t and
usb_dfu_read_info() iterates hint -> 3 -> 4 with the sentinel check
deferred until every probe has returned only the product string. The
checkm8 spray helpers accept the resolved index as a parameter, and
the CLI override log fires whenever --cpid/--ecid populated a field
the descriptor read could not, so A14/A15/A16 devices no longer
strand users on the false NOT-in-SecureROM-DFU diagnostic.

Files modified:
- include/device/device.h
- include/device/usb_dfu.h
- include/exploit/checkm8_internal.h
- src/bypass/path_b_identity.c
- src/device/usb_dfu.c
- src/exploit/checkm8.c
- src/exploit/checkm8_spray.c
- src/main.c
- tests/mocks/mock_hw_stubs.c

Closes: #45, #65, #59, #27, #17, #52, #30, #22, #25, #10, #8, #6, #7
2026-07-17 03:04:22 +02:00
Moussa Ouallaf
443a18f9ad merge: bring in remote README updates (release timeline notes) 2026-07-17 02:50:13 +02:00
Moussa Ouallaf
2f1cf6cfc5 fix(gitignore): resolve merge conflict 2026-07-17 02:47:39 +02:00
Moussa Ouallaf
d50e730a20 fix: resolve merge conflict 2026-07-17 02:47:20 +02:00
Moussa Ouallaf
c8245efd49 build: add .build-flags to phony targets 2026-07-17 02:47:04 +02:00
Moussa Ouallaf
49b48b06c8 fix(build): consolidate clean target artifacts 2026-07-17 02:46:40 +02:00
Moussa Ouallaf
e7e22fc0cc fix(chip-db): correct device labels and add integrity canary 2026-07-17 02:45:59 +02:00
Moussa Ouallaf
cd84c5553f merge(group1): agent 001-buildability - build-deps + libusb + libplist/libirecovery drift 2026-07-17 02:45:33 +02:00
Moussa Ouallaf
9bd1a75b2d build(deps): fix pkg-config skew, libusb include, libplist/libirecovery drift
Sync PKGCONFIG_DEPS with Makefile (add libcurl); normalize
<libusb.h> include across 6 files; add compat shims for libplist
2.2/2.3 and libirecovery IRECV_SEND_OPT_DFU_NOTIFY_FINISH; add
pacman/zypper/apk installer branches; drop bogus info->pid read
in path_b_identity.c in favor of irecv_get_mode(). Extend the
mock libirecovery to expose irecv_get_mode() so the mock test
build keeps passing against the new call site. Add Makefile
compile canaries that emit -DTP_PLIST_HAS_MEM_FREE,
-DTP_PLIST_HAS_FMT_ARG, and -DTP_IRECV_HAS_NOTIFY_FINISH plus a
.build-flags diagnostic file consumed by tr4mpass doctor.

Files modified:
- Makefile
- start.sh
- start-helpers.sh
- include/compat/plist_compat.h (new)
- include/compat/libirecovery_compat.h (new)
- include/util/usb_helpers.h
- include/util/plist_helpers.h
- include/exploit/dfu_proto.h
- include/device/device.h
- include/device/usb_dfu.h
- include/activation/activation.h
- include/activation/record.h
- src/bypass/path_b_identity.c
- src/bypass/path_b.c
- src/bypass/path_a_ramdisk.c
- src/activation/session_online.c
- tests/mocks/mock_irecv_sym.c
- .gitignore

Closes: #70, #74, #67, #54, #51, #44, #21, #55, #31, #24, #19
2026-07-17 02:43:53 +02:00
Moussa Ouallaf
54c0ad652c fix(chip-db): rebuild chip_db_table*.h from gaster canonical + strict canary
Rewrite the .name / .marketing fields and banner comments in
include/device/chip_db_table.h and chip_db_table_rop.h from gaster's
canonical SecureROM SRTG -> offset table (gaster.c:519-808), so the
CLI announces the physical chip that is actually plugged in. Each
row carries a "gaster.c:NNN" comment marker traceable to the source
of truth. Offsets, CPIDs and struct layout are unchanged.

Relabels: 0x8947 (was "A7 / iPhone 5s", now S5L8947 = A5 Rev B /
Apple TV 3rd gen rev A); 0x8950 / 0x8955 (were "A5-class Apple TV",
now A6 / A6X); 0x8960 (was "A10 / iPhone 7", now A7 / iPhone 5s);
0x8002 (was "S3 / Watch Series 3", now S1P/S2/T1 covering Watch
Series 1/2 and MacBook Pro Touch Bar T1); 0x8004 GPS+Cellular
qualifier dropped; 0x8000 / 0x8003 A9 Samsung/TSMC labels swapped
to match APL0898 / APL1022; 0x8010 / 0x8011 marketing broadened to
cover the full ship list.

Add tests/chip_db_canary.c, wired as a build-time prerequisite of
tr4mpass via the new Makefile .chip-db-canary target. The probe
walks a golden expected (cpid, name-substr, marketing-substr,
checkm8) table and fails the build on drift, defeating a repeat of
issue #53. STRICT_CHIP_DB=1 by default; make STRICT_CHIP_DB=0
bypasses the probe for distro-package chip-table update races
(T5 "Chip-DB canary strictness" note).

Files modified:
- include/device/chip_db_table.h
- include/device/chip_db_table_rop.h
- Makefile
- .gitignore
- tests/chip_db_canary.c (new)

Closes: #53
2026-07-17 02:30:38 +02:00
Moussa Ouallaf
d18b57a66f chore: ignore local workspace directories 2026-07-17 01:56:26 +02:00
Moussa Ouallaf
ac538d31eb docs(hw-usability): populate technical design from workflow synthesis 2026-07-17 01:29:17 +02:00
Moussa Ouallaf
519ad05d7b docs(hw-usability): add technical design for tr4mpass issue sweep 2026-07-16 23:51:54 +02:00
Moussa Ouallaf
c691f74c60 docs(hw-usability): document key concept decisions for research strategy 2026-07-16 23:48:26 +02:00
Moussa Ouallaf
5838fee76c docs(hw-usability): specify in-scope and out-of-scope work 2026-07-16 23:47:34 +02:00
Moussa Ouallaf
39cf64132d chore(research): remove hw-usability design template 2026-07-16 23:40:47 +02:00
Moussa Ouallaf
2782133ee7 docs(hw-usability): add technical design template 2026-07-16 23:26:07 +02:00
Moussa Ouallaf
a5c456b826 docs(hw-usability): add vision notes and issue clustering 2026-07-16 23:17:08 +02:00
Moussa Ouallaf
7c4776ace5
Update release timeline in README 2026-07-02 00:46:57 +02:00
Moussa Ouallaf
76fd7565ca
Fix formatting of README section header 2026-06-24 23:32:35 +02:00
Moussa Ouallaf
a245342994
Update README with new version release note format 2026-06-24 23:32:16 +02:00
Moussa Ouallaf
f6a7715c2a
Update README with note on new version release
Added a note about the upcoming improved version release.
2026-06-24 23:31:54 +02:00
tr4m0ryp
30807c8ef6 feat: real Path A implementation, cert extraction, mock test harness
Converts the Path A pipeline from stubs to a working implementation for
A5-A11 devices, adds real certificate extraction via lockdownd and ECDSA
P-256 signing, and introduces a comprehensive mock-based test suite.

Activation
- cert_extract: lockdownd-backed DeviceCertificate,
  AccountTokenCertificate, UniqueDeviceCertificate with base64 decode
  and CertificateChain array fallback.
- signer: OpenSSL EVP ECDSA P-256 sign/verify with DER-encoded
  signatures plus a test keypair generator.
- record.c: 3 of 6 cert fields now populate from live device data.
  AccountTokenSignature signs when TR4MPASS_SIGNING_KEY is set.
  FairPlayKeyData, RKCData, SepNonce remain documented stubs
  (SEP-blocked per 26.3-vulnerability.md).

Path A bypass
- path_a_ramdisk: iBSS/iBEC/devicetree/trustcache/ramdisk upload via
  libirecovery, reconnect handling between DFU and recovery stages,
  iBoot go/bootx commands, SSH readiness poll.
- path_a_ssh: libssh2 + SCP. Mounts rootfs rw (apfs then hfs), runs
  AMFI patcher, backs up and replaces /usr/libexec/mobileactivationd
  with a user-supplied patched binary, verifies mode.

Build, CLI, config
- Makefile: add libssh2 dependency, split test targets into
  hw-independent (make test) and full mock (make test-mocks).
- env_config + cli_flags: 12 new --flags for ramdisk, SSH, signing
  paths; flags map to TR4MPASS_* env vars. --verbose prints summary.
- start.sh slimmed; helpers extracted to start-helpers.sh.

Test suite (20 to 248 tests)
- Mock framework under tests/mocks/ intercepts libimobiledevice,
  libirecovery, libusb, libssh2, libcurl, plus mobileactivation and
  afc. Staging API in mock_control.h.
- Unit tests per module: cert_extract, signer, ramdisk, SSH jailbreak,
  env_config.
- Integration tests in tests/integration/: 6 Path A E2E scenarios
  (happy path, exploit fail, reconnect timeout, SSH auth fail, SCP
  fail, missing env) and 3 Path B scenarios (identity manipulation
  works, nonce barrier rejection is handled cleanly, signal
  detection). Path B tests verify the tool reports the SEP barrier
  failure rather than misclaiming success.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-18 17:43:30 +02:00
tr4m0ryp
5b758931ac fix: USB re-enum on retry, Path B iRecovery rewrite, DFU diagnostic, tests
Path A (checkm8):
- Re-enumerate USB handle between exploit retries; prior code reused the
  stale handle after the device reset on a failed attempt, causing
  LIBUSB_ERROR_NO_DEVICE on attempts 2 and 3
- Add USB_RECONNECT_DELAY_USEC (2 s) constant; allocate exploit_ctx_t
  fresh per attempt so cleanup is symmetric with init

Path B (A12+ bypass):
- Replace broken SET_DESCRIPTOR serial write with libirecovery setenv;
  Apple A12+ BootROM always STALLs SET_DESCRIPTOR (LIBUSB_ERROR_PIPE)
- Add step_reboot_to_recovery(): DFU_ABORT -> poll for PID 0x1281
- Add step_reboot_to_normal(): irecv reboot -> poll idevice_get_device_list
- step_session_handshake() now runs after normal-mode reconnect so
  dev->handle is valid; previously called with NULL handle (DFU mode)
- Expand path_b_execute() from 9 to 10 steps

Device / DFU:
- usb_dfu_read_info(): emit specific diagnostic when serial is the bare
  Apple DFU string (CPID=0); includes per-model button-sequence guidance

start.sh:
- DFU branch: derive support status from binary output instead of
  hardcoding SUPPORTED; gate_support() now reachable from DFU path
- parse_device_info(): guard against empty output (binary crash / no
  lockdownd); print actionable advice, set DEV_STATUS=UNSUPPORTED
- WSL: detect missing usbipd and print passthrough guidance after first
  poll timeout
- Arch Linux: replace exit-1 with AUR install instructions

Tests / build:
- Add tests/test_sections.c: DFU serial parsing, chip DB lookup,
  bypass probe logic, retry/reconnect constants (26 tests, no hardware)
- Add `make test` target; test build excludes USB/lockdown modules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 16:24:49 +02:00
tr4m0ryp
ee4e7c56fd chore: remove research workspace from public tool repo
Moves the iOS 26.3+ research materials (captive_portal/, vulnhunt/,
plus untracked submission/, bounty/, notes/, tasks/, .irecovery) out
of the public tr4mpass tool repository into a separate private
research workspace.

This repo now contains only what is needed to build and run the
public tr4mpass tool: src/, include/, Makefile, start.sh, README.md,
26.3-vulnerability.md.

Updates .gitignore to drop the obsolete entries for the moved
directories and add tr4mpass + .irecovery.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 18:57:36 +02:00
tr4m0ryp
f1ca73b9b9 fix: rename afc_strerror to afc_err_str for portability
afc_strerror() conflicts with libimobiledevice >= 1.4.0 which exports
that symbol as a public API. Renamed local helper to afc_err_str() to
avoid the static-vs-extern declaration conflict on newer versions while
still providing the function for older versions that lack it.

Files modified:
- src/bypass/afc_utils.c

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:13:11 +02:00
tr4m0ryp
8a79d8e61c feat(#6): add --cpid and --ecid CLI override flags
Resolves #6: set values for cpid ecid manually

When DFU mode fails to extract CPID/ECID from the USB serial string,
users can now pass --cpid 0xNNNN and --ecid 0xNNNN to set them manually.
Overrides only apply when the detected value is 0 (missing).

Files modified:
- src/main.c

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:10:42 +02:00
tr4m0ryp
904ac4523c fix(#2): validate binary before exec in start.sh
Resolves #2: start.sh fails with "Is a directory" error

Added pre-exec validation to check the binary exists, is a regular file,
and is executable. Improved build failure handling so the script stops
with a clear message instead of trying to exec a missing/invalid binary.

Files modified:
- start.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:10:35 +02:00
tr4m0ryp
58f04f2be0 fix(#5): add USB retry logic for LIBUSB_ERROR_PIPE
Resolves #5: LIBUSB_ERROR_PIPE

Root cause: USB control transfers had zero retry logic. LIBUSB_ERROR_PIPE
(-9) is a transient STALL that commonly occurs on A12+ devices during DFU
operations and typically clears on retry. Additionally, path_b_identity.c
called libusb_control_transfer directly, bypassing the usb_helpers wrapper
entirely.

Changes:
- usb_ctrl_transfer/usb_ctrl_transfer_no_data now retry up to 3 times on
  PIPE and TIMEOUT errors with 50ms delay between attempts
- usb_print_error provides actionable troubleshooting steps for PIPE errors
- path_b_identity.c now uses usb_ctrl_transfer (retry-aware) instead of
  calling libusb_control_transfer directly
- usb_dfu_read_info adds retry logic for serial descriptor reads
- start.sh: handle_dfu_requirement now guides A12+ Path B devices into DFU
  (previously only guided checkm8 Path A devices)
- start.sh: DFU-mode detection now queries CPID to correctly identify
  Path A vs Path B (previously assumed all DFU devices were Path A)

Files modified:
- src/util/usb_helpers.c
- src/bypass/path_b_identity.c
- src/device/usb_dfu.c
- start.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:04:19 +02:00
tr4m0ryp
92e9f99f25 fix(#3): improve bypass module selection diagnostics
Resolves #3: [ERROR] No compatible bypass module for this device

Two bugs caused iPhone 15 (A12+, Path B) to get a generic "No compatible
bypass module" error despite being fully supported:

Bug A: select_module() in main.c printed a single unhelpful error line
when bypass_select() returned NULL, with no indication of WHY the device
was rejected. Added print_module_diagnostics() that reports DFU mode
status, CPID, chip name, checkm8 status, product type, and a specific
explanation (not in DFU, CPID unread, chip not in DB).

Bug B: handle_dfu_requirement() in start.sh only guided checkm8 (Path A)
devices into DFU mode. A12+ Path B devices were never prompted for DFU
entry, so the binary was launched with is_dfu_mode=0 and both path probes
rejected the device. Refactored to a shared wait_for_dfu_entry() helper
that is called for ALL supported devices not already in DFU mode.

Files modified:
- src/main.c
- start.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:03:07 +02:00
tr4m0ryp
7225d83717 fix(#1): correct libirecovery apt package name
Resolves #1: Unable to locate package libirecovery-dev

The Debian/Ubuntu package is libirecovery-1.0-dev, not libirecovery-dev.
Updated the apt package list in start.sh and README.md.

Files modified:
- start.sh
- README.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:03:04 +02:00
tr4m0ryp
420c9963f1 fix(#4): add missing afc_strerror() helper function
Resolves #4: build fails with undefined reference to afc_strerror

afc_strerror() was called in 6 places but never defined. Added a static
helper that maps afc_error_t codes to human-readable strings.

Files modified:
- src/bypass/afc_utils.c

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:02:59 +02:00
tr4m0ryp
68e33e2c1d chore: Add bounty/ to gitignore and remove from tracking
Bug bounty reports contain sensitive vulnerability details that
should not be in a public repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 02:09:40 +02:00
tr4m0ryp
c109b15446 feat(bounty): Add bounty registry, exploit test log, and /bounty skill
Bug bounty tracker with overview.md registry, exploit test log
documenting all 8 test cycles on iPad8,10 iOS 26.3, and /bounty
skill for find/verify/test/report/status commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 02:08:23 +02:00
tr4m0ryp
7e7a75f6fd docs: Complete iOS 26.3 live testing results and research findings
Comprehensive documentation of all attack vectors tested on iPad8,10
iOS 26.3: USB activation protocol (nonce barrier), AFC filesystem
manipulation, lockdownd flag persistence (25 flags), recovery mode,
firmware RE (FDR-LOCAL keys, hactivation flags, kernel analysis),
and WiFi captive portal with confirmed JavaScript execution in
WebSheet. HTTPS certificate pinning identified as remaining barrier.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 01:23:56 +02:00
tr4m0ryp
918cd1f2cf feat(vulnhunt): Hactivation flags discovery + FDR key signed attempts
Found DisableHactivation and allow-hactivation flags in restored_external.
Both persist via lockdownd but only affect restore flow, not normal activation.
FDR-LOCAL signed records still rejected due to nonce validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:36:57 +02:00
tr4m0ryp
b864552e8d feat(vulnhunt): FDR-LOCAL key discovery + complete iOS 26.3 analysis
Major finding: Apple's FDR-LOCAL private keys (RSA 2048-bit + EC P-256)
and certificates extracted from libFDR.dylib in firmware ramdisk.
These keys enable local signing of FDR/activation certificates.
Complete documentation of all tested vectors, available services on
locked device, and four potential paths forward.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:33:03 +02:00
tr4m0ryp
cae9caa9a8 feat(vulnhunt): iOS 26.3 live device testing results
Comprehensive penetration testing on iPad8,10 iOS 26.3:
- USB activation: all paths tested, blocked by activation nonce
- Factory activation commands REMOVED on iOS 26.3
- AFC read/write confirmed but sandbox blocks activation files
- Recovery mode env vars don't persist on A12+
- bookassetd exploit not processed on 26.3 (patched)
- Apple's real drmHandshake captured (serverKP, FDRBlob)
- Device nonces captured from recovery mode
- Exploit chain document with three attack paths
- Captive portal infrastructure built and tested locally

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:22:37 +02:00
tr4m0ryp
bfce30d885 feat(captive): Add automated USB bypass and HTTPS activation server
Automated USB bypass flow: detect device, redirect Apple activation
servers via /etc/hosts, serve factory activation responses over
HTTPS, verify activation state. One-command bypass via run_bypass.sh.
Includes safe hosts file management with cleanup on exit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:59:10 +02:00
tr4m0ryp
cfb8157064 feat(captive): Build captive portal + fake activation server
Captive portal HTTP server mimicking Apple's activation endpoints
(albert.apple.com, humb.apple.com). Handles captive detection,
profile serving, drmHandshake, deviceActivation, and VU#346053
baa endpoint. Includes cert generation, profile builder, DNS
config generator, and local test script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 21:52:10 +02:00