<?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 Krushna Lipane on Medium]]></title>
        <description><![CDATA[Stories by Krushna Lipane on Medium]]></description>
        <link>https://medium.com/@krushnalipane?source=rss-30a1b9e00af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5jzFO6bRAoyxd6JcL8-fxg.jpeg</url>
            <title>Stories by Krushna Lipane on Medium</title>
            <link>https://medium.com/@krushnalipane?source=rss-30a1b9e00af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 16:57:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krushnalipane/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[Extracting IPA from iPhone]]></title>
            <link>https://krushnalipane.medium.com/extracting-ipa-from-iphone-5fa8e788615c?source=rss-30a1b9e00af------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fa8e788615c</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[iphone]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Krushna Lipane]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 17:58:04 GMT</pubDate>
            <atom:updated>2024-03-31T17:58:04.628Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*Tl0bT-dkRG5rMDM1YQxzlg.png" /></figure><p>Most of us are aware that apk files are used in android, likewise ipa files are used in iOS devices. Both at core are just zip files having different structure. Basic structure of an ipa file can be seen below:</p><p><strong>Structure of a .ipa file</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-9NlXYQXBpM6sxh6nGMlQ.png" /></figure><p>Unlike android, iOS runs applications inside separate containers. Hence, in order to get the desired application first we need to find its container id.</p><p>Path where these containers can be located is below:</p><pre>/var/containers/Bundle/Application</pre><p><strong>Step 1: </strong>SSH into the iPhone</p><pre>ssh root@&lt;ip_address_of_iphone&gt;</pre><p><strong>Step 2: </strong>Move to “/var/containers/Bundle/Application” directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b4dmucpw2PBsxhBtlE_huA.png" /><figcaption>List of all containers</figcaption></figure><p><strong>Step 3</strong>: Find container id of the target application. This is difficult to find out the id so either we can use grep command to find the target id or we can navigate through Filza to get the target id. Once we get the id, we move inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-mEyVu3pSyMNEX5K-1RdA.png" /><figcaption>Container id of target application</figcaption></figure><p><strong>Step 4</strong>: Here, we need to create a “Payload” directory which will be storing the app files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1a5xxhjJ1CtfoF1_q3hGLg.png" /><figcaption>Copied app directory to Payload folder</figcaption></figure><p><strong>Step 5</strong>: Now, we need to zip the folder up and create an ipa file out of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dLMcD6w6wowoS5XyZkmrTQ.png" /><figcaption>Created ipa file</figcaption></figure><pre>&quot;-r&quot; is used to make it recursive, so it copies all files and directories inside Payload directory.</pre><p><strong>Step 6</strong>: At last, we need to add “iTunesMetadata.plist” to same zip file and it will be done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TZQjG1e5rZS5Q2pJgbicAw.png" /><figcaption>Added iTunesMetadata.plist to ipa file</figcaption></figure><pre>&quot;-u&quot; is used to update same zip file with new files.</pre><p><strong>Step 7: </strong>Finally, download the ipa file using Filza or SCP.</p><pre>IPA file will be created at the path given in the step 5.</pre><p>Happy Hacking !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fa8e788615c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intercepting Flutter Based Application Traffic Using iptables]]></title>
            <link>https://krushnalipane.medium.com/intercepting-flutter-based-application-traffic-using-iptables-da0f67064944?source=rss-30a1b9e00af------2</link>
            <guid isPermaLink="false">https://medium.com/p/da0f67064944</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[mobile-pentesting]]></category>
            <dc:creator><![CDATA[Krushna Lipane]]></dc:creator>
            <pubDate>Sun, 24 Sep 2023 19:03:40 GMT</pubDate>
            <atom:updated>2023-09-24T19:03:40.161Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Flutter Applications: A Modern Mobile App Framework</strong></p><p>Flutter, created by Google, has emerged as a popular open-source framework for building natively compiled applications for mobile, web, and desktop from a single codebase. However, with great power comes great responsibility, and ensuring the security of Flutter applications is paramount.</p><p><strong>iptables: Network Traffic Management for Linux</strong></p><p>On the other hand, iptables is a powerful utility for configuring and managing network traffic on Linux-based systems. It allows you to define rules that govern how network packets should be handled, including routing, filtering, and even Network Address Translation (NAT).</p><h3><strong>Understanding the Process</strong></h3><p>Before we dive into the commands, let’s understand the overall process:</p><blockquote><strong><em>Wireshark for Packet Capture:</em> </strong>To route traffic through iptables, you first need to identify the destination IP and port. You can run Wireshark on your local system while your Flutter application is active to capture packets and determine the target IP and port.</blockquote><blockquote><strong><em>Android tcpdump for Packet Storage: </em></strong>Alternatively, you can use ‘Android tcpdump’ to store device packets in a pcap file. This method allows you to capture traffic directly on your Android device.</blockquote><blockquote><strong>Using iptables: </strong>Once you have the pcap file and know the destination IP and port, you can configure iptables to intercept and route the traffic accordingly.</blockquote><h3>Setting Up iptables to Capture Application Traffic</h3><p>We will dive into the practical aspect of configuring iptables to capture traffic originating from a Flutter application. By following a series of iptables commands, we’ll reroute the network traffic from your Flutter application to Burp Suite for interception and to perform pen-testing.</p><p>Below commands allow us to intercept traffic destined for a specific IP address and port and redirect it to Burp Suite.</p><h4>Step 1: DNAT for Forwarding Traffic</h4><pre>iptables -t nat -A PREROUTING -p tcp -d 18.223.74.63 --dport 3000 -j DNAT --to-destination 192.168.1.9:8088</pre><pre>-t nat: Specifies the nat table, which is used for network address translation.<br>-A PREROUTING: Appends the rule to the PREROUTING chain, which is executed before routing decisions are made.<br>-p tcp: Filters traffic for the TCP protocol.<br>-d 18.223.74.63: Specifies the destination IP address you want to intercept.<br>--dport 3000: Filters traffic destined for port 3000.<br>-j DNAT --to-destination 192.168.1.9:8088: Redirects the intercepted traffic to the Burp Suite proxy running on your local machine at port 8088.</pre><h4>Step 2: Accept Incoming Traffic</h4><pre>iptables -t nat -A INPUT -i wlan0 -p tcp --dport 8088 -j ACCEPT</pre><pre>-A INPUT: Appends the rule to the INPUT chain, which handles incoming packets.<br>-i wlan0: Specifies the network interface (wlan0 in this example) where the incoming traffic is expected.<br>-p tcp: Filters TCP traffic.<br>--dport 8088: Allows incoming traffic to reach Burp Suite&#39;s proxy running on port 8088.</pre><h4>Step 3: REDIRECT Traffic to Burp Suite</h4><pre>iptables -t nat -A PREROUTING -i wlan0 -p tcp --dport 3000 -j REDIRECT --to 8088</pre><pre>-A PREROUTING: Appends the rule to the PREROUTING chain for traffic interception.<br>-i wlan0: Specifies the network interface (wlan0 in this example) where the intercepted traffic originates.<br>-p tcp: Filters TCP traffic.<br>--dport 3000: Specifies the source port that the Flutter application uses.<br>-j REDIRECT --to 8088: Redirects the intercepted traffic to the local Burp Suite proxy on port 8088.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ZUUm_GqQNqcwoPpIk8xIg.png" /><figcaption>iptables command</figcaption></figure><h3>Verify the Configuration</h3><p>To ensure that the iptables rules are correctly set up, you can use the following command.</p><pre>iptables -t nat -L -n -v<br></pre><p>This command will display a list of NAT rules, including the ones you’ve just configured. Verify that they match your intended configuration.</p><h3>The Final Step - Start Capturing the Requests</h3><p>With iptables configured, start Burp Suite and configure your device to use your computer as a proxy and run the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/1*rN5LPFkBotYbwHkn2oP9bw.png" /><figcaption>Proxy Setting</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*Cc3fzVcuLI1VTgc-iHhlqg.png" /><figcaption>Android Proxy Setting</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*2-734N_XNqaNDji3Ug01Bg.png" /><figcaption>Request Interception</figcaption></figure><p>Once your device’s traffic is intercepted, you can inspect and analyze it in Burp Suite to identify potential security vulnerabilities within the Flutter application.</p><p>Happy Hacking !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da0f67064944" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypass Android SSL Pinning]]></title>
            <link>https://krushnalipane.medium.com/bypassing-android-ssl-pinning-194e41a0d807?source=rss-30a1b9e00af------2</link>
            <guid isPermaLink="false">https://medium.com/p/194e41a0d807</guid>
            <dc:creator><![CDATA[Krushna Lipane]]></dc:creator>
            <pubDate>Thu, 29 Jun 2023 13:51:52 GMT</pubDate>
            <atom:updated>2023-06-29T16:30:47.453Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Z2gOS24c2LETCfOeSuS9RQ.jpeg" /></figure><p>Check below link for the basic configuration of android device with burpsuite in order to capture the traffic.</p><p><a href="https://portswigger.net/burp/documentation/desktop/mobile/config-android-device">Setup android device with Burpsuite</a></p><h3><strong>Table of Contents</strong></h3><ol><li>How to verify does android app have SSL pinning</li><li>Bypass SSL pinning using<br>2.1 Magisk Module<br>2.2 Objection Tool<br>2.3 Frida Script<br>2.4 Xposed Framework<br>2.5 apk-mitm <br>2.6 Modifying the network_security_config.xml file</li><li>Intercepting Flutter Based Apps</li><li>Intercepting Proxy Unaware app</li></ol><h3>1. How to verify does android app have SSL pinning</h3><p>If the pinning is implemented, then we won’t be able to capture the HTTPS traffic of our target android application.</p><p>In order to confirm, setup the proxy and run the application, then perform some activities that makes a communication between the target application and the server. Now, check the Burp’s dashboard, in specific the Log section.</p><p>If the Pinning is implemented, then we will be able to see a Certificate error as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*G7UMcC0dSXuuOsJf5sQLdg.png" /></figure><h3>2. Bypass SSL pinning using:</h3><blockquote><strong><em>2.1 Magisk Module</em></strong></blockquote><p>If the device is rooted, then Move Certificate module from the Magisk application is very useful.</p><p>This module will move the user trusted certificates to the system store, making the system(root) trust the Certificate which the user install(Burp CA certificate):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/432/1*bKAFuH0jL4IcAGNUunmPQw.png" /></figure><blockquote><strong><em>2.2 Objection Tool</em></strong></blockquote><p><strong>Step 1</strong>: Run the frida server on android device.<br><strong>Step 2</strong>: Attach the target application with the objection using following command:</p><p><em>Objection -g &lt;package name/PID&gt; explore</em></p><p>Then execute next command — “android sslpinning disable”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*2S5wRas2LSEYufer7CqfEA.png" /></figure><p>That’s it, the script will find the SSL pinning classes and hook them during the runtime in order to bypass the SSL pinning.</p><blockquote><strong><em>2.3 Frida Script</em></strong></blockquote><p><strong>Step 1</strong>: Run the frida server on android device.<br><strong>Step 2</strong>: Attach the target application with the frida and run the below bypass script:</p><p><em>frida -U -f &lt;pkg name/PID&gt; -l fridascript.js</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/1*KWEOfOrYhQZrzcYq-3WSig.png" /></figure><blockquote><strong><em>2.4 Xposed Framework</em></strong></blockquote><p>If the device is rooted with Xposed framework, then try the following modules to bypass the SSL pinning.</p><p>Install the below modules and set the target application in scope so during the runtime, these modules will bypass the ssl pinning:</p><ol><li><a href="https://github.com/ac-pm/SSLUnpinning_Xposed">ac-pm/SSLUnpinning_Xposed: Android Xosed Module to bypass SSL certificate validation (Certificate Pinning). (github.com)</a></li><li><a href="https://github.com/ac-pm/SSLUnpinning_Xposed">ViRb3/TrustMeAlready: 🔓 Disable SSL verification and pinning on Android, system-wide (github.com)</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*wIF46SrUJMOkbCLCLFUVZQ.png" /></figure><blockquote><strong><em>2.5 apk-mitm</em></strong></blockquote><p>apk-mitm is a CLI application that automatically prepares Android APK files for HTTPS inspection by modifying the APK files and repacking.</p><p><a href="https://github.com/shroudedcode/apk-mitm">shroudedcode/apk-mitm: 🤖 A CLI application that automatically prepares Android APK files for HTTPS inspection (github.com)</a></p><p><strong>Step 1</strong>: Install apk-mitm using npm.<br><strong>Step 2</strong>: Run the application to patch as shown in the below image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEptVtHHFMQ-JEZmEj830w.png" /></figure><p>That’s it, apk-mitm has done its part. Now, we can install the patched APK and intercept the application traffic.</p><blockquote><strong><em>2.6 Modifying the network_security_config.xml file</em></strong></blockquote><p>The Network Security Configuration lets apps customize their network security settings through a declarative configuration file. The entire configuration is contained within this XML file, and no code changes are required.</p><p>The Network Security Configuration works in Android 7.0 or higher.</p><p><strong>Step 1</strong>: Decompile the android application with apktool or any other decompilers. Now, locate the network_security_config.xml file under /res/xml</p><p><strong>Step 2</strong>: The file may look like this if the app has pinned its own CA certificates:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*rpI_NFW7BZfKX7sy4r7row.png" /></figure><p><strong>Step 3</strong>: Remove that &lt;pin-set&gt;… &lt;/pin-set&gt; tag section and add the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*cuPrxrfZdRaZiCw383jVeg.png" /></figure><p>Step 4: Now, save the file and Re-pack the application using apktool and uber-apk-signer (Sign the modified APK).</p><p>That’s it, install our modified APK to capture traffic.</p><h3><em>3. Intercepting Flutter Based Apps</em></h3><p>The flutter based applications are basically Proxy unaware so the normal interception method will not work with these apps.</p><p>In order to capture the traffic we have to use reflutter framework.</p><p>This framework helps with Flutter apps reverse engineering using the patched version of the Flutter library which is already compiled and ready for app repacking.</p><p><strong>Step 1</strong>: Install the reflutter using pip.</p><p><strong>Step 2</strong>: Follow the below commands as shown in the screenshot:</p><p><em>reflutter app.apk</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*afQuaJtloqfY5XeRG_XqSw.png" /></figure><p><strong>Step 3</strong>: Sign the application using uber-apk-signer and Finally install the application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*anxkkVmncoteextG_D3z6g.png" /></figure><p><strong>Step 4</strong>: Now in Burp proxy, Start listening the port 8083 and also enable ‘Support Invisible Proxying’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*F4T_PZdpMLpqD2QmadGcOQ.png" /></figure><p>That’s it.. Capture the request and enjoy hacking.</p><h3><em>4. Intercepting Proxy Unaware app with HTTP request using Hosts Go application</em></h3><p>Sometimes the application is using HTTP only but still unable to Intercept.</p><p>Application with this behaviour, are basically called “Proxy Unaware” applications. Such applications route the traffic directly to the internet without cooperating with system wide Proxy settings.</p><p><strong>Step 1</strong>: Download ‘Hosts Go’ application in device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*eiPx5JLcQSR_Vl0DnGZKKQ.png" /></figure><p><strong>Step 2</strong>: In ‘Hosts Editor’, add system IP and application domain URL(which can be identified by running the Wireshark).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*DPGIuF6InCuz6wYxYHau9A.png" /></figure><p><strong>Step 3</strong>: Once the details are added, turn on the ‘Hosts change switch’ and click on ‘START’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*N-Tsn0yWWBLLT6Fn60pTdQ.png" /></figure><p><strong>Step 4</strong>: Setup the burp proxy and request handling settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*MaPPVdf5XLPxljehud7r-Q.png" /></figure><p>That’s it. Now the application’s HTTP traffic will be captured in the Burp suite.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=194e41a0d807" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>