# iOS 18.7.8 A12 Software Jailbreak Exploit Chain

**Target:** iPhone XS (A12, iOS 18.7.8 / 22H352)  
**Approach:** Pure software exploit chain — no hardware, no downgrade, no blobs required

## Exploit Chain Overview

```
┌─────────────────────────────────────────────────────────────────┐
│  Stage 1: KASLR Leak (CVE-2026-28943)                          │
│  IOHIDFamily getProperty → kernel pointer leak → slide calc    │
├─────────────────────────────────────────────────────────────────┤
│  Stage 2: OOB Write (CVE-2026-28819)                           │
│  Skywalk packet_copy offset/len check missing → heap overflow  │
├─────────────────────────────────────────────────────────────────┤
│  Stage 3: Kernel R/W Primitive                                 │
│  OOB write → corrupt ipc_port → fake port → arbitrary read/write│
├─────────────────────────────────────────────────────────────────┤
│  Stage 4: PPL Bypass (momentarius)                             │
│  Patch ppl_control/ppl_ops → disable PPL + AMFI               │
├─────────────────────────────────────────────────────────────────┤
│  Stage 5: Payload Execution                                    │
│  Inject trustcache → spawn root shell / install Cydia/SSH      │
└─────────────────────────────────────────────────────────────────┘
```

## Vulnerabilities Used

| CVE | Component | Type | Status |
|-----|-----------|------|--------|
| CVE-2026-28819 | Wi-Fi / Skywalk (packet_copy.c) | OOB Write → Kernel RCE | ✅ Analyzed |
| CVE-2026-28943 | IOHIDFamily | KASLR Leak | ✅ Analyzed |
| CVE-2026-43668 | mDNSResponder | UAF (Remote) | 🔍 Identified |
| CVE-2026-28972 | Kernel | OOB Write | 🔍 Identified |

## Project Structure

```
18.7.8-exploit/
├── Exploit/
│   ├── Common/           # Core types, logging, device detection
│   ├── Skywalk/          # CVE-2026-28819 OOB write exploit
│   ├── mDNS/             # CVE-2026-43668 UAF exploit
│   ├── IOHID/            # CVE-2026-28943 KASLR leak
│   ├── KernelRW/         # Fake ipc_port kernel R/W
│   └── PPL/              # momentarius PPL bypass
├── Tests/
│   ├── FullChainTest/    # Complete chain test app (UIKit)
│   ├── SkywalkTest/      # Skywalk OOB write test
│   ├── MDNSTest/         # mDNS UAF test
│   └── IOHIDTest/        # IOHID KASLR leak test
├── CI/
│   └── Scripts/          # Build helper scripts
├── Resources/
│   └── entitlements/     # Entitlements for codesign
├── .github/workflows/    # GitHub Actions CI/CD
└── Package.swift         # Swift Package Manager
```

## Building

### Prerequisites
- macOS with Xcode 15.4+
- Apple Developer Account (for codesigning)
- iPhone XS (A12) on iOS 18.7.8 for testing

### Local Build
```bash
# Clone
git clone https://github.com/keepantidev/18.7.8-exploit.git
cd 18.7.8-exploit

# Open in Xcode
open Tests/FullChainTest/FullChainTest.xcodeproj

# Build & Run on device (via Xcode or Sideloadly)
```

### CI/CD (GitHub Actions)
```bash
# Trigger build via GitHub Actions
gh workflow run build.yml -f build_type=Release -f target=FullChainTest

# Or push to main/develop branch
git push origin main
```

The workflow will:
1. Build on macOS-14 (Xcode 15.4)
2. Codesign with your developer certificate
3. Export IPA artifact
4. Optionally deploy to render.com for easy installation

### Installation on Device
1. Download IPA from GitHub Actions artifacts or render.com
2. Install via Sideloadly (Windows) or AltStore (macOS)
3. Open app and tap "Start Exploit"

## Development Status

| Component | Status | Notes |
|-----------|--------|-------|
| KASLR Leak (IOHID) | 🔧 Framework ready | Needs kernel pointer validation |
| OOB Write (Skywalk) | 🔧 Framework ready | Needs userspace trigger path |
| Kernel R/W (Fake Port) | 🔧 Framework ready | Needs OOB integration |
| PPL Bypass (momentarius) | 🔧 Framework ready | Needs offsets for 18.7.8 |
| Full Chain Integration | 🔧 Framework ready | End-to-end testing needed |
| CI/CD Pipeline | ✅ Ready | GitHub Actions configured |

## Key Technical Details

### Skywalk OOB Write (CVE-2026-28819)
- **Functions:** `packet_copy#1` (0xFFFFFFF0084531B4), `packet_copy#2` (0xFFFFFFF008451E0C)
- **Bug:** Missing `offset + len <= src_len` check
- **Primitive:** 128-bit vectorized `ldp/stp q0,q1` copy loop
- **Reachability:** Via Wi-Fi driver IOKit user client or raw socket injection

### IOHID KASLR Leak (CVE-2026-28943)
- **Target:** `IOHIDInterface::getProperty` / `IOHIDEventService::getProperty`
- **Leak:** Kernel pointers in returned OSData/OSNumber objects
- **Method:** Brute-force property keys via `IORegistryEntryCreateCFProperty`

### Kernel R/W via Fake ipc_port
- **Technique:** OOB write → corrupt adjacent `ipc_port` → control `ip_kobject`
- **Read/Write:** `pid_for_task`, `task_info`, `mach_vm_read/write` via fake port
- **PAC Bypass:** Use `ptrauth_sign_unauthenticated` or sign with leaked keys

### momentarius PPL Bypass
- **Targets:** A12/A13, iOS 15.0–26.0.1
- **Method:** Patch `ppl_control->ppl_ops` → fake ops that allow all
- **Also patches:** `cs_enforcement=0`, `amfi_enabled=0`

## Contributing

This is a research project. Contributions welcome for:
- Finding missing offsets for iOS 18.7.8
- Improving userspace trigger paths
- Testing on physical devices
- Code quality and documentation

## Disclaimer

This code is for **security research and educational purposes only**. 
- Only test on devices you own
- Do not use for malicious purposes
- No warranty provided — kernel exploits can cause data loss or device instability

## License

MIT License — see LICENSE file for details.

## Credits

- **momentarius** — PPL bypass (bazad, abc, etc.)
- **Dopamine** — Jailbreak framework reference
- **Apple Security Team** — Vulnerability fixes in 18.7.9+
- **Security Researchers** — CVE analysis and public writeups

---

**Next Steps:** The framework is built. Now we need to:
1. Find exact kernel offsets for 18.7.8 (KASLR slide, ppl_control, etc.)
2. Implement userspace trigger for Skywalk OOB write
3. Test on device via GitHub Actions → Sideloadly
4. Iterate until full chain works