<?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 c0pt4n on Medium]]></title>
        <description><![CDATA[Stories by c0pt4n on Medium]]></description>
        <link>https://medium.com/@c0pt4n?source=rss-f2e1489cbd83------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*z4YBpPEcnb010Za41P4GAg.jpeg</url>
            <title>Stories by c0pt4n on Medium</title>
            <link>https://medium.com/@c0pt4n?source=rss-f2e1489cbd83------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 22:04:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@c0pt4n/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[BettleBug Android Walkthrough]]></title>
            <link>https://medium.com/@c0pt4n/bettlebug-android-walkthrough-7e9cd1817b79?source=rss-f2e1489cbd83------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e9cd1817b79</guid>
            <dc:creator><![CDATA[c0pt4n]]></dc:creator>
            <pubDate>Tue, 27 Jan 2026 14:53:58 GMT</pubDate>
            <atom:updated>2026-01-27T14:53:58.411Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*mtzmgg5fQ6eW_apM7KDg2w.png" /></figure><p>To get the Activity name:</p><pre>dumpsys window | grep -i &quot;currentfocus&quot;</pre><h3>Hardcoded Secrets</h3><p>First step to start with is static analysis</p><h4>Hardcoding Sensitive Data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*DzeZtJjXnvh0hXDcHbrhLA.png" /></figure><p>By inspecting the code, we find that it compares the value that the user enters with a variable from <em>strings.xml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SYPRxy5sFd-h6I0q_fWHqg.png" /></figure><p>Now let’s get the value of that variable from <em>strings.xml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWq3i0e3cVHSo7VF2GOH-A.png" /></figure><p>Here we found the hardcoded value..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*gYBbAXtNCPMEhB0hOzKQ3g.png" /></figure><h4>Hardcoding Secrets</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*LMvlItSZDz67iKu4xJEi0A.png" /></figure><p>Going throughout the code of that activity which named <em>EmbeddedSecretSourceCode, </em>we find out an interesting thing..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oebirurCm_UYJoS5N9GpsQ.png" /></figure><p>The promo code is hardcoded!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*V57YVN5zPNzLfKX9ocYRPw.png" /></figure><p>And we successfully got the discount!</p><h3>Data Storage</h3><h4>Shared Preferences</h4><p>It is obvious from the name of the challenge, but let’s inspect the static code..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0N3qZfmfCqiiUuOFvlYIQA.png" /></figure><p>Seems like it saves the file in SharedPreferences and appends a flag to it, let’s do the flow and confirm it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*nhGoQ-McIl0JksBoWYeSMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*u-HjR6u5-Npa5cPIpseIEw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*RYKqHOGE3OZ6nAA1-SsANg.png" /></figure><h4>External Storage</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*lPWzOCw68Au1NQvDJezVlg.png" /></figure><p>As usual the first step is to look at the code..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uHY3y39ih4qibz_hpwPVsg.png" /></figure><p>While inspecting the code, it leaks the path of the file it creates <em>/sdcard/Documents/user.txt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*huVfrJOY-TuFOAiu-NX8RA.png" /></figure><h4>SQLite Databases</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*SDty2GcMwRKsyUYFGfFScg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*djp4f1xZEEgx01qwDPiFHw.png" /></figure><p>While inspecting the code, it is found that it saves the data into local database.</p><p>Now it is time to extract this string from <em>strings.xml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*1Z4x3kjlBCstmh02jEWv7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*PH-9Rc52d1VmMuS4mNU0cw.png" /></figure><h3>WebView</h3><h4>Weak URL Validation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*ugfP_vIFnbdg02ogl9FW_Q.png" /></figure><h4>JavaScript Code Execution</h4><h3>Databases</h3><h4>SQL Injection</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*EBmFywiGEl90zmEtyBuWSg.png" /></figure><p>It is a searchbar, so let’s try simple SQL payload.</p><pre>test&#39; OR &#39;1&#39;=&#39;1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*_N7xmdyUp6NAWe2CA-7igg.png" /></figure><h4>Firebase Database Misconfiguration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*_NZMAsEZHn47eGXjslWzeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*viNyOi6DmwvB3AhFmNw0IQ.png" /></figure><p>By inspecting the code we find out the databseUrl variable, so let’s search for it in <em>strings.xml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*YaDzvTO85k7Xb2guBEXigg.png" /></figure><p>Let’s access the misconfiguration…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ttv9czgz3V2VLLgAwZlcjg.png" /></figure><h3>Android Components</h3><h4>Unprotected Activity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*Fc6r6-OU9eQHUC4RZFY-aQ.png" /></figure><p>Let’s inspect <em>AndroidManifest.xml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*2e0kzmAiVlXsWyzMwSOC7w.png" /></figure><p>This looks like a malicious activity and it is exported, let’s try to run it using adb</p><pre>am start -n app.beetlebug/.ctf.b33tleAdministrator</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*G7xFhhhwqIoXVZ9G_Qpd5Q.png" /></figure><p>Boom! we found the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/1*0UbG3T-TQ-hGsUax6OLAoA.png" /></figure><h4>Vulnerable Service</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*SmclvXnccrf83KrJtfbRfA.png" /></figure><p>While inspecting <em>AndroidManifest.xml</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*_zx90PkPSWZs6a5Eb59cUQ.png" /></figure><p>We find that service that seems vulnerable also.</p><pre>am startservice -n app.beetlebug/.handlers.VulnerableService</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_CgIPiEKPz1qxNNPB3bKAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*Bj2sf1MwY99spNS0Rh7vEA.png" /></figure><h4>Vulnerable Content Provider</h4><h3>Sensitive Info Disclosure</h3><h4>Insecure Logging</h4><pre>pgrep beetlebug</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*v4SJwiLgGL96e1_1gFjGPw.png" /></figure><pre>logcat --pid=6271</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*eSBKDtb9k20eBNsW2Ula_g.png" /></figure><h4>Clipboard Data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*36qDgiLbus_y2HBErAwCkQ.png" /></figure><pre>dumpsys clipboard</pre><p>0x1132c4!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e9cd1817b79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Diva — Insecure Data Storage — Part 4]]></title>
            <link>https://medium.com/@c0pt4n/diva-insecure-data-storage-part-4-2b04d801b402?source=rss-f2e1489cbd83------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b04d801b402</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[android-pentesting]]></category>
            <dc:creator><![CDATA[c0pt4n]]></dc:creator>
            <pubDate>Sun, 25 Jan 2026 22:13:49 GMT</pubDate>
            <atom:updated>2026-01-25T22:27:21.989Z</atom:updated>
            <content:encoded><![CDATA[<h3>Diva — Insecure Data Storage — Part 4</h3><p>Let’s start by getting the Activity name of the <em>Insecure Data Storage — Part 4 </em>window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*l6TQ4Wl6bKEx-gFo9eMQ5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-L4UKplGBxu2Kd8iq5KNCw.png" /></figure><p>Let’s fire up Jadx and check the code…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gnHMVGHBz-DDYiMEnKZFgw.png" /></figure><p>There is a function named <em>saveCredentials()</em> which does the following:</p><p>1. Gets the external storage path (<em>/sdcard</em> by default)<br>2. Creates a hidden file <em>.uinfo.txt</em><br>3. Gives read and write permission.</p><p>Now, let’s try doing that flow.</p><h4><strong>Granting Files Permission</strong></h4><p>We may face file error occurred as below, this is due to Diva application doesn’t have access to files, so don’t forget to allow access to files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mLn5m7mQKhMnSaHM3b5FSQ.png" /><figcaption>Without Files Access Permission</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qv_R4g_1PYb8g0u29hgGYw.png" /><figcaption>After granting permission</figcaption></figure><p>Now we saved the credentials successfully, now let’s try checking the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*OvUZ_xYCDkzzRChO7eJcgQ.png" /></figure><p>In the <em>/sdcard</em> we find that there is already a hidden file created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/156/1*7cYenQ_6zdta7h0DUn-6sA.png" /></figure><p>And it shows the data we already entered.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b04d801b402" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>