Environnement de test iOS
Tip
Apprenez et pratiquez le hacking AWS :
HackTricks Training AWS Red Team Expert (ARTE)
Apprenez et pratiquez le hacking GCP :HackTricks Training GCP Red Team Expert (GRTE)
Apprenez et pratiquez le hacking Azure :
HackTricks Training Azure Red Team Expert (AzRTE)
Soutenir HackTricks
- Vérifiez les plans d’abonnement !
- Rejoignez le 💬 groupe Discord ou le groupe telegram ou suivez-nous sur Twitter 🐦 @hacktricks_live.
- Partagez des astuces de hacking en soumettant des PR au HackTricks et HackTricks Cloud dépôts github.
Apple Developer Program
Une provisioning identity est un ensemble de clés publiques et privées associées à un compte développeur Apple. Pour sign apps, vous devez payer 99$/year pour vous inscrire au Apple Developer Program afin d’obtenir votre provisioning identity. Sans cela, vous ne pourrez pas exécuter des applications depuis le code source sur un appareil physique. Une autre option consiste à utiliser un jailbroken device.
Depuis Xcode 7.2, Apple propose une option pour créer un free iOS development provisioning profile qui permet d’écrire et de tester votre application sur un vrai iPhone. Allez dans Xcode –> Preferences –> Accounts –> + (Ajouter un nouvel Apple ID avec vos identifiants) –> Click on the Apple ID created –> Manage Certificates –> + (Apple Development) –> Done
Ensuite, pour exécuter votre application sur votre iPhone, vous devez d’abord indiquer à l’iPhone de faire confiance à l’ordinateur. Ensuite, vous pouvez essayer de lancer l’application sur le mobile depuis Xcode, mais une erreur apparaîtra. Allez donc dans Settings –> General –> Profiles and Device Management –> sélectionnez le profil non approuvé et cliquez sur “Trust”.
Sur iOS 16+, Developer Mode doit aussi être activé sur l’appareil avant que les applications installées localement et signées pour le développement (ou les apps re-signées avec get-task-allow) puissent s’exécuter. Cette option n’apparaît qu’après avoir pairé l’appareil avec Xcode ou après l’installation d’une app signée pour le développement une première fois. Le flux est : pair the device, déclencher une installation depuis Xcode, puis activer Settings –> Privacy & Security –> Developer Mode, redémarrer et confirmer l’invite après le déverrouillage.
Notez que les applications signées avec le même signing certificate peuvent partager des ressources de manière sécurisée, comme des keychain items.
Les provisioning profiles sont stockés dans le téléphone dans /Library/MobileDevice/ProvisioningProfiles
Modern host-side device tooling
Pour les tests iOS actuels, les outils côté hôte sont de plus en plus répartis entre :
xcrun simctlpour la gestion des simulateursxcrun xctrace list devicespour énumérer les simulateurs et les appareils physiquesxcrun devicectl(Xcode 15+) pour interagir avec des appareils physiques pairés depuis la ligne de commande
Useful examples:
# List booted simulators
xcrun simctl list | grep Booted
# List all visible devices/simulators
xcrun xctrace list devices
# List paired physical devices (Xcode 15+)
xcrun devicectl list devices
devicectl est particulièrement utile dans des pipelines d’automatisation lorsque vous devez installer ou lancer une build de test sans ouvrir Xcode :
xcrun devicectl device install app --device <udid> <path_to_app_or_ipa>
xcrun devicectl device launch app --terminate-existing --device <udid> <bundle_id>
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.
Simulator
Tip
Notez qu’un simulator n’est pas la même chose qu’un emulator. Le simulator ne fait que simuler le comportement et les fonctionnalités de l’appareil mais ne les utilise pas réellement.
Simulator
La première chose à savoir est que réaliser un pentest dans un simulator sera beaucoup plus limité que de le faire sur un device jailbroken.
Tous les outils nécessaires pour construire et supporter une app iOS sont only officially supported on Mac OS.
L’outil de facto d’Apple pour créer/debugger/instrumenter des applications iOS est Xcode. Il peut être utilisé pour télécharger d’autres composants tels que simulators et différentes SDK versions requises pour build et test votre app.
Il est fortement recommandé de download Xcode depuis le official app store. D’autres versions peuvent contenir des malwares.
The simulator files can be found in /Users/<username>/Library/Developer/CoreSimulator/Devices
Le simulator reste très utile pour tester rapidement des filesystem artifacts, NSUserDefaults, plist parsing, custom URL schemes, et une basic runtime instrumentation. Cependant, gardez à l’esprit qu’il n’émule pas plusieurs propriétés de sécurité propres aux appareils physiques souvent pertinentes lors d’un pentest, telles que le Secure Enclave, le baseband, certains comportements d’keychain access-control, des biometric flows réalistes, et des conditions d’exécution spécifiques au jailbreak.
To open the simulator, run Xcode, then press in the Xcode tab –> Open Developer tools –> Simulator
__In the following image clicking in “iPod touch […]” you can select other device to test in:
.png)
.png)
Applications in the Simulator
Inside /Users/<username>/Library/Developer/CoreSimulator/Devices you may find all the installed simulators. If you want to access the files of an application created inside one of the emulators it might be difficult to know in which one the app is installed. A quick way to find the correct UID is to execute the app in the simulator and execute:
xcrun simctl list | grep Booted
iPhone 8 (BF5DA4F8-6BBE-4EA0-BA16-7E3AFD16C06C) (Booted)
Une fois que vous connaissez l’UID, les apps installées à l’intérieur peuvent être trouvées dans /Users/<username>/Library/Developer/CoreSimulator/Devices/{UID}/data/Containers/Data/Application
Cependant, de manière surprenante, vous ne trouverez pas l’application ici. Vous devez accéder à /Users/<username>/Library/Developer/Xcode/DerivedData/{Application}/Build/Products/Debug-iphonesimulator/
Et dans ce dossier vous pouvez trouver le package de l’application.
Émulateur
Corellium is the only publicly available iOS emulator. It is an enterprise SaaS solution with a per user license model and does not offer any trial license.
Aucun Jailbreak nécessaire
Consultez ce billet de blog sur la façon de pentest une application iOS sur un appareil non jailbreaké :
iOS Pentesting withuot Jailbreak
Jailbreaking
Apple strictly requires that the code running on the iPhone must be signed by a certificate issued by Apple. Jailbreaking is the process of actively circumventing such restrictions and other security controls put in places by the OS. Therefore, once the device is jailbroken, the integrity check which is responsible for checking apps being installed is patched so it is bypassed.
Tip
Unlike Android, you cannot switch to “Developer Mode” in iOS to run unsigned/untrusted code on the device.
Android Rooting vs. iOS Jailbreaking
While often compared, rooting on Android and jailbreaking on iOS are fundamentally different processes. Rooting Android devices might involve installing the su binary or replacing the system with a rooted custom ROM, which doesn’t necessarily require exploits if the bootloader is unlocked. Flashing custom ROMs replaces the device’s OS after unlocking the bootloader, sometimes requiring an exploit.
In contrast, iOS devices cannot flash custom ROMs due to the bootloader’s restriction to only boot Apple-signed images. Jailbreaking iOS aims to bypass Apple’s code signing protections to run unsigned code, a process complicated by Apple’s continuous security enhancements.
Défis du Jailbreaking
Jailbreaking iOS is increasingly difficult as Apple patches vulnerabilities quickly. Downgrading iOS is only possible for a limited time after a release, making jailbreaking a time-sensitive matter. Devices used for security testing should not be updated unless re-jailbreaking is guaranteed.
iOS updates are controlled by a challenge-response mechanism (SHSH blobs), allowing installation only for Apple-signed responses. This mechanism, known as a “signing window”, limits the ability to store and later use OTA firmware packages. The IPSW Downloads website is a resource for checking current signing windows.
Variantes de jailbreak
- Tethered jailbreaks require a computer connection for each reboot.
- Semi-tethered jailbreaks allow booting into non-jailbroken mode without a computer.
- Semi-untethered jailbreaks require manual re-jailbreaking without needing a computer.
- Untethered jailbreaks offer a permanent jailbreak solution without the need for re-application.
Outils et ressources pour le Jailbreaking
Jailbreaking tools vary by iOS version and device. Resources such as Can I Jailbreak?, The iPhone Wiki, and Reddit Jailbreak provide up-to-date information. Examples include:
- Checkra1n for older A7-A11/iOS 12-14 era research devices.
- Palera1n for checkm8-compatible devices (A8-A11) on iOS/iPadOS 15+.
- Dopamine for many arm64/arm64e devices on iOS 15/16 using a modern rootless jailbreak.
- Unc0ver remains relevant mainly for older iOS versions up to 14.8.
Modifying your device carries risks, and jailbreaking should be approached with caution.
Rootless jailbreaks
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.
- Rootless jailbreaks avoid modifying the sealed system volume directly.
- On palera1n, jailbreak files are typically stored under a randomized path in
/private/preboot/...and exposed through the stable symlink/var/jb. - Tweaks, launch daemons, and helper binaries might therefore exist under
/var/jbinstead of the legacy rootful locations.
This has a direct impact on environment validation, Frida setup, and jailbreak detection bypass:
- When checking whether your tooling installed correctly, inspect both legacy paths and
/var/jb. - 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. - If a third-party script or tweak assumes a rootful filesystem layout, it may fail silently on a rootless device.
Avantages et risques du Jailbreaking
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.
Après le Jailbreak
Détection du Jailbreak
Plusieurs applications tenteront de détecter si l’appareil est jailbreaké et, le cas échéant, l’application ne s’exécutera pas
- After jailbreaking an iOS files and folders are usually installed, these can be searched to determine if the device is jailbroken.
- In modern rootless jailbreaks, those files may appear under
/var/jbor resolve through symlinks into/private/preboot/...instead of only in classic rootful locations. - In a jailbroken device applications get read/write access to new files outside the sandbox
- Some API calls will behave differently
- The presence of the OpenSSH service
- Calling
/bin/shwill return 1 instead of 0
More information about how to detect jailbreaking here.
Vous pouvez essayer d’éviter ces détections en utilisant objection’s ios jailbreak disable
Bypass de la détection de jailbreak
- Vous pouvez essayer d’éviter ces détections en utilisant objection’s
ios jailbreak disable - Vous pouvez aussi installer l’outil Liberty Lite (https://ryleyangus.com/repo/). Une fois le repo ajouté, l’app devrait apparaître dans l’onglet ‘Search’
Références
- https://mas.owasp.org/MASTG/iOS/0x06b-iOS-Security-Testing/
- https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device
- https://docs.palera.in/docs/reference/environment-types/
Tip
Apprenez et pratiquez le hacking AWS :
HackTricks Training AWS Red Team Expert (ARTE)
Apprenez et pratiquez le hacking GCP :HackTricks Training GCP Red Team Expert (GRTE)
Apprenez et pratiquez le hacking Azure :
HackTricks Training Azure Red Team Expert (AzRTE)
Soutenir HackTricks
- Vérifiez les plans d’abonnement !
- Rejoignez le 💬 groupe Discord ou le groupe telegram ou suivez-nous sur Twitter 🐦 @hacktricks_live.
- Partagez des astuces de hacking en soumettant des PR au HackTricks et HackTricks Cloud dépôts github.


