Mobile resilience
bb-huge π€ , Personal bug bounty findings hub and bug bounty orchestration for multiple agents
npx -y skills add ShulkwiSEC/bb-huge --skill mobile-resilienceAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 18 stars18 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Detects weak reverse engineering and tampering protections in mobile apps (Android/iOS). Trigger on: root detection bypass, jailbreak detection bypass, Frida detection, debugger detection, anti-debugging, ptrace, sysctl, emulator detection, code obfuscation absent, debug symbols present, get-task-allow, ProGuard disabled, R8 disabled, string encryption, integrity check, file tampering, repackaging, dynamic instrumentation, runtime hook, Magisk hide, Magisk, frida-server, objection bypass, signing verification, apk resign. Covers MASVS-RESILIENCE-1/2/3/4.
The file declares its own license as MIT. That is the authorβs claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
8.9 KB, ~1.9k tokens by cl100k_base, as published. Nobody here has run it
Mobile Resilience Against Reverse Engineering
What Is Broken and Why
Resilience controls protect app logic, keys, and business rules from reverse engineering and tampering. Root/jailbreak detection, anti-debugging, and integrity checks create defense-in-depth. Without them, attackers can attach Frida to patch auth checks, repack APKs with modified logic, or extract keys from memory at leisure. Most basic resilience checks are bypassable individually β the value comes from layered controls that raise the cost of attack. Root detection that relies on a single file check (/system/app/Superuser.apk) is trivially bypassed; multi-vector detection that checks file system, build properties, and system call behavior is significantly harder.
Key Signals
get-task-allowentitlement present in iOS app (allows debugger attachment)- Debug symbols not stripped in release build:
nm libapp.so | grep "T _"shows function names - Single-vector root/jailbreak detection: only checks for
/system/xbin/suor Cydia URL scheme - No anti-debugging:
ptrace(PT_DENY_ATTACH, 0, 0, 0)/sysctlchecks absent in iOS binary - Debug build shipped to production:
BuildConfig.DEBUG == true,android:debuggable="true" - No signature/integrity check β APK can be repackaged and re-signed without detection
- Frida/objection successfully attaches without app detecting or exiting
- ProGuard/R8 not applied: decompiled class names match original Java package structure
- Emulator detection absent: app runs on AVD/Simulator with full functionality
Methodology
Android:
- Check
android:debuggablein manifest β should befalsein release build - Attach debugger:
adb shell jdwp | xargsβ connect Android Studio debugger β if attaches: no anti-debug - Run on emulator (AVD) β does the app detect and exit?
- Root check bypass: run app on Magisk-rooted device, then apply MagiskHide/Shamiko β does app still detect root?
- Frida attach:
frida -U -f TARGET_PKGβ if no crash/exit: no Frida detection - Repack test:
apktool b app/ -o repack.apkβ sign β install β does app accept repackaged build? - Check obfuscation:
jadx decompiled/β are class/method names meaningful (no obfuscation) or mangled?
iOS:
- Check
get-task-allowentitlement:codesign -d --entitlements :- App.ipa - Attach lldb:
lldb -p TARGET_PIDβ does app detect and exit? - Jailbreak detection: run on jailbroken device β does app behave normally?
- Check for ptrace calls:
otool -tV App.app/App | grep ptrace - Frida attach:
frida -U TARGETβ detection if app callsproc_pidinfoto scan for suspicious process names - Check debug symbols:
dsymutil -s App.app/App | head -50β are symbols present in production? - Integrity check: modify a resource file in IPA β re-sign β install β does app detect modification?
Payloads & Tools
# Android β check debuggable flag
apktool d app.apk && grep "debuggable" app/AndroidManifest.xml
# Android β Frida bypass root detection (generic)
frida -U -f TARGET_PKG --no-pause -l bypass-root-detection.js
# Common scripts: https://github.com/fridayy/frida-scripts
# Android β objection root bypass
objection --gadget TARGET_PKG explore
android root disable
# Android β check obfuscation
jadx app.apk -d jadx-out/
ls jadx-out/sources/ # readable package names = no obfuscation
# iOS β check entitlements
codesign -d --entitlements :- Payload/App.app/App | grep "get-task-allow"
# iOS β Frida jailbreak bypass
frida -U TARGET -l jailbreak-bypass.js
# Liberty Lite, Shadow (Cydia tweaks) for persistent bypass
# checksec β Android native binary
checksec --file=lib/arm64-v8a/libapp.so
// Frida β Android: bypass single root check (file existence)
Java.perform(function() {
var File = Java.use("java.io.File");
File.exists.implementation = function() {
var path = this.getAbsolutePath();
if (path.indexOf("su") >= 0 || path.indexOf("magisk") >= 0) {
console.log("[+] Blocked file check:", path);
return false;
}
return this.exists();
};
});
Bypass Techniques
- MagiskHide / Shamiko β hides root from app's file system and build property checks
- Frida gadget β embed Frida gadget into APK instead of attaching server, bypasses process-name-based Frida detection
- objection
android root disableβ hooks common root detection libraries (RootBeer, SafetyNet check bypass) - SafetyNet bypass β on rooted devices with MagiskHide + Universal SafetyNet Fix module
- iOS Liberty Lite / Shadow β jailbreak tweaks that hide jailbreak artifacts from app queries
- Repackaging with modified entitlements β add
get-task-allowto enable debugging on non-jailbroken device - Anti-anti-debugging β hook
ptraceto return 0 always; hooksysctlto clearP_TRACEDflag
Exploitation Scenarios
Scenario 1 β Frida Attach to Extract Business Logic
Setup: Fintech app has no Frida detection. Logic for calculating fees is in native method calculateFee(). β Trigger: frida -U TARGET -e "Module.findExportByName(null,'calculateFee')" hooks the method. β Impact: Proprietary fee calculation logic extracted and replicated by competitor.
Scenario 2 β APK Repackage to Remove Feature Flags
Setup: App has premium feature gated by boolean check if (user.isPremium). No integrity verification. β Trigger: Decompile APK, patch smali to always return true, repack and re-sign. β Impact: Free users access all premium features without payment.
Scenario 3 β Debug Build in Production
Setup: App shipped with android:debuggable="true" in release. β Trigger: Attacker runs adb shell run-as TARGET_PKG to access app's private data directory. β Impact: SQLite databases, SharedPreferences, and cached tokens extracted without root.
False Positives
- App correctly detects Frida but exits gracefully (expected behavior) β confirm this is a resilience pass, not a bug
get-task-allowpresent in development provisioning profile only β verify release build entitlements separately- Debug symbols in debug build β only a finding in production/release builds
- Weak single-vector root check β technically bypassed but may be acceptable risk for non-high-value apps
Fix Patterns
// Android β multi-vector root detection (raise attack cost)
fun isDeviceRooted(): Boolean {
return checkSuBinary() || checkBuildTags() || checkDangerousApps() ||
checkRWPaths() || checkSafetyNetAttestation()
}
// Use Play Integrity API for cryptographic device attestation (replaces SafetyNet)
// Android β prevent debugging in release
// In build.gradle: ensure debuggable is false
buildTypes { release { debuggable false } }
// iOS β ptrace anti-debug
import Darwin
func denyDebugger() {
var name = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()]
var info = kinfo_proc()
var infoSize = MemoryLayout<kinfo_proc>.size
sysctl(&name, 4, &info, &infoSize, nil, 0)
if (info.kp_proc.p_flag & P_TRACED) != 0 { exit(1) }
}
- Layer multiple detection vectors β file checks, build props, system calls, app store attestation
- Use Play Integrity API (Android) / DeviceCheck + App Attest (iOS) for server-side verification
- Enable ProGuard/R8 with aggressive obfuscation rules for all release builds
- Strip debug symbols from production native libraries (
-slinker flag) - Implement runtime integrity checks: verify APK signature and file hashes match expected values
Related Skills
[[mobile-auth-bypass]] via Frida hook is the most common exploit that resilience controls defend against β without debugger detection and Frida detection, biometric bypasses are trivially reproducible. [[mobile-insecure-storage]] extraction requires root or jailbreak access that resilience detection is designed to catch. [[mobile-code-quality]] binary hardening (PIE, stack canaries) complements resilience: hardened native code makes memory corruption exploitation harder even when the attacker has successfully bypassed root/jailbreak detection.