iOS
Suspicious loaded librariesHooking & instrumentation
Scans every loaded Mach-O image name for instrumentation and tweak-injection frameworks.
At a glance
- Platform
- iOS
- Category
- Hooking & instrumentation
- Source
- DIIntegrityChecks.m · hasHookingLibraries
- Default status
- Makes status compromised
- Seen firing
- Seen firing in D06, A05. Based on validated scenarios whose observed result includes this signal; see below.
- OWASP MASTG
- MASTG-TEST-0091
How it works
What the code inspects.
Walks the loaded image list with _dyld_image_count() / _dyld_get_image_name() and lowercases each path.
Flags any image whose name contains a known marker: frida, fridagadget, cynject, libcycript, mobilesubstrate, substrate*, substitute, libhooker, ellekit, tweakinject, sslkillswitch, revealserver, systemhook.
This check runs on the Simulator too (unlike the filesystem checks) because the loaded-image list is the process's own, not the host filesystem.
The exploit it addresses
Why this matters.The threat.
Dynamic instrumentation (Frida) and tweak loaders (Cydia Substrate, ellekit, libhooker) inject a dylib into the process so they can rewrite functions at runtime — bypassing login, disabling pinning (SSL Kill Switch), or exfiltrating data. If such a library is mapped in, the app's own code can no longer be trusted.
How it can be bypassed
No single check is sufficient.Known evasions.
Frida's 'gadget' can be renamed, and stealthier injection maps code anonymously so it never appears as a named image in the dyld list.
An attacker can hook _dyld_get_image_name to filter its own library out of the enumeration.
Frida can also attach over a port without loading a recognizable named library into the target.
Validation scenarios
Where this check is exercised.2 scenarios.
References & further reading
- MASTG-TEST-0091: Testing Reverse Engineering Tools Detection (iOS)Open ↗
https://mas.owasp.org/MASTG/tests/ios/MASVS-RESILIENCE/MASTG-TEST-0091/
- Frida — dynamic instrumentation toolkitOpen ↗
The hooking framework these checks are primarily defending against.
https://frida.re/docs/home/
- Frida Gadget (embedded/injected agent)Open ↗
https://frida.re/docs/gadget/
- ellekit (modern tweak injection / substrate replacement)Open ↗
https://github.com/evelyneee/ellekit
- objection — runtime mobile explorationOpen ↗
Automates jailbreak/root bypass and SSL pinning bypass on top of Frida.
https://github.com/sensepost/objection
- Apple dyld source (dynamic linker)Open ↗
https://github.com/apple-oss-distributions/dyld
- The Jiu-Jitsu of Detecting Frida (NowSecure/Vantage Point)Open ↗
https://web.archive.org/web/2018/http://www.vantagepoint.sg/blog/90-the-jiu-jitsu-of-detecting-frida