<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts | Amish Patadiya</title><link>https://amish.patadiya.in/post/</link><atom:link href="https://amish.patadiya.in/post/index.xml" rel="self" type="application/rss+xml"/><description>Posts</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><copyright>Amish Patadiya © 2022</copyright><image><url>https://amish.patadiya.in/img/avatar</url><title>Posts</title><link>https://amish.patadiya.in/post/</link></image><item><title>How to Intercept Android Studio Emulator Traffic in BURP Suite</title><link>https://amish.patadiya.in/post/intercept_traffic_android_studio_emulator/</link><pubDate>Mon, 15 Jan 2024 17:15:02 +0530</pubDate><guid>https://amish.patadiya.in/post/intercept_traffic_android_studio_emulator/</guid><description>&lt;div style="font-size: 16px;">
&lt;p>In this blog, I and
&lt;a href="https://twitter.com/devsecboy" target="_blank" rel="noopener">Sanjay&lt;/a>
have explained how we can capture any application network traffic in Android Studio Emulator.&lt;br/>&lt;/p>
&lt;p>To begin, export the Burp certificate in the &amp;lsquo;DER&amp;rsquo; format and save it to the base system, as illustrated in the following figure:&lt;/p>
&lt;div>
&lt;img src="resources/1.png" style="border:1px solid black;">
&lt;/div>
&lt;p>Next, utilizing OpenSSL, convert the DER file to a PEM file. Afterward, rename the PEM file with the certificate hash and proceed to push the certificate to the emulator&amp;rsquo;s &amp;lsquo;/sdcard&amp;rsquo; folder, as depicted in the figure below:&lt;/p>
&lt;pre>&lt;code>openssl x509 -inform DER -in burpcert.der -out burpcert.pem
openssl x509 -inform PEM -subject_hash_old -in burpcert.pem | head -1
mv burpcert.pem 9a5ba575.0
adb push 9a5ba575.0 /sdcard
&lt;/code>&lt;/pre>
&lt;div>
&lt;img src="resources/2.png" style="border:1px solid black;">
&lt;/div>
&lt;p>Please note that this step is optional. However, if you wish to run &amp;lsquo;emulator.exe&amp;rsquo; from the command line irrespective of the current path, you&amp;rsquo;ll need to configure the following environment variables:&lt;/p>
&lt;div>
&lt;img src="resources/3.png" style="border:1px solid black;">
&lt;/div>
&lt;p>To modify the certificate in the system folder, it&amp;rsquo;s necessary to open the emulator in writable mode. This can be achieved by executing the following commands:&lt;/p>
&lt;pre>&lt;code>emulator.exe -list-avds
emulator.exe -writeable-system -avd &amp;quot;OUTPUT_OF_ABOVE_COMMAND&amp;quot;
&lt;/code>&lt;/pre>
&lt;div>
&lt;img src="resources/4.png" style="border:1px solid black;">
&lt;/div>
&lt;p>To incorporate the Burp certificate, it&amp;rsquo;s essential to copy it to both the Android security &amp;lsquo;cacerts&amp;rsquo; and Google &amp;lsquo;cacerts&amp;rsquo; folders. This can be accomplished by executing the following command, as illustrated below:&lt;/p>
&lt;pre>&lt;code>adb shell
su
cd /sdcard
&lt;/code>&lt;/pre>
&lt;pre>&lt;code>mkdir -m 700 mycerts
cp 9a5ba575.0 mycerts/
cp /system/etc/security/cacerts/* mycerts/
mount -t tmpfs tmpfs /system/etc/security/cacerts
cp mycerts/* /system/etc/security/cacerts/
chown root:root /system/etc/security/cacerts/*
chmod 644 /system/etc/security/cacerts/*
chcon u:object_r:system_file:s0 /system/etc/security/cacerts/*
&lt;/code>&lt;/pre>
&lt;pre>&lt;code>mkdir -m 700 mycerts_google
cp 9a5ba575.0 mycerts_google/
cp /system/etc/security/cacerts_google/* mycerts_google/
mount -t tmpfs tmpfs /system/etc/security/cacerts_google
cp mycerts_google/* /system/etc/security/cacerts_google/
chown root:root /system/etc/security/cacerts_google/*
chmod 644 /system/etc/security/cacerts_google/*
chcon u:object_r:system_file:s0 /system/etc/security/cacerts_google/*
&lt;/code>&lt;/pre>
&lt;div>
&lt;img src="resources/5.png" style="border:1px solid black;">
&lt;/div>
&lt;p>Launch any application from the emulator, and as depicted below, you&amp;rsquo;ll observe that we successfully intercepted the traffic.&lt;/p>
&lt;div>
&lt;img src="resources/6.png" style="border:1px solid black;">
&lt;/div>
&lt;p>After restarting the emulator, it&amp;rsquo;s necessary to rerun the following command to resume intercepting the traffic.&lt;/p>
&lt;pre>&lt;code>adb shell
su
cd /sdcard
&lt;/code>&lt;/pre>
&lt;pre>&lt;code>mount -t tmpfs tmpfs /system/etc/security/cacerts
cp mycerts/* /system/etc/security/cacerts/
chown root:root /system/etc/security/cacerts/*
chmod 644 /system/etc/security/cacerts/*
chcon u:object_r:system_file:s0 /system/etc/security/cacerts/*
&lt;/code>&lt;/pre>
&lt;pre>&lt;code>mount -t tmpfs tmpfs /system/etc/security/cacerts_google
cp mycerts_google/* /system/etc/security/cacerts_google/
chown root:root /system/etc/security/cacerts_google/*
chmod 644 /system/etc/security/cacerts_google/*
chcon u:object_r:system_file:s0 /system/etc/security/cacerts_google/*
&lt;/code>&lt;/pre>
&lt;div>
&lt;img src="resources/7.png" style="border:1px solid black;">
&lt;/div>&lt;/div>
&lt;p>&lt;strong>References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://developer.android.com/studio/run/emulator-commandline">https://developer.android.com/studio/run/emulator-commandline&lt;/a>&lt;/li>
&lt;/ul>
&lt;/div></description></item><item><title>IPv6 for Pentester</title><link>https://amish.patadiya.in/post/ipv6/</link><pubDate>Sun, 16 Sep 2018 17:15:02 +0530</pubDate><guid>https://amish.patadiya.in/post/ipv6/</guid><description>&lt;iframe src="//www.slideshare.net/slideshow/embed_code/key/dcdLIjmUL5gDZk" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> &lt;/iframe> &lt;div style="margin-bottom:5px"> &lt;strong> &lt;a href="//www.slideshare.net/AmishPatadiya1/ipv6-for-pentester" title="IPv6 for Pentester" target="_blank">IPv6 for Pentester&lt;/a> &lt;/strong> from &lt;strong>&lt;a href="https://www.slideshare.net/AmishPatadiya1" target="_blank">Amish Patadiya&lt;/a>&lt;/strong> &lt;/div></description></item><item><title>Analyzing CVE-2018-6376 – Joomla!, Second Order SQL Injection</title><link>https://amish.patadiya.in/post/second-order-sqli-injection/</link><pubDate>Fri, 09 Feb 2018 17:15:02 +0530</pubDate><guid>https://amish.patadiya.in/post/second-order-sqli-injection/</guid><description>&lt;h2 id="httpswwwnotsosecurecomanalyzing-cve-2018-6376httpswwwnotsosecurecomanalyzing-cve-2018-6376">
&lt;a href="https://www.notsosecure.com/analyzing-cve-2018-6376/" target="_blank" rel="noopener">https://www.notsosecure.com/analyzing-cve-2018-6376/&lt;/a>
&lt;/h2></description></item></channel></rss>