You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mobile-pentesting/ios-pentesting/ios-testing-environment.md
+55-4Lines changed: 55 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,10 +9,42 @@ A **provisioning identity** is a collection of public and private keys that are
9
9
Starting in Xcode 7.2 Apple has provided an option to create a **free iOS development provisioning profile** that allows to write and test your application on a real iPhone. Go to _Xcode_ --> _Preferences_ --> _Accounts_ --> _+_ (Add new Appli ID you your credentials) --> _Click on the Apple ID created_ --> _Manage Certificates_ --> _+_ (Apple Development) --> _Done_\
10
10
\_\_Then, in order to run your application in your iPhone you need first to **indicate the iPhone to trust the computer.** Then, you can try to **run the application in the mobile from Xcode,** but and error will appear. So go to _Settings_ --> _General_ --> _Profiles and Device Management_ --> Select the untrusted profile and click "**Trust**".
11
11
12
+
On **iOS 16+**, **Developer Mode** must also be enabled on the device before locally installed development-signed applications (or apps re-signed with `get-task-allow`) will run. This option only appears **after pairing the device with Xcode** or after installing a development-signed app once. The flow is: **pair the device**, trigger an install from Xcode, then enable **Settings** --> **Privacy & Security** --> **Developer Mode**, reboot, and confirm the prompt after unlock.
13
+
12
14
Note that **applications signed by the same signing certificate can share resources on a secure manner, like keychain items**.
13
15
14
16
The provisioning profiles are stored inside the phone in **`/Library/MobileDevice/ProvisioningProfiles`**
15
17
18
+
### Modern host-side device tooling
19
+
20
+
For current iOS testing, the host tooling is increasingly split between:
21
+
22
+
-**`xcrun simctl`** for simulator management
23
+
-**`xcrun xctrace list devices`** to enumerate simulators and physical devices
24
+
-**`xcrun devicectl`** (Xcode 15+) to interact with paired physical devices from the command line
25
+
26
+
Useful examples:
27
+
28
+
```bash
29
+
# List booted simulators
30
+
xcrun simctl list | grep Booted
31
+
32
+
# List all visible devices/simulators
33
+
xcrun xctrace list devices
34
+
35
+
# List paired physical devices (Xcode 15+)
36
+
xcrun devicectl list devices
37
+
```
38
+
39
+
`devicectl` is especially useful in automation pipelines where you need to install or launch a test build without opening Xcode:
Keep Xcode updated when testing **iOS 17+** devices. Apple moved developer services to the **CoreDevice** stack and also changed how **Developer Disk Images** are handled, so outdated host tooling frequently fails with pairing, image-mounting, or app-launch errors.
47
+
16
48
## **Simulator**
17
49
18
50
> [!TIP]
@@ -28,6 +60,8 @@ It's highly recommended to **download** Xcode from the **official app store**. O
28
60
29
61
The simulator files can be found in `/Users/<username>/Library/Developer/CoreSimulator/Devices`
30
62
63
+
The simulator is still very useful for quickly testing **filesystem artifacts**, **NSUserDefaults**, **plist parsing**, **custom URL schemes**, and **basic runtime instrumentation**. However, keep in mind that it doesn't emulate several physical-device security properties that are often relevant during a pentest, such as the **Secure Enclave**, **baseband**, certain **keychain access-control behaviours**, realistic **biometric flows**, and jailbreak-specific execution conditions.
64
+
31
65
To open the simulator, run Xcode, then press in the _Xcode tab_ --> _Open Developer tools_ --> _Simulator_\
32
66
\_\_In the following image clicking in "iPod touch \[...]" you can select other device to test in:
33
67
@@ -93,12 +127,27 @@ iOS updates are controlled by a **challenge-response mechanism** (SHSH blobs), a
93
127
94
128
Jailbreaking tools vary by iOS version and device. Resources such as [Can I Jailbreak?](https://canijailbreak.com), [The iPhone Wiki](https://www.theiphonewiki.com), and [Reddit Jailbreak](https://www.reddit.com/r/jailbreak/) provide up-to-date information. Examples include:
95
129
96
-
-[Checkra1n](https://checkra.in/) for A7-A11 chip devices.
97
-
-[Palera1n](https://palera.in/) for Checkm8 devices (A8-A11) on iOS 15.0-16.5.
98
-
-[Unc0ver](https://unc0ver.dev/) for iOS versions up to 14.8.
130
+
-[Checkra1n](https://checkra.in/) for older A7-A11/iOS 12-14 era research devices.
131
+
-[Palera1n](https://palera.in/) for checkm8-compatible devices (A8-A11) on iOS/iPadOS 15+.
132
+
-[Dopamine](https://github.com/opa334/Dopamine) for many arm64/arm64e devices on iOS 15/16 using a modern rootless jailbreak.
133
+
-[Unc0ver](https://unc0ver.dev/) remains relevant mainly for older iOS versions up to 14.8.
99
134
100
135
Modifying your device carries risks, and jailbreaking should be approached with caution.
101
136
137
+
### Rootless jailbreaks
138
+
139
+
Modern iOS 15+ jailbreaks are commonly **rootless** instead of **rootful**. From a tester perspective, this matters because a lot of older guides still assume that jailbreak files live directly under `/` or `/Library/...`, which is no longer true on many current setups.
140
+
141
+
- Rootless jailbreaks avoid modifying the sealed system volume directly.
142
+
- On palera1n, jailbreak files are typically stored under a randomized path in `/private/preboot/...` and exposed through the stable symlink **`/var/jb`**.
143
+
- Tweaks, launch daemons, and helper binaries might therefore exist under **`/var/jb`** instead of the legacy rootful locations.
144
+
145
+
This has a direct impact on **environment validation**, **Frida setup**, and **jailbreak detection bypass**:
146
+
147
+
- When checking whether your tooling installed correctly, inspect both legacy paths and **`/var/jb`**.
148
+
- When reviewing jailbreak detection logic in an app, remember that modern checks often look for **rootless** artifacts and symlinks in addition to classic indicators like `Cydia.app`.
149
+
- If a third-party script or tweak assumes a rootful filesystem layout, it may fail silently on a rootless device.
150
+
102
151
### Jailbreaking Benefits and Risks
103
152
104
153
Jailbreaking **removes OS-imposed sandboxing**, allowing apps to access the entire filesystem. This freedom enables the installation of unapproved apps and access to more APIs. However, for regular users, jailbreaking is **not recommended** due to potential security risks and device instability.
**Several applications will try to detect if the mobile is jailbroken and in that case the application won't run**
116
165
117
166
- After jailbreaking an iOS **files and folders are usually installed**, these can be searched to determine if the device is jailbroken.
167
+
- In modern **rootless** jailbreaks, those files may appear under **`/var/jb`** or resolve through symlinks into `/private/preboot/...` instead of only in classic rootful locations.
118
168
- In a jailbroken device applications get **read/write access to new files** outside the sandbox
119
169
- Some **API****calls** will **behave differently**
120
170
- The presence of the **OpenSSH** service
@@ -132,7 +182,8 @@ You can try to avoid this detections using **objection's** `ios jailbreak disabl
0 commit comments