<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Black Lantern Security (BLSOPS): Detection Engineering]]></title><description><![CDATA[Defensive Strategies, Science, and Analysis.]]></description><link>https://blog.blacklanternsecurity.com/s/incident-response-detection-engineering</link><image><url>https://substackcdn.com/image/fetch/$s_!yKGW!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F206e5fa0-2d64-49f3-8848-8b61962b97d1_865x865.png</url><title>Black Lantern Security (BLSOPS): Detection Engineering</title><link>https://blog.blacklanternsecurity.com/s/incident-response-detection-engineering</link></image><generator>Substack</generator><lastBuildDate>Sat, 18 Apr 2026 10:30:49 GMT</lastBuildDate><atom:link href="https://blog.blacklanternsecurity.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Black Lantern Security (BLSOPS)]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[blacklanternsecurity@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[blacklanternsecurity@substack.com]]></itunes:email><itunes:name><![CDATA[Micheal Reski]]></itunes:name></itunes:owner><itunes:author><![CDATA[Micheal Reski]]></itunes:author><googleplay:owner><![CDATA[blacklanternsecurity@substack.com]]></googleplay:owner><googleplay:email><![CDATA[blacklanternsecurity@substack.com]]></googleplay:email><googleplay:author><![CDATA[Micheal Reski]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Detecting Process Injection]]></title><description><![CDATA[Evasion Techniques and Detection Strategies for Memory-Resident Malware]]></description><link>https://blog.blacklanternsecurity.com/p/detecting-process-injection</link><guid isPermaLink="false">https://blog.blacklanternsecurity.com/p/detecting-process-injection</guid><dc:creator><![CDATA[Adeem Mawani]]></dc:creator><pubDate>Tue, 16 Jul 2024 18:33:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!2Kla!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Overview</h2><p>In today's mature enterprise environments, adversaries must choose a stealthy means of beacon execution. The advancement of antivirus (AV) engines has forced threat actors to migrate many heavily-signatured implants from disk to memory, where they are not scanned as often if at all. <a href="https://attack.mitre.org/techniques/T1055">Process Injection [T1055]</a> is a common technique used to achieve this goal. In this article, we will explore the Windows logging mechanisms available for defenders to detect and prevent process injection, as well as the evasion techniques used by advanced threat actors to circumvent detection.  At a high-level, the figure below demonstrates the general steps that adversaries must take in order to perform Process Injection or <a href="https://attack.mitre.org/techniques/T1620">Reflective Code Loading [T1620]</a>, and the coverage / visibility that good endpoint detection and response (EDR) products have along the way. </p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.blacklanternsecurity.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Black Lantern Security (BLSOPS)! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2Kla!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Kla!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 424w, https://substackcdn.com/image/fetch/$s_!2Kla!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 848w, https://substackcdn.com/image/fetch/$s_!2Kla!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 1272w, https://substackcdn.com/image/fetch/$s_!2Kla!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Kla!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png" width="1200" height="853.763440860215" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:794,&quot;width&quot;:1116,&quot;resizeWidth&quot;:1200,&quot;bytes&quot;:102756,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-large" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2Kla!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 424w, https://substackcdn.com/image/fetch/$s_!2Kla!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 848w, https://substackcdn.com/image/fetch/$s_!2Kla!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 1272w, https://substackcdn.com/image/fetch/$s_!2Kla!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5434ec3-2804-4134-93c1-96bcaaffe082_1116x794.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h2>TL;DR</h2><p>With the myriad of publicly available shellcode loaders, broad detection mechanisms should be utilized to detect as many variations as possible. Most process injection techniques can be abstracted into memory allocation, write, and execution primitives to dynamically execute code. The more generic the abstractions that we can create, the more individual procedures that we can potentially identify. </p><p></p><h2>Step 1: Load PE File From Disk</h2><p>The first step that adversaries commonly employ is loading a PE file from disk to establish <a href="https://attack.mitre.org/tactics/TA0011">command and control (C2) [TA0011]</a> communications. The implant loaded from disk can then callback to an attacker-controlled server, facilitating control over the compromised system. However, stage-less implants directly loaded like this can be easily signatured by AV. While some static indicators can be encrypted to hide their presence, excessively high file entropy can also be an indicator itself. Additionally, EDRs often perform automated dynamic analysis in a sandbox before allowing execution of suspicious binaries to take place. This naturally led to the development of "stagers", which are small programs designed to load and execute position-independent shellcode. Stagers decouple functionality and allow for retrieval of the shellcode at runtime, thereby bypassing AV scans. While impractical for some environments, application whitelisting or code signing enforcement can restrict the usage of unknown applications. This would prevent a stager from directly executing in the first place. While these defenses can potentially be bypassed via <a href="https://attack.mitre.org/techniques/T1574/001">DLL Hijacking [T1574.001]</a> and other techniques, for now, we will assume that the attacker is able to execute a stager on the machine with the goal of injecting code into a remote process. </p><h4>Relevant Security Controls:</h4><ul><li><p><a href="https://attack.mitre.org/mitigations/M1049">Antivirus / Antimalware [M1049]</a></p><ul><li><p><a href="https://github.com/Yara-Rules/rules">Yara Rules</a></p></li></ul></li><li><p><a href="https://attack.mitre.org/mitigations/M1048">Application Isolation and Sandboxing [M1048]</a></p><ul><li><p><a href="https://www.hybrid-analysis.com">Hybrid Analysis (CrowdStrike Falcon&#174; Sandbox)</a></p></li><li><p><a href="https://any.run">Any Run</a></p></li></ul></li><li><p><a href="https://attack.mitre.org/mitigations/M1045">Code Signing [M1045]</a></p><ul><li><p><a href="https://learn.microsoft.com/en-us/windows/security/application-security/application-control/windows-defender-application-control/wdac-and-applocker-overview#applocker">Windows AppLocker</a></p></li></ul></li><li><p><a href="https://attack.mitre.org/mitigations/M1038">Execution Prevention [M1038]</a></p><ul><li><p><a href="https://learn.microsoft.com/en-us/windows/security/application-security/application-control/windows-defender-application-control/wdac-and-applocker-overview#windows-defender-application-control">Windows Defender Application Control (WDAC)</a></p></li></ul></li></ul><p></p><h2>Step 2: Identify Sacrificial Process</h2><p>Next, the attacker needs to identify a process to inject code into. While code can be reflectively loaded into the stager itself (the local process), attackers often use remote process injection to better mask execution and masquerade as a legitimate process. For stability reasons, many opt to create the desired remote process and spawn it at runtime, rather than potentially crashing an existing live process. Then, attackers (usually) need to acquire a handle for the target process to perform virtual memory operations in the context of the remote address space. So, what telemetry sources do defenders have for these actions?</p><p>Since most EDRs operate using a kernel-mode driver, they can register a set of custom kernel callback routines to get notified whenever certain actions take place. For example, EDRs can utilize the <code>PsSetCreateProcessNotifyRoutine*</code> family of functions to register a callback that is invoked whenever a process is created<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. An EDR can use this notification as an opportunity to inject a hooking library into the new process, as a source of telemetry for certain sensitive API calls. Additionally, <code>ObRegisterCallbacks()</code> can be used to register a callback routine for thread, process, and desktop handle operations. On its own, these behaviors are usually not enough to trigger an alert. However, when combined with other indicators, the general process injection flow becomes clearer.</p><h4>Relevant Security Controls:</h4><ul><li><p>Windows Kernel Callback Functions</p><ul><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-pssetcreateprocessnotifyroutine">PsSetCreateProcessNotifyRoutine()</a></p></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-pssetcreateprocessnotifyroutineex">PsSetCreateProcessNotifyRoutineEx()</a></p></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-pssetcreateprocessnotifyroutineex2">PsSetCreateProcessNotifyRoutineEx2()</a></p></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-pssetloadimagenotifyroutine">PsSetLoadImageNotifyRoutine()</a></p></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-pssetloadimagenotifyroutineex">PsSetLoadImageNotifyRoutineEx()</a></p></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-obregistercallbacks">ObRegisterCallbacks()</a></p></li></ul></li></ul><p></p><h2>Step 3: Allocate Virtual Memory</h2><p>Depending on the injection method, memory usually needs to be explicitly allocated before shellcode can be written and executed. Windows provides several different memory allocation methods, each with slightly different functionality. </p><p>To allocate memory on the heap,<code> HeapAlloc()</code> or one of its wrappers (<code> GlobalAlloc() </code>and<code> LocalAlloc()</code> ) can be used. Today, these wrapper functions are functionally equivalent and remain as artifacts from the <a href="https://devblogs.microsoft.com/oldnewthing/20041101-00/?p=37433">old days of 16-bit Windows</a>. The C runtime (CRT) provides<code> malloc() </code>and<code> new</code>, but they also internally call<code> HeapAlloc()</code>. For COM-aware allocations, <code>CoTaskMemAlloc() </code>or<code> IMalloc::Alloc() </code>with an OLE memory allocator can be used.<code> VirtualAlloc() </code>and<code> VirtualAllocEx() </code>are similar, but align allocations to page granularity (usually 64KB) and round up the length to the minimum page size (typically 4KB). </p><p>Despite the multitude of different options, most are simply wrappers and end up calling the same low-level implementations (as shown in this example call stack):</p><p><code>kernel32!VirtualAlloc()</code></p><p>&#9;<code>&#8627;</code> <code>kernel32!VirtualAllocEx()</code></p><p>&#9;&#9;<code>&#8627;</code> <code>ntdll!NtAllocateVirtualMemory()</code></p><p>Another important distinction for the <code>VirtualAlloc*</code> family of functions is that, by default, they (along with the <code>NtAllocateVirtualMemory()</code> NT API syscall) will treat executable pages as valid indirect call targets for <a href="https://learn.microsoft.com/en-us/windows/win32/secbp/control-flow-guard">Control Flow Guard (CFG)</a>. CFG, which is Microsoft's implementation of <a href="https://dl.acm.org/doi/pdf/10.1145/3054924">Control Flow Integrity (CFI)</a>, is an exploit mitigation feature designed to restrict arbitrary code execution by validating call targets using a bitmap. It is worth noting that CFG is only designed to limit exploitation of memory corruption vulnerabilities, as Microsoft exposes the <code>SetProcessValidCallTargets()</code> API for programs to manually designate call targets as valid or not. </p><p>Additionally, with the widespread adoption of <a href="https://learn.microsoft.com/en-us/windows/win32/memory/data-execution-prevention">Data Execution Prevention (DEP)</a>, stack and heap allocations are often automatically marked as non-executable in their corresponding page table entry (PTE) control bits. </p><p></p><h4>3.1 Hooking and Syscalls</h4><p>One way that EDRs can get telemetry from allocation events is via usermode (ring 3) API hooks. Once an EDR is notified of a new process creation, it can inject its hooking library and detour functions by overwriting their function body in memory. This strategy is known as an inline hook, but there are many other methods that could be employed as well, such as import address table (IAT) hooking or previously system service dispatch table (SSDT) hooking. AV and EDR vendors used to more readily patch kernel memory, but this led to system instability and insecure implementations. With the introduction of  <a href="https://web.archive.org/web/20061124094344/http://blogs.msdn.com/windowsvistasecurity/archive/2006/08/11/695993.aspx">Kernel Patch Protection (KPP / PatchGuard)</a> in Windows XP, security vendors have now been forced to migrate their hooks to usermode instead.</p><p>Using native system services routines (syscalls) instead of their corresponding WinAPI wrappers can bypass some high-level hooks, but they can ultimately be scrutinized by an EDR just as easily. If an adversary directly executes a syscall stub (from the exported function in<code> ntdll.dll</code>), the stub could be hooked just like any other function. Additionally, the EDR can analyze the call stack during execution of the syscall and see that it directly returns to user code (instead of through the normal wrappers), which is a high fidelity indicator of malicious activity. Some attackers may choose to embed custom syscall stubs inside an implant to bypass inline hooks. These stubs consist of a short function prologue in Assembly that sets up the required registers ( <code>mov rax, &lt;SSN&gt;; mov r10, rcx</code> ) before executing a system call. They have the added overhead of having to manually recover the system service number (SSN) of the desired syscall, in order to properly set the RAX register. If these stubs perform "direct" sycalls, by directly using the <code>syscall</code> instruction, then they can actually be caught by a simple static indicator. Only internal Windows libraries implement syscalls, so any other user binary with the <code>syscall</code> instruction ( <code>0x0F 0x05</code> ) in its <code>.text</code> section is likely to be malicious. Some attackers implement "indirect" syscalls, which jump to the address of a <code>syscall</code> instruction in <code>ntdll.dll</code>. While these stubs may bypass static analysis, they can still be caught using call stack analysis at runtime. Using Windows' internal instrumentation engine, EDRs can register a callback for the transition from kernel to user mode (by setting the<code> KPROCESS!InstrumentationCallback </code>field). Once the callback is invoked, the EDR can analyze the context for each syscall and check the RIP to determine if it is legitimate or not. Unless the call stack is artificially legitimized and spoofed (e.g. by using ROP gadgets or <a href="https://github.com/Dec0ne/HWSyscalls">hardware breakpoints</a>), then the syscall will still return directly back to user code and appear anomalous. </p><p></p><h4>3.2 ETW</h4><p>An alternative approach taken by some malware authors is to launch the sacrificial process in a suspended state, in an effort to beat the EDR before its hooks can be fully initialized (<a href="https://attack.mitre.org/techniques/T1055/012">Process Hollowing [T1055.012]</a>). However, using <a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-">Event Tracing for Windows (ETW)</a>, EDR vendors can tap into the Threat-Intelligence (TI) log provider to receive telemetry without relying on hooking.</p><p>This provider generates several relevant events:</p><ul><li><p><code>THREATINT_ALLOCVM_LOCAL</code></p></li><li><p><code>THREATINT_ALLOCVM_REMOTE</code></p></li><li><p><code>THREATINT_FREEZE_PROCESS</code></p></li><li><p><code>THREATINT_MAPVIEW_LOCAL</code></p></li><li><p><code>THREATINT_MAPVIEW_REMOTE</code></p></li><li><p><code>THREATINT_RESUME_PROCESS</code></p></li><li><p><code>THREATINT_RESUME_THREAD</code></p></li><li><p><code>THREATINT_SUSPEND_PROCESS</code></p></li><li><p><code>THREATINT_SUSPEND_THREAD</code></p></li><li><p><code>THREATINT_THAW_PROCESS</code></p></li><li><p>&#8230;</p></li></ul><p>While ETW largely operates at the kernel-level, some events are sent from userland via <code>ntdll!EtwEventWrite()</code>. As a result, implants may patch this function in memory to disable some ETW providers. However, telemetry from ETW can be used to detect this tampering (via the <code>THREATINT_PROTECTVM*</code> and <code>THREATINT_WRITEVM*</code> events), which may actually increase the chances of detection. In some cases, attempting to unhook or disable security controls unintentionally results in an increased likelihood of detection. In social psychology, this is known as the <a href="https://en.wikipedia.org/wiki/Boomerang_effect_(psychology)">boomerang effect</a>.</p><p></p><p>Now, back to memory allocation. Since EDRs have plenty of data surrounding explicit allocation, one alternative is to perform actions that have the side effect of allocating memory, like sending messages to a graphical window message queue (<a href="https://web.archive.org/web/20060904080018/http://security.tombom.co.uk/shatter.html">Shatter Attacks</a>), or stuffing shellcode into the environment strings of a child process. Other techniques, such as enumerating existing <code>PAGE_EXECUTE_READWRITE</code> protected memory pages (<a href="https://www.securityjoes.com/post/process-mockingjay-echoing-rwx-in-userland-to-achieve-code-execution">Mockingjay</a>), overwriting linker padding in a PE (<a href="https://unprotect.it/technique/code-cave">Code Cave</a>), or abusing the shared Extra Window Memory region of Explorer's tray window (<a href="https://attack.mitre.org/techniques/T1055/011">Extra Window Memory Injection [T1055.011]</a>), can even take advantage of existing memory without the need to explicitly allocate it. These techniques are much more difficult to atomically detect since they depart from the normal process injection paradigm. From a defensive perspective, allocation events by themselves present far too much noise to be a reliable indicator of process injection. But, they can help paint a full picture, especially when using temporal correlation to observe and link other injection steps.</p><h4>Relevant Security Controls:</h4><ul><li><p>API Hooking</p><ul><li><p><a href="https://www.ired.team/offensive-security/defense-evasion/bypassing-cylance-and-other-avs-edrs-by-unhooking-windows-apis">Inline Hooks</a></p></li><li><p><a href="https://www.ired.team/offensive-security/code-injection-process-injection/import-adress-table-iat-hooking">IAT Hooks</a></p></li></ul></li><li><p>Call Stack Analysis</p><ul><li><p><a href="https://winternl.com/detecting-manual-syscalls-from-user-mode">Process Instrumentation Callback</a></p></li></ul></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-">Event Tracing for Windows (ETW)</a></p><ul><li><p>Microsoft Threat Intelligence (ETW-TI)</p><ul><li><p><code>THREATINT_ALLOCVM_LOCAL</code></p></li><li><p><code>THREATINT_ALLOCVM_REMOTE</code></p></li><li><p><code>THREATINT_MAPVIEW_LOCAL</code></p></li><li><p><code>THREATINT_MAPVIEW_REMOTE</code></p></li></ul></li></ul></li></ul><p></p><h2>Step 4: Write Virtual Memory</h2><p>After suitable memory has been identified and/or allocated, the payload can be written. This is usually performed using<code> WriteProcessMemory()</code> or its NT API equivalent,<code> NtWriteVirtualMemory()</code>.  While most loaders simply use <code>PAGE_EXECUTE_READWRITE </code>protected memory pages,<code> PAGE_READWRITE </code>can also be used if the protection is changed after the data is written (using either <code>VirtualProtect()</code> or<code> NtProtectVirtualMemory()</code> ). </p><p>Most of the same telemetry sources are applicable from the previous section. Using the ETW-TI provider, EDRs have visibility into memory writes as well as protection modifications via <code>THREATINT_WRITEVM*</code> and <code>THREATINT_PROTECTVM*</code> events. But, before discussing specific detection mechanisms, it&#8217;s important to understand the different types of memory first.</p><p>On Windows systems, memory can be marked as any of the following:</p><ul><li><p><code>MEM_FREE</code></p><ul><li><p>Unused physical memory</p></li></ul></li><li><p><code>MEM_RESERVE</code></p><ul><li><p>Virtual memory that has been reserved for future use</p></li></ul></li><li><p><code>MEM_COMMIT</code></p><ul><li><p>Virtual memory that has been committed and assigned physical storage</p></li></ul></li><li><p><code>MEM_PRIVATE</code></p><ul><li><p>Private memory that is not shared between processes</p></li></ul></li><li><p><code>MEM_MAPPED</code></p><ul><li><p>Shared memory that is mapped into the view of a section object</p></li></ul></li><li><p><code>MEM_IMAGE</code></p><ul><li><p>Shared memory that is mapped into the view of an image section object</p><p></p></li></ul></li></ul><p>For now, we will ignore the first 3 since we're more interested in the type of memory rather than it's current state. Most dynamically allocated memory, like those resulting from the previously mentioned allocation functions, typically falls under the category of private memory. Consequently, it is almost always protected as <code>PAGE_READWRITE</code>, which aligns with its usage as stack and heap storage. Private memory is rarely ever marked as executable, with the exception of JIT compilers in a web browser or .NET Framework Common Language Runtime (CLR) allocations. Mapped memory, on the other hand, often originates from a file on disk via<code> CreateFileMappingA()</code> or<code> NtCreateSection()</code>. After using these functions to create a shared mapping/section object, a process can map a view of the section using<code> MapViewOfFile()</code> or<code> NtMapViewOfSection()</code> to interact with its contents. If the mapping object is backed specifically by an executable file and was created using the<code> SEC_IMAGE </code>flag, then subsequent views are marked as <code>MEM_IMAGE</code> regions instead of<code> MEM_MAPPED</code>. Since <code>MEM_IMAGE</code> regions originate from an executable file on disk, page protections for these views are determined by the PE itself from the permissions listed in the <a href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#section-table-section-headers">section table</a>. Naturally,<code> MEM_IMAGE </code>blocks receive the least amount of scrutiny, since their contents were likely already scanned by AV on disk. </p><p>Since image section views are usually where executable code resides, what's stopping an attacker from overwriting it with shellcode? The answer lies in a mechanism called "copy-on-write". When a DLL is mapped into memory, Windows employs a resource sharing technique called "copy-on-write" to optimize memory management. Subsequent loads of the same file will be backed by the same shared memory pages, with a transparent "copy" made if a process tries to modify the shared region. The original page remains unmodified, while Windows creates a private copy of the page for the process to write to. This reduces overhead and avoids unnecessary duplication of unmodified pages across multiple processes. Since executable code segments are marked as<code> PAGE_EXECUTE_WRITECOPY</code>, once an attacker modifies the page, the <strong>Shared</strong> bit in that page's extended working set information will be cleared<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>. This detection methodology (unshared<code> MEM_MAPPED </code>or<code> MEM_IMAGE </code>pages) can also be used to detect hooks and other memory patching, like disabling ETW. </p><p>One injection technique that works around these limitations is <a href="https://attack.mitre.org/techniques/T1055/013">Process Doppelg&#228;nging [T1055.013]</a> / <a href="https://www.forrest-orr.net/post/malicious-memory-artifacts-part-i-dll-hollowing">Phantom DLL Hollowing</a>. This technique abuses <a href="https://learn.microsoft.com/en-us/windows/win32/fileio/transactional-ntfs-portal">transactional NTFS (TxF)</a> by opening an isolated file handle to alter the <code>.text</code> section of a DLL. This is done without ever flushing the changes back to disk, and occurs before the view is mapped into memory, making detection much more difficult. However, due to the isolation provided by the TxF transaction, this technique has the unique side effect causing calls to <code>GetMappedFileNameW()</code> to fail when attempting to query the name of the file associated with the image region. Additionally, the <code>MmDoesFileHaveUserWritableReferences() </code>function can be used by an EDR to determine if there are any writable references to the file object of a section (broken section coherency). </p><p>Other detection logic is largely focused on private memory. Using the data sources described earlier, EDRs have visibility into the parameters passed to memory management functions. This is sufficient to cover certain anomalous behaviors, like private RWX allocation or fluctuating memory protections (RW &#8644; RX). Contextual behaviors like these can elevate a process' risk score, and trigger further investigation. One such investigative tool is memory scanning. Since full memory scanning is far too resource intensive, EDRs often rely on event-triggered scans. For example, an EDR could choose to scan the buffer being written to memory if the pages being written to are executable. These scans can be used to detect <a href="https://attack.mitre.org/techniques/T1055/002">PE Injection [T1055.002]</a> by searching for a PE header ( <code>MZ</code> ) found in private memory, which indicates that an executable file was loaded in an abnormal way (and not via <code>LoadLibrary()</code>). Another potential indicator is buffer size. As noted in the previous section, <code>VirtualAlloc()</code> rounds the allocation up to the minimum page size. Since most programs don't need to write large chunks of memory to a remote process, the vast majority of legitimate remote memory operations are performed on a single page. Shellcode, on the other hand, can be much larger &#8212; especially when using an off-the-shelf framework like Metasploit or Cobalt Strike. </p><h4>Relevant Security Controls:</h4><ul><li><p>API Hooking</p><ul><li><p><a href="https://www.ired.team/offensive-security/defense-evasion/bypassing-cylance-and-other-avs-edrs-by-unhooking-windows-apis">Inline Hooks</a></p></li><li><p><a href="https://www.ired.team/offensive-security/code-injection-process-injection/import-adress-table-iat-hooking">IAT Hooks</a></p></li></ul></li><li><p>Call Stack Analysis</p><ul><li><p><a href="https://winternl.com/detecting-manual-syscalls-from-user-mode">Process Instrumentation Callback</a></p></li></ul></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-">Event Tracing for Windows (ETW)</a></p><ul><li><p>Microsoft Threat Intelligence (ETW-TI)</p><ul><li><p><code>THREATINT_PROTECTVM_LOCAL</code></p></li><li><p><code>THREATINT_PROTECTVM_REMOTE</code></p></li><li><p><code>THREATINT_WRITEVM_LOCAL</code></p></li><li><p><code>THREATINT_WRITEVM_REMOTE</code></p></li></ul></li></ul></li></ul><p></p><h2>Step 5: Execute Payload</h2><p>After staging the payload in memory, the final step is to trigger execution. There's a wide variety of execution primitives, with the most common being <code>CreateRemoteThread() </code>/<code> RtlCreateUserThread() </code>/<code> NtCreateThreadEx()</code>. These functions simply create and insert a new thread into the target process, with the specified starting address. In a "classic" <a href="https://attack.mitre.org/techniques/T1055/001">DLL Injection [T1055.001]</a>,<code> LoadLibraryA()</code> is used as the starting address. Using the <code>PsSetCreateThreadNotifyRoutine </code>kernel callback, these techniques can be detected by determining if the starting address points to private memory or a suspicious trampoline function. </p><p>Another method is to hijack the state of an existing thread using the <code>SetThreadContext()</code> API (<a href="https://attack.mitre.org/techniques/T1055/003">Thread Execution Hijacking [T1055.003]</a>). This function modifies the register state (context) of a suspended thread, and can be used to redirect execution flow by directly setting the RIP register. However, it is primarily only used by debuggers and can be caught using API hooks or<code> THREATINT_SETTHREADCONTEXT_REMOTE </code>ETW-TI events.</p><p>Existing threads can also be used to execute an asynchronous procedure call (APC) by using<code> QueueUserAPC() </code>or<code> NtQueueApcThread()</code> to insert a user-mode APC object into the thread&#8217;s APC queue (<a href="https://attack.mitre.org/techniques/T1055/004">Asynchronous Procedure Call [T1055.004]</a>). This will cause the thread to execute the specified APC the next time it enters an alertable state. ETW-TI also provides visibility into these events via <code>THREATINT_QUEUEUSERAPC_REMOTE</code> logs.</p><p>Message hook functions, like <code>SetWindowsHookEx()</code> or <code>NtUserSetWindowsHookEx()</code>, are yet another option. These functions install a custom hook procedure into the hook chain, which triggers execution whenever the specified<code> WH_* </code>event occurs<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>. Due to their widespread abuse by keyloggers, defensive tooling often has the capability to detect suspicious message hooks by enumerating<code> gSharedInfo </code>members, performing API hooking, or even keeping a stateful list to determine anomalies<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a>.</p><p>Lastly, a large class of injection methods involve overwriting a pointer to code (often a callback). These methods take advantage of the fact that many pointers to code are stored in writable memory, and overwriting these pointers can redirect the execution flow to arbitrary locations when the callback is triggered. This includes attacks that abuse Window subclassing (<a href="https://modexp.wordpress.com/2018/08/23/process-injection-propagate">PROPagate</a>), window message handlers (<a href="https://modexp.wordpress.com/2018/09/12/process-injection-user-data">ConsoleWindowClass</a>), PE entry points (<a href="https://bohops.com/2023/06/09/no-alloc-no-problem-leveraging-program-entry-points-for-process-injection">AddressOfEntryPoint</a>), thread local storage (TLS) callbacks (<a href="https://attack.mitre.org/techniques/T1055/005">Thread Local Storage [T1055.005]</a>), control signal handler callbacks (<a href="https://unprotect.it/technique/ctrlinject">Ctrl-Inject</a>), the <a href="https://modexp.wordpress.com/2019/05/25/windows-injection-finspy">KernelCallbackTable</a> PEB member, and many many more. While there's an almost innumerable amount of execution primitives, most can be detected using a combination of API hooking, validating the target address of a remote memory writes, as well as monitoring new threads that originate from unbacked memory. </p><h4>Relevant Security Controls:</h4><ul><li><p>API Hooking</p><ul><li><p><a href="https://www.ired.team/offensive-security/defense-evasion/bypassing-cylance-and-other-avs-edrs-by-unhooking-windows-apis">Inline Hooks</a></p></li><li><p><a href="https://www.ired.team/offensive-security/code-injection-process-injection/import-adress-table-iat-hooking">IAT Hooks</a></p></li></ul></li><li><p>Call Stack Analysis</p><ul><li><p><a href="https://winternl.com/detecting-manual-syscalls-from-user-mode">Process Instrumentation Callback</a></p></li></ul></li><li><p><a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-">Event Tracing for Windows (ETW)</a></p><ul><li><p>Microsoft Threat Intelligence (ETW-TI)</p><ul><li><p><code>THREATINT_PROTECTVM_LOCAL</code></p></li><li><p><code>THREATINT_PROTECTVM_REMOTE</code></p></li><li><p><code>THREATINT_QUEUEUSERAPC_REMOTE</code></p></li><li><p><code>THREATINT_READVM_REMOTE</code></p></li><li><p><code>THREATINT_SETTHREADCONTEXT_REMOTE</code></p></li><li><p><code>THREATINT_WRITEVM_LOCAL</code></p></li><li><p><code>THREATINT_WRITEVM_REMOTE</code></p></li></ul></li></ul></li><li><p><a href="https://attack.mitre.org/mitigations/M1050">Exploit Protection [M1050]</a></p><ul><li><p><a href="https://dl.acm.org/doi/pdf/10.1145/3054924">Control Flow Integrity (CFI)</a></p><ul><li><p><a href="https://learn.microsoft.com/en-us/windows/win32/secbp/control-flow-guard">Control Flow Guard (CFG)</a></p></li></ul></li><li><p><a href="https://learn.microsoft.com/en-us/windows/win32/memory/data-execution-prevention">Data Execution Prevention (DEP)</a></p></li></ul></li><li><p>Windows Kernel Callback Functions</p><ul><li><p><code>PsSetCreateThreadNotifyRoutine</code></p></li><li><p><code>PsSetCreateThreadNotifyRoutineEx</code></p><p></p></li></ul></li></ul><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><em>Technically</em>, this callback isn't invoked until the first thread is created and inserted into the process, see <a href="https://www.microsoft.com/en-us/security/blog/2022/06/30/using-process-creation-properties-to-catch-evasion-techniques">NtCreateProcessEx()</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualquery#remarks</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p>https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowshookexa#parameters</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p>https://github.com/rajiv2790/FalconEye</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Mapping Windows Audit Log Settings to MITRE Data Sources for Rabobank-CDC DeTT&CT]]></title><description><![CDATA[Use the DeTT&CT framework to assess TTP coverage, perform gap analysis, and prioritize detection engineering efforts]]></description><link>https://blog.blacklanternsecurity.com/p/mapping-windows-audit-log-settings</link><guid isPermaLink="false">https://blog.blacklanternsecurity.com/p/mapping-windows-audit-log-settings</guid><dc:creator><![CDATA[Philip Hartlieb]]></dc:creator><pubDate>Wed, 05 Oct 2022 14:35:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!tq5g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>References</h2><ol><li><p>https://attack.mitre.org/</p></li><li><p>https://github.com/rabobank-cdc/DeTTECT</p></li><li><p>https://github.com/rabobank-cdc/DeTTECT/wiki/Data-quality</p></li><li><p>https://github.com/rabobank-cdc/DeTTECT/wiki/Visibility-scoring</p></li><li><p>https://github.com/rabobank-cdc/DeTTECT/wiki/Detection-scoring</p></li><li><p>https://mitre-attack.github.io/attack-navigator/</p></li><li><p>https://rabobank-cdc.github.io/dettect-editor</p></li><li><p>https://github.com/blacklanternsecurity/blue-resources/blob/main/Windows_MITRE_Data_Source_Mapping.xlsx</p></li></ol><div><hr></div><p>One of the objectives for the initial phase of a risk assessment is to identify and analyze critical business workflows, as well as the IT assets and personnel that support them. Keep in mind that these workflows may not even be IT-specific. For example, consider the workflows associated with accounts payable, accounts receivable, vendor management, and treasury operations. What's important to understand is that critical workflows have the greatest potential risk. A successful attack on the IT assets, personnel, or data that support these workflows would result in significant negative impacts to the organization. The impact to an organization can be reduced by ensuring that critical IT assets and personnel are adequately defended. Administrative-, network-, host-, and email-based security controls can be strategically deployed to defend critical assets, personnel, and the workflows that they support.</p><p>In the event of an incident or breach, it is equally important to ensure that the data sources these security controls rely on are available, accurate, and provide the required fidelity. For example, if the aim is to detect and alert on brute force login attempts and the target server is not configured to log failed login attempts, then it will be incredibly difficult to detect the attack and isolate the attacker. An easy mental checklist might be: </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.blacklanternsecurity.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Black Lantern Security (BLSOPS)! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ol><li><p>Is the activity visible in your environment and does it generate any logging artifacts?</p></li><li><p>If so, where is the event being logged? What is the data source for that event? </p></li><li><p>Are the logs for that data source being shipped to a SIEM or centralized log management solution? </p></li><li><p>If so, is there an alert being generated when executing the attack? </p></li><li><p>Finally, are SOC analysts triaging the alert based on criticality?</p></li></ol><p>This approach quickly becomes more complicated and resource-intensive as more and more attacks are considered. The MITRE Enterprise ATT&amp;CK matrix currently includes 14 tactics, 191 techniques, and 385 sub-techniques. "MITRE ATT&amp;CK&#174; is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations. The ATT&amp;CK knowledge base is used as a foundation for the development of specific threat models and methodologies in the private sector, in government, and in the cybersecurity product and service community." <a href="https://attack.mitre.org/">[1]</a></p><p>As a defender, a primary concern might be how much "coverage" an organization has for the tactics, techniques, and procedures (TTPs) detailed in the MITRE ATT&amp;CK matrix. That is, based on existing security controls and data sources, what percentage of TTPs can I potentially detect? To make it easier for defenders to determine their current "coverage" for MITRE ATT&amp;CK TTPs, the DeTT&amp;CT <a href="https://github.com/rabobank-cdc/DeTTECT">[2]</a> project has mapped attacker (sub)techniques to the data sources that should capture specific attacker activities. Therefore, as a first approximation, if a defender has one or more data sources configured and available, then they have the "potential" to detect the (sub)techniques that map to those data sources. Going from a potential detection to an actual detection depends on the completeness and quality of the data contained in each data source, as well as the number of data sources that could potentially capture activity surrounding a TTP.</p><p>The DeTT&amp;CT framework provides defenders with a means to specify and score: - Data Sources - Data Quality - Visibility - Detection</p><p>Data quality is scored based on "device completeness, data field completeness, timeliness, consistency and retention" <a href="https://github.com/rabobank-cdc/DeTTECT/wiki/Data-quality">[3]</a>. Visibility scores will depend on how many aspects of the attacker (sub)technique can be captured <a href="https://github.com/rabobank-cdc/DeTTECT/wiki/Visibility-scoring">[4]</a>. Theoretically, multiple high quality data sources should be configured for each (sub)technique. A Detection will be scored based on multiple factors including, timing, (sub)technique coverage, opportunities to bypass, false negatives, and false positives <a href="https://github.com/rabobank-cdc/DeTTECT/wiki/Detection-scoring">[5]</a>. Data Source, Data Quality, Visibility, and Detection metrics can be visualized as ATT&amp;CK Navigator layer files <a href="https://mitre-attack.github.io/attack-navigator/">[6]</a> that serve to illustrate an organization&#8217;s defensive posture. Establishing and increasing an organization's coverage is a continuous and resource-intensive process.</p><p>For the purposes of this post, the objective will be to generate a simple ATT&amp;CK Navigator layer file that a defender can use to illustrate MITRE ATT&amp;CK coverage for Windows systems based on data sources alone; data quality, visibility, and detections will not be considered for now. This basic coverage data can then be used as an input for assessing organizational risk.</p><p>The primary inputs for the MITRE Navigator file are the data sources that are available within the organization. However, the Rabobank-CDC DeTT&amp;CT framework doesn't map the data sources to well known Windows Event Logs. In this case, it's left to the analyst to perform that mapping by hand. To that end, Adeem Mawani and Brian O'Hara have created a helpful worksheet published in the BLS Blue Team Resources <a href="https://github.com/blacklanternsecurity/blue-resources/blob/main/Windows_MITRE_Data_Source_Mapping.xlsx">Github repository [8]</a>. The worksheet details each Windows Advanced Audit Log Setting and then maps that setting and its corresponding Windows Event IDs to its MITRE data source. Each entry includes: </p><ul><li><p>Category </p></li><li><p>Subcategory </p></li><li><p>Default configuration</p></li><li><p>Baseline configuration recommendations</p></li><li><p>Conditions (success/failure) </p></li><li><p>MITRE data source name</p></li><li><p>MITRE data source ID</p></li><li><p>Windows event ID </p></li><li><p>Windows event description</p></li></ul><p>The intention is to provide the analyst with a rubric for mapping the output of the <code>auditpol</code> command to actual MITRE data sources. Armed with a list of MITRE data sources, the MITRE Navigator layer file can be created. The end result is a map of "potential" coverage for MITRE ATT&amp;CK TTP's based on available data sources.</p><div><hr></div><ol><li><p>The <a href="https://rabobank-cdc.github.io/dettect-editor">DeTT&amp;CT Editor [7]</a> is publicly hosted or can be run locally using:</p></li></ol><pre><code><code>python dettect.py editor</code></code></pre><p></p><ol start="2"><li><p>In the editor, create a new YAML file to store your available data sources: </p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tq5g!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tq5g!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 424w, https://substackcdn.com/image/fetch/$s_!tq5g!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 848w, https://substackcdn.com/image/fetch/$s_!tq5g!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 1272w, https://substackcdn.com/image/fetch/$s_!tq5g!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tq5g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png" width="1456" height="883" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/b1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:883,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:264507,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tq5g!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 424w, https://substackcdn.com/image/fetch/$s_!tq5g!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 848w, https://substackcdn.com/image/fetch/$s_!tq5g!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 1272w, https://substackcdn.com/image/fetch/$s_!tq5g!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1cee2ad-a259-4f9f-bb29-781dce56a6bd_2232x1353.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div></li></ol><p></p><ol start="2"><li><p>Determine available data sources in your environment. For example, by using the published worksheet to map data sources to Windows audit log configurations:</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qn63!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qn63!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 424w, https://substackcdn.com/image/fetch/$s_!Qn63!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 848w, https://substackcdn.com/image/fetch/$s_!Qn63!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 1272w, https://substackcdn.com/image/fetch/$s_!Qn63!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qn63!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png" width="1456" height="199" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:199,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142901,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Qn63!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 424w, https://substackcdn.com/image/fetch/$s_!Qn63!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 848w, https://substackcdn.com/image/fetch/$s_!Qn63!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 1272w, https://substackcdn.com/image/fetch/$s_!Qn63!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F082be7b8-556f-479e-b296-73f30e5385ae_3364x459.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p></li><li><p>Add applicable data sources using the interface at the bottom of the page:</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VF7e!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VF7e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 424w, https://substackcdn.com/image/fetch/$s_!VF7e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 848w, https://substackcdn.com/image/fetch/$s_!VF7e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 1272w, https://substackcdn.com/image/fetch/$s_!VF7e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VF7e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png" width="1456" height="378" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:378,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:657576,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VF7e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 424w, https://substackcdn.com/image/fetch/$s_!VF7e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 848w, https://substackcdn.com/image/fetch/$s_!VF7e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 1272w, https://substackcdn.com/image/fetch/$s_!VF7e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F14de26fd-d231-4d5c-82fa-59e7456ef5a1_3151x818.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p></li><li><p>Click "<strong>Save YAML file</strong>" to export your data sources</p><p></p></li><li><p>Run the following command to generate a navigator layer file using the exported YAML:</p></li></ol><pre><code><code>python dettect.py ds -fd data-sources.yaml -l</code></code></pre><ol start="6"><li><p>View the ATT&amp;CK Navigator using the following link to disable yellow underlines: <a href="https://mitre-attack.github.io/attack-navigator/#comment_underline=false">https://mitre-attack.github.io/attack-navigator/#comment_underline=false</a></p><p></p></li><li><p>In Navigator, click "<strong>Open Existing Layer</strong>" and open the exported JSON layer file created from earlier. </p><p></p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rk6w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rk6w!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 424w, https://substackcdn.com/image/fetch/$s_!Rk6w!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 848w, https://substackcdn.com/image/fetch/$s_!Rk6w!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 1272w, https://substackcdn.com/image/fetch/$s_!Rk6w!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rk6w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png" width="1456" height="655" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/f00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:655,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1391275,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rk6w!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 424w, https://substackcdn.com/image/fetch/$s_!Rk6w!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 848w, https://substackcdn.com/image/fetch/$s_!Rk6w!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 1272w, https://substackcdn.com/image/fetch/$s_!Rk6w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Ff00bfb6a-87a6-47d9-9877-e760a706b700_3004x1352.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>An example Navigator layer generated using the DeTT&amp;CT Framework</strong></figcaption></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://blog.blacklanternsecurity.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Black Lantern Security (BLSOPS)! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Detecting LDAP Reconnaissance]]></title><description><![CDATA[Techniques to Identify Active Directory Enumeration]]></description><link>https://blog.blacklanternsecurity.com/p/detecting-ldap-recoannaissance</link><guid isPermaLink="false">https://blog.blacklanternsecurity.com/p/detecting-ldap-recoannaissance</guid><dc:creator><![CDATA[Adeem Mawani]]></dc:creator><pubDate>Mon, 28 Jun 2021 13:30:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_uFU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Overview</h2><p>After gaining a foothold within an organization, threat actors often need to perform internal reconnaissance to discover users, permissions, and other potentially useful resources available. One of the most commonly used methods to achieve this is by gathering data from <a href="https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview">Active Directory</a> in Windows enterprise environments. However, these activities often fly under the radar because attackers are simply (ab)using a legitimate feature.</p><p>Lightweight Directory Access Protocol (LDAP) queries are how clients obtain information from Active Directory. Clients specify a search filter to search for objects, such as users or computers, that match specific criteria. LDAP is used in the background by Windows to lookup and authenticate members of the domain, and has a variety of different use cases. But, since most objects in the directory can be read by <em>any</em> authenticated user, it can be easily abused to collect broad information about every user, group, and system on the domain.</p><h3>MITRE ATT&amp;CK TTPs</h3><ul><li><p><a href="https://attack.mitre.org/techniques/T1069/002">Permission Groups Discovery - Domain Groups (T1069.002)</a></p></li><li><p><a href="https://attack.mitre.org/techniques/T1087/002">Account Discovery - Domain Account (T0187.002)</a></p></li><li><p><a href="https://attack.mitre.org/techniques/T1482/">Domain Trust Discovery (T1482)</a></p></li></ul><h2>Detection Mechanisms</h2><h3>Network Indicators</h3><p>In many environments today, LDAP queries are encrypted in-transit. While encrypting traffic is a great way to prevent eavesdropping, it also makes purely network-based detection difficult. Many current detection techniques look for an anomalous spike in traffic on ports 389 and 636 (LDAP &amp; LDAPS), but determined threat actors can simply slow their collection over a longer time period to avoid this methodology.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WyEn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WyEn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 424w, https://substackcdn.com/image/fetch/$s_!WyEn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 848w, https://substackcdn.com/image/fetch/$s_!WyEn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 1272w, https://substackcdn.com/image/fetch/$s_!WyEn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WyEn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png" width="727" height="178.30776515151516" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/25717075-48a8-4586-bec0-f78a370d783f_1056x259.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:259,&quot;width&quot;:1056,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Anomalous Traffic Spike&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Anomalous Traffic Spike" title="Anomalous Traffic Spike" srcset="https://substackcdn.com/image/fetch/$s_!WyEn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 424w, https://substackcdn.com/image/fetch/$s_!WyEn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 848w, https://substackcdn.com/image/fetch/$s_!WyEn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 1272w, https://substackcdn.com/image/fetch/$s_!WyEn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F25717075-48a8-4586-bec0-f78a370d783f_1056x259.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">A Suspicious Spike in LDAP Traffic</figcaption></figure></div><h3>Canary / Honey Accounts</h3><p>Canary accounts are decoys designed to mimic legitimate accounts and bait attackers into utilizing them. They are never supposed to be used legitimately, so any activity around them can be used as an early warning sign of possible reconnaissance or enumeration activity. Canary accounts also have a very low false positive rate, since they are not normally accessed. However, baselining and whitelisting may still be necessary to rule out legitimate applications that inadvertently interact with the canaries. When deploying canary accounts, it is important to keep in mind that attributes such as a very old last logon time could tip off its existence to threat actors. It is critical to make these accounts &#8220;blend in&#8221;.</p><p>To create a canary object (e.g. user, computer, etc.), use the Active Directory Users and Computers (ADUC) console. Depending upon your use case, apply some of the following properties to the canary:</p><ul><li><p>Set user logon hours to 24/7 deny</p></li><li><p>Periodically update the &#8220;last logged into&#8221; property to make the honey account less obvious</p></li><li><p>Set a service principal name (like &#8220;MSSQLSvc/fqdn&#8221;) to catch potential Kerberoasting activity</p></li><li><p>Toggle &#8220;Do not require Kerberos pre-authentication&#8221; to catch potential AS-REP Roasting</p></li></ul><p>Then, configure auditing for any of the following scenarios by modifying the group policy via:</p><blockquote><p>Group Policy Management -&gt; Default Domain Policy -&gt; Edit</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_uFU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_uFU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 424w, https://substackcdn.com/image/fetch/$s_!_uFU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 848w, https://substackcdn.com/image/fetch/$s_!_uFU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 1272w, https://substackcdn.com/image/fetch/$s_!_uFU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_uFU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png" width="458" height="424" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/e453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:424,&quot;width&quot;:458,&quot;resizeWidth&quot;:458,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Edit Group Policy&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Edit Group Policy" title="Edit Group Policy" srcset="https://substackcdn.com/image/fetch/$s_!_uFU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 424w, https://substackcdn.com/image/fetch/$s_!_uFU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 848w, https://substackcdn.com/image/fetch/$s_!_uFU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 1272w, https://substackcdn.com/image/fetch/$s_!_uFU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe453d6f1-1192-4987-ab43-c912f2b9fbd9_458x424.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><h4>Detect enumeration</h4><p>Event ID <a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4662">4662</a></p><blockquote><p>Computer Configuration -&gt; Policies -&gt; Windows Settings -&gt; Security Settings -&gt; Advanced Audit Policy Configuration -&gt; Audit Policies -&gt; DS Access -&gt; Audit Directory Service Access</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YtFH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YtFH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 424w, https://substackcdn.com/image/fetch/$s_!YtFH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 848w, https://substackcdn.com/image/fetch/$s_!YtFH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 1272w, https://substackcdn.com/image/fetch/$s_!YtFH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YtFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png" width="386" height="324.14102564102564" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/ae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:262,&quot;width&quot;:312,&quot;resizeWidth&quot;:386,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Audit DS Access&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Audit DS Access" title="Audit DS Access" srcset="https://substackcdn.com/image/fetch/$s_!YtFH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 424w, https://substackcdn.com/image/fetch/$s_!YtFH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 848w, https://substackcdn.com/image/fetch/$s_!YtFH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 1272w, https://substackcdn.com/image/fetch/$s_!YtFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fae6a119e-21a3-44cb-a8a8-4b6cf623241f_312x262.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>To detect enumeration, enable Directory Service access logging, and configure auditing for each canary object:</p><ol><li><p>Toggle: &#8220;Active Directory Users and Computers -&gt; View -&gt; Advanced Features&#8221;</p></li><li><p>In the security tab of the canary object&#8217;s properties, click the &#8220;Advanced&#8221; button</p></li><li><p>Under the auditing tab, click the &#8220;Add&#8221; button</p></li><li><p>Set the following properties:</p><ul><li><p>Principal: Everyone</p></li><li><p>Applies to: This object only</p></li><li><p>Permissions: Read all properties</p></li></ul></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kezv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kezv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 424w, https://substackcdn.com/image/fetch/$s_!kezv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 848w, https://substackcdn.com/image/fetch/$s_!kezv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 1272w, https://substackcdn.com/image/fetch/$s_!kezv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kezv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png" width="434" height="593.7810945273632" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:550,&quot;width&quot;:402,&quot;resizeWidth&quot;:434,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Audit Canary Access&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Audit Canary Access" title="Audit Canary Access" srcset="https://substackcdn.com/image/fetch/$s_!kezv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 424w, https://substackcdn.com/image/fetch/$s_!kezv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 848w, https://substackcdn.com/image/fetch/$s_!kezv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 1272w, https://substackcdn.com/image/fetch/$s_!kezv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4d34ebe3-34cc-40e4-979d-5aa108f6eb46_402x550.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Note:</strong> in the resulting events, the Object Name is not translated from its GUID</p><h4>Detect Canary Account Login Attempts</h4><p>Event ID <a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4768">4768</a> (or <a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4625">4625</a>)</p><blockquote><p>Computer Configuration -&gt; Policies -&gt; Windows Settings -&gt; Security Settings -&gt; Advanced Audit Policy Configuration -&gt; Audit Policies -&gt; Account Logon -&gt; Audit Kerberos Authentication Services</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G-se!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G-se!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 424w, https://substackcdn.com/image/fetch/$s_!G-se!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 848w, https://substackcdn.com/image/fetch/$s_!G-se!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 1272w, https://substackcdn.com/image/fetch/$s_!G-se!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G-se!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png" width="346" height="260.60897435897436" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:235,&quot;width&quot;:312,&quot;resizeWidth&quot;:346,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Audit Kerberos Authentication&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Audit Kerberos Authentication" title="Audit Kerberos Authentication" srcset="https://substackcdn.com/image/fetch/$s_!G-se!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 424w, https://substackcdn.com/image/fetch/$s_!G-se!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 848w, https://substackcdn.com/image/fetch/$s_!G-se!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 1272w, https://substackcdn.com/image/fetch/$s_!G-se!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F0dbe7447-d11e-4634-b931-3f4a5e076ec7_312x235.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This will record all failed Kerberos authentication attempts, so filter events accordingly based on the canary name in the &#8220;TargetUserName&#8221; field.</p><h4>Audit Kerberos TGS Requests</h4><p>Event ID <a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4769">4769</a></p><blockquote><p>Computer Configuration -&gt; Policies -&gt; Windows Settings -&gt; Security Settings -&gt; Advanced Audit Policy Configuration -&gt; Audit Policies -&gt; Account Logon -&gt; Audit Kerberos Service Ticket Operations</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6FXW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6FXW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 424w, https://substackcdn.com/image/fetch/$s_!6FXW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 848w, https://substackcdn.com/image/fetch/$s_!6FXW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 1272w, https://substackcdn.com/image/fetch/$s_!6FXW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6FXW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png" width="343" height="253.7111111111111" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:233,&quot;width&quot;:315,&quot;resizeWidth&quot;:343,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Audit Kerberos TGS&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Audit Kerberos TGS" title="Audit Kerberos TGS" srcset="https://substackcdn.com/image/fetch/$s_!6FXW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 424w, https://substackcdn.com/image/fetch/$s_!6FXW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 848w, https://substackcdn.com/image/fetch/$s_!6FXW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 1272w, https://substackcdn.com/image/fetch/$s_!6FXW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ee57bc-4d1f-4f03-90d6-c5c740847dfa_315x233.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>To detect potential <a href="https://attack.mitre.org/techniques/T1558/003/">Kerberoasting</a> attempts on your canary object, configure logging for service ticket requests.</p><p><strong>Note:</strong> this generates a huge amount of noise, so before forwarding to a SIEM, filter logs based on:</p><ul><li><p>RC4 or DES Encryption (Ticket Encryption: 0x17) OR (Ticket Encryption: 0x1 OR 0x2 OR 0x3)</p></li><li><p>Canary name in the &#8220;Service Name&#8221; field</p></li></ul><h3>Host-Based Detection</h3><p>The highest-fidelity detection can be achieved by logging sent LDAP queries at the host level. All LDAP queries could be logged on the Domain Controller (DC) itself, but this often leads to performance issues. A typical DC generates huge amounts of data as LDAP queries are part of its primary functionality, thus, it becomes infeasible to collect and store this data directly on the DC in any large enterprise environment. However, by logging queries directly on domain-joined endpoints, the data becomes much more manageable. Host-based logging gives visibility into the searches performed from each endpoint (which is often the pivot point of an attacker), and also provides important context around the data. For example, the PID of the process that sent the query can be captured in this manner. Luckily, this functionality is already built-in to Windows via an Event Tracing for Windows (ETW) log provider. For more information about ETW, check out <a href="https://www.ired.team/miscellaneous-reversing-forensics/windows-kernel-internals/etw-event-tracing-for-windows-101">Event Tracing For Windows 101</a>.</p><p>Enabling this log provider is very simple:</p><pre><code>wevtutil set-log "Microsoft-Windows-LDAP-Client/Debug" /enabled:true /quiet:true /retention:false /maxsize:100032</code></pre><p>Or by using the Event Viewer GUI:</p><ol><li><p>Event Viewer -&gt; View -&gt; Show analytic and debug logs</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zXGn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zXGn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 424w, https://substackcdn.com/image/fetch/$s_!zXGn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 848w, https://substackcdn.com/image/fetch/$s_!zXGn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 1272w, https://substackcdn.com/image/fetch/$s_!zXGn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zXGn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png" width="357" height="119.342939481268" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:116,&quot;width&quot;:347,&quot;resizeWidth&quot;:357,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Show Debug Logs&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Show Debug Logs" title="Show Debug Logs" srcset="https://substackcdn.com/image/fetch/$s_!zXGn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 424w, https://substackcdn.com/image/fetch/$s_!zXGn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 848w, https://substackcdn.com/image/fetch/$s_!zXGn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 1272w, https://substackcdn.com/image/fetch/$s_!zXGn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F55bafe1c-90b0-4339-8872-3085696b0f37_347x116.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div></li><li><p>Enable &#8220;Applications and Services Logs -&gt; Microsoft -&gt; Windows -&gt; LDAP-Client -&gt; Debug&#8221;</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nHKu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nHKu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 424w, https://substackcdn.com/image/fetch/$s_!nHKu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 848w, https://substackcdn.com/image/fetch/$s_!nHKu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 1272w, https://substackcdn.com/image/fetch/$s_!nHKu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nHKu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png" width="404" height="405.0253807106599" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/e9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:395,&quot;width&quot;:394,&quot;resizeWidth&quot;:404,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Enable Debug Log&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Enable Debug Log" title="Enable Debug Log" srcset="https://substackcdn.com/image/fetch/$s_!nHKu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 424w, https://substackcdn.com/image/fetch/$s_!nHKu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 848w, https://substackcdn.com/image/fetch/$s_!nHKu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 1272w, https://substackcdn.com/image/fetch/$s_!nHKu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe9606abb-151c-491c-890e-7eaa0f115bfa_394x395.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p>. Increase the default log size and/or change the event overwrite settings. <strong>Note:</strong> if overwriting is enabled, the Event Viewer will not be able to display entries, but they are still recorded. <a href="https://docs.microsoft.com/en-us/troubleshoot/windows-server/system-management-components/error-when-enabling-analytic-debug-event-log#cause">Source</a></p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4hoi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4hoi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 424w, https://substackcdn.com/image/fetch/$s_!4hoi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 848w, https://substackcdn.com/image/fetch/$s_!4hoi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 1272w, https://substackcdn.com/image/fetch/$s_!4hoi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4hoi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png" width="369" height="177.78151260504202" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/a8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:172,&quot;width&quot;:357,&quot;resizeWidth&quot;:369,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Change Logsize&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Change Logsize" title="Change Logsize" srcset="https://substackcdn.com/image/fetch/$s_!4hoi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 424w, https://substackcdn.com/image/fetch/$s_!4hoi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 848w, https://substackcdn.com/image/fetch/$s_!4hoi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 1272w, https://substackcdn.com/image/fetch/$s_!4hoi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8b8c66e-bd08-4f21-a16f-0f5afc958f02_357x172.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The &#8220;Microsoft-Windows-LDAP-Client&#8221; logs are stored on disk as binary event trace logs (.etl) This means that they must be converted into human-readable format before being forwarded to a SIEM. To automate the collection process, you can use <a href="https://github.com/fireeye/SilkETW">SilkETW</a> or <a href="https://github.com/airbus-cert/Splunk-ETW">Splunk-ETW</a>. In this example, I will use the Splunk-ETW Technology Add-on. Installation instructions are pretty straightforward and well-documented on the project&#8217;s GitHub page.</p><p>After installing the add-on on the forwarder(s), create a new &#8220;profile&#8221; named <code>ldap.ini</code> in </p><pre><code>$SPLUNK_HOME\etc\apps\Splunk-ETW\profile </code></pre><p>with the contents</p><pre><code>[Microsoft-Windows-LDAP-Client].</code></pre><p>Next, to enable the profile we just created, add the following to <code>inputs.conf</code> at <code>$SPLUNK_HOME\etc\system\local\inputs.conf</code>:</p><pre><code>[Splunk-ETW://ldap]
disabled = 0</code></pre><p>Then, you should begin to see events populate Splunk with the sourcetype: <code>Splunk-ETW</code> (a restart of Splunk may be required).</p><p>Now that we have visibility into the actual LDAP queries that are being sent, we can begin to differentiate &#8220;signal&#8221; from &#8220;noise&#8221;. But first, let&#8217;s take a look at the syntax of LDAP search filters. Filters are boolean expressions, more simply known as &#8220;true&#8221; or &#8220;false&#8221; statements, that specify what objects should be returned in the search. For example, the following search filter will return all objects in the &#8220;user&#8221; class:</p><pre><code>(objectClass=user)</code></pre><p>Parenthesis serve as a grouping around the different &#8220;clauses&#8221;, and allow for multiple attributes to be specified in a single search query. These groupings can also be chained together with logical comparative operators, AND (&amp;) or OR (|). For example, another way to enumerate user accounts could be to search for all objects that have the &#8220;homedirectory&#8221;, &#8220;scriptpath&#8221;, or &#8220;profilepath&#8221; attributes set. Since we want to find all objects with any value for each of these 3 attributes, we can use the wildcard (*) character in place of the value. So, to return objects with any value for &#8220;homedirectory&#8221; OR &#8220;scriptpath&#8221; OR &#8220;profilepath&#8221; we could use the following:</p><pre><code>(|(homedirectory=*)(scriptpath=*)(profilepath=*))</code></pre><p>Most legitimate LDAP queries will be searching for a very specific object, instead of trying to find all objects that match generic criteria. After running some popular enumeration tools in the BLS lab environment, we observed the following elements of suspicious queries begin to standout:</p><ul><li><p>Generic search looking for all objects of a general type</p></li><li><p>Large number of generic filters in single query (e.g. return all computers AND users AND groups)</p></li><li><p>Multiple queries from the same PID in a short time-frame</p></li><li><p>Wildcards present in search filter</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RXto!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RXto!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 424w, https://substackcdn.com/image/fetch/$s_!RXto!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 848w, https://substackcdn.com/image/fetch/$s_!RXto!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 1272w, https://substackcdn.com/image/fetch/$s_!RXto!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RXto!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png" width="1393" height="395" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/e96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:395,&quot;width&quot;:1393,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Suspicious Search Filter&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Suspicious Search Filter" title="Suspicious Search Filter" srcset="https://substackcdn.com/image/fetch/$s_!RXto!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 424w, https://substackcdn.com/image/fetch/$s_!RXto!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 848w, https://substackcdn.com/image/fetch/$s_!RXto!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 1272w, https://substackcdn.com/image/fetch/$s_!RXto!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe96470ab-5ae0-4a5e-9d59-87e00ff3485c_1393x395.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">A Suspicious Search Filter</figcaption></figure></div><p>Utilizing these observations as a basis for generating a detection method, we have created a series of LDAP query filters that can be used with the logging configuration outlined above to generate alerts for suspicious LDAP activity. These queries have been consolidated and published as Sigma rules in the <a href="https://github.com/blacklanternsecurity/sigma-rules">BLS</a> and <a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/other/win_ldap_recon.yml">SigmaHQ</a> repositories.</p><p>Below is a list of additional LDAP search filters that could potentially be used for reconnaissance by an attacker. These filters may be useful for threat hunting efforts within your environment to identify suspicious / unwanted LDAP activity.</p><h3>Domain Enumeration</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ev4U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ev4U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 424w, https://substackcdn.com/image/fetch/$s_!ev4U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 848w, https://substackcdn.com/image/fetch/$s_!ev4U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 1272w, https://substackcdn.com/image/fetch/$s_!ev4U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ev4U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png" width="727" height="203.67315175097275" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:288,&quot;width&quot;:1028,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:40236,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ev4U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 424w, https://substackcdn.com/image/fetch/$s_!ev4U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 848w, https://substackcdn.com/image/fetch/$s_!ev4U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 1272w, https://substackcdn.com/image/fetch/$s_!ev4U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F074acfed-8677-41a5-8024-6129e929ce1e_1028x288.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Account Enumeration</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AIto!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AIto!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 424w, https://substackcdn.com/image/fetch/$s_!AIto!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 848w, https://substackcdn.com/image/fetch/$s_!AIto!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 1272w, https://substackcdn.com/image/fetch/$s_!AIto!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AIto!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png" width="727" height="225.8640776699029" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/de95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:1030,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:51249,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AIto!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 424w, https://substackcdn.com/image/fetch/$s_!AIto!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 848w, https://substackcdn.com/image/fetch/$s_!AIto!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 1272w, https://substackcdn.com/image/fetch/$s_!AIto!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fde95476f-dcfa-400a-a504-e31c1a4915cc_1030x320.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Computer Enumeration</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bL5A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bL5A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 424w, https://substackcdn.com/image/fetch/$s_!bL5A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 848w, https://substackcdn.com/image/fetch/$s_!bL5A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 1272w, https://substackcdn.com/image/fetch/$s_!bL5A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bL5A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png" width="727" height="142.00424628450105" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:184,&quot;width&quot;:942,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:24360,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bL5A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 424w, https://substackcdn.com/image/fetch/$s_!bL5A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 848w, https://substackcdn.com/image/fetch/$s_!bL5A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 1272w, https://substackcdn.com/image/fetch/$s_!bL5A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1a5edeaf-e03c-4856-b4ad-fe32bd3f43fe_942x184.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Group Enumeration</h3><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_Wb0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_Wb0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 424w, https://substackcdn.com/image/fetch/$s_!_Wb0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 848w, https://substackcdn.com/image/fetch/$s_!_Wb0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 1272w, https://substackcdn.com/image/fetch/$s_!_Wb0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_Wb0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png" width="727" height="520.7993273542601" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:639,&quot;width&quot;:892,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:75358,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_Wb0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 424w, https://substackcdn.com/image/fetch/$s_!_Wb0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 848w, https://substackcdn.com/image/fetch/$s_!_Wb0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 1272w, https://substackcdn.com/image/fetch/$s_!_Wb0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F7c0604f9-f53d-4fc8-8ce8-5089d74fad07_892x639.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Kerberos Enumeration</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WcTO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WcTO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 424w, https://substackcdn.com/image/fetch/$s_!WcTO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 848w, https://substackcdn.com/image/fetch/$s_!WcTO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 1272w, https://substackcdn.com/image/fetch/$s_!WcTO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WcTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png" width="727" height="234.40654205607476" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/73039317-a4bc-4582-9863-db961b9e2d97_856x276.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:276,&quot;width&quot;:856,&quot;resizeWidth&quot;:727,&quot;bytes&quot;:32444,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WcTO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 424w, https://substackcdn.com/image/fetch/$s_!WcTO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 848w, https://substackcdn.com/image/fetch/$s_!WcTO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 1272w, https://substackcdn.com/image/fetch/$s_!WcTO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F73039317-a4bc-4582-9863-db961b9e2d97_856x276.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Related Works</h2><p>The Remote Security Account Manager (SAMR) protocol has very similar functionality to LDAP, as it also enables enumeration of domain accounts and groups. It is used by the built-in <code>net.exe</code> command, and its impact should also be considered. For mitigation strategies, visit the following page:</p><ul><li><p><a href="https://stealthbits.com/blog/making-internal-reconnaissance-harder-using-netcease-and-samri1o/">https://stealthbits.com/blog/making-internal-reconnaissance-harder-using-netcease-and-samri1o/</a></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.blacklanternsecurity.com/p/detecting-ldap-recoannaissance?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.blacklanternsecurity.com/p/detecting-ldap-recoannaissance?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.blacklanternsecurity.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.blacklanternsecurity.com/subscribe?"><span>Subscribe now</span></a></p><h2>References</h2><ol><li><p><a href="https://github.com/blacklanternsecurity/sigma-rules">https://github.com/blacklanternsecurity/sigma-rules</a></p></li><li><p><a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/ldap/win_ldap_recon.yml">https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/ldap/win_ldap_recon.yml</a></p></li><li><p><a href="https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/useraccountcontrol-manipulate-account-properties">https://docs.microsoft.com/en-us/troubleshoot/windows-server/identity/useraccountcontrol-manipulate-account-properties</a></p></li><li><p><a href="https://docs.microsoft.com/en-us/windows/win32/adschema/a-grouptype#remarks">https://docs.microsoft.com/en-us/windows/win32/adschema/a-grouptype#remarks</a></p></li><li><p><a href="https://docs.microsoft.com/en-us/windows/win32/adschema/a-samaccounttype">https://docs.microsoft.com/en-us/windows/win32/adschema/a-samaccounttype</a></p></li><li><p><a href="https://github.com/fireeye/SilkETW">https://github.com/fireeye/SilkETW</a></p></li><li><p><a href="https://github.com/airbus-cert/Splunk-ETW">https://github.com/airbus-cert/Splunk-ETW</a></p></li></ol>]]></content:encoded></item><item><title><![CDATA[Detecting DCSync]]></title><description><![CDATA[Understanding and Detecting MITRE T1003.006 - OS Credential Dumping: DCSync]]></description><link>https://blog.blacklanternsecurity.com/p/detecting-dcsync</link><guid isPermaLink="false">https://blog.blacklanternsecurity.com/p/detecting-dcsync</guid><dc:creator><![CDATA[Brian O'Hara]]></dc:creator><pubDate>Fri, 04 Dec 2020 14:30:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!prYK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>Introduction</h2><p>A common favorite &#8220;domain domination&#8221; technique for Black Lantern Security (BLS) operators during engagements is to perform a DCSync attack to obtain all the juicy credentials they can acquire. Because this technique generally flies under the radar of detection and logging capabilities at most organizations, the first question from the client during outbrief always seems to be, &#8220;<em>How did you do it?</em>&#8221; In an effort to aggregate many of the community resources, research, and shared experience and to demystify some of this technique&#8217;s nitty gritty technical details in a digestible manner for our clients, we have put together a brief write up.</p><h2>Overview</h2><p>The DCSync attack methodology takes advantage of the Directory Replication Service Remote (DRSR) protocol to obtain sensitive information from a domain controller.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> This technique involves an adversary masquerading their host as a domain controller (DC) and convincing the authentic DC to synchronize its database to the new rogue DC by issuing a replication request. This functionality is not a bug, but rather is intended activity to provide user friendly redundancy in a multi-DC network. The attack does require elevated privileges to complete. The user account used to perform the data replication request must have the &#8221;replicating directory changes&#8221; privilege, which is commonly found associated with administrator and domain administrator credentials. The results of a successful DCSync attack will provide the adversary with password hashes of the targeted users. In most cases, this will include all users.</p><h2>Detection on the Wire</h2><p>The security community&#8217;s current recommendation for detecting a DCSync attack is to implement a detection signature at the network layer (typically through an IDS/IPS application) to identify RPC/DCE traffic, which includes calls to the DRSUAPI RPC interface.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> Network layer detection has proven to be the most consistent and easiest way to detect this type of attack. The detection criteria can be further customized to have more granularity by specifically targeting traffic which includes the bit map that indicates calls to &#8220;<strong>IDL_DRSGetNCChanges</strong>&#8221;.</p><p>For this detection technique to be effective, it requires the network to be logically segmented so that the domain controllers are grouped on a common VLAN and separated from the rest of the network. It is important to note that replication activity, as mentioned above, is normal behavior in a Windows Active Directory environment. The recommended deployment configuration from Microsoft suggests including more than one DC for redundancy and load balancing purposes.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> As this is the advice given directly from the vendor, it is likely to be encountered in many corporate networks and all but guarantees ongoing replication activity. The fact that replication behavior is expected makes detection of &#8220;malicious&#8221; activity very challenging on a flat network. The sheer volume of alerts from a flat network will eventually cause alert fatigue and many times the results of an investigation will end up being legitimate activity. By implementing proper network segmentation, DRSR protocol activity is limited to the DC VLAN and detective measures can be put in place so that the IDS/IPS signatures only alert on attempts to replicate the DC database <em>outside</em> of the controlled DC segment. In this configuration, preventative controls may also be put in place as well to block DRSR traffic that is routed outside of the DC network segment.</p><p>Example Suricata signatures created by Didier Stevens research can be seen below.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a></p><pre><code>alert tcp !$DC_SERVERS any -&gt; $DC_SERVERS any (msg:"Mimikatz DRSUAPI"; flow:established,to_server; content:"|05 00 0b|"; depth:3; content:"|35 42 51 e3 06 4b d1 11 ab 04 00 c0 4f c2 dc d2|"; depth:100; flowbits:set,drsuapi; flowbits:noalert; reference:url,blog.didierstevens.com; classtype:policy-violation; sid:1000001; rev:1;)

alert tcp !$DC_SERVERS any -&gt; $DC_SERVERS any (msg:"Mimikatz DRSUAPI DsGetNCChanges Request"; flow:established,to_server; flowbits:isset,drsuapi; content:"|05 00 00|"; depth:3; content:"|00 03|"; offset:22 depth:2; reference:url,blog.didierstevens.com; classtype:policy-violation; sid:1000002; rev:1;)</code></pre><p>Note that both signatures are inspecting for traffic originating from any network segment that is NOT the DC segment and that includes calls to drsuapi through RPC/DCE traffic. The first signature is looking for a bind event, which is a required prerequisite to call individual functions from the DRSUAPI. The second alert is specifically targeting the flag associated with DsGetNCChanges requests. Both signatures have been tested and validated in a lab environment. Each will fire and alert when a DCSync attack is executed.</p><h2>Detection Through Event Logs</h2><p>Even though network detection is preferred, there will be environments that may not have the capability to detect this attack at the network layer. Fortunately, there is a means to detect this attack technique using standard Windows Event logs, which should accommodate those organizations that may have this technical limitation. The event log ID required to detect this attack is Event ID 4662, which is activated by enabling <em>&#8220;Audit Directory Services Access&#8221; through Group Policy (Computer configurations &gt; Windows Settings &gt; Security Settings &gt; Local Policies &gt; Audit Policy &gt; Audit Directory Service Access &gt; Enable Success)</em>.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> By configuring this setting, two new event IDs will be generated in the logs: 4661 and 4662. Each of these event IDs can be viewed in the Security log using the standard Event Viewer application. Both of these events are extremely generic and track access attempts to directory service objects. The 4662 event ID generated by DCSync activity is specifically targeting actions where, <em>&#8220;An operation was performed on an object&#8221;</em>. It is important to note that this event ID is not enabled by default and must be explicitly configured. Based on the Microsoft documentation, the decision to omit these events from default logging was based on the high volume of logs that can be generated. For example, event ID 4662 will be created for any access attempts to a directory service object in which a security access control list (SACL) has been assigned. 4662 events are also generated when access to the WMI namespace, <em>MicrosoftVolumeEncryption</em>, is referenced.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> When Bitlocker is enabled in the environment, this generates substantial log volumes and has been cause for many organizations to eventually disable the event after initial configuration. One final recommendation is to NOT enable failure auditing as these event logs are infamous for flooding log collectors in the 10+ million range when a single error occurs.</p><p>This event log correlation method, like the network detection method, also requires some prerequisite planning steps. For this method of detection to be efficient and to facilitate effective rule tuning, a strong baseline of legitimate replication activity should be identified.</p><h2>Investigating Using a SIEM</h2><p>From a SIEM alerting perspective, if the host names of the DCs are known and documented, their machine account names can be explicitly omitted from security event generation as that is expected behavior. Another way to limit the volume of logs from these events (at least from the SIEM perspective) is to implement a blocklist on the event forwarder so that only 4662 events of interest are captured and transferred to the centralized logging platform. This process and implementation will vary depending on both the log forwarder and the SIEM, and will require tailored research.</p><p>An example where the forwarder was tuned within the BLS Detection Lab is detailed below <em>(</em><strong>Note:</strong> this is not specific to DCSync detection):<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a></p><blockquote><p>The blacklist feature of the Splunk Universal Forwarder v6.1+ can be utilized to filter events. An additional line would need to be placed in <em>Splunk_TA_windows\local\inputs.conf</em> and pushed to the DCs.</p><pre><code>[WinEventLog://Security] blacklist1=EventCode="4662" Message="Properties: [regex]&#8221;</code></pre></blockquote><p></p><p>There are three data fields of interest that should be correlated from the 4662 logs to identify possible DCSync activity. </p><ol><li><p>SubjectUserName</p></li><li><p>AccessMask</p></li><li><p>Properties</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!prYK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!prYK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 424w, https://substackcdn.com/image/fetch/$s_!prYK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 848w, https://substackcdn.com/image/fetch/$s_!prYK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 1272w, https://substackcdn.com/image/fetch/$s_!prYK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!prYK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png" width="1034" height="867" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/09ea831d-5194-41cc-a998-4600a566e437_1034x867.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:867,&quot;width&quot;:1034,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!prYK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 424w, https://substackcdn.com/image/fetch/$s_!prYK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 848w, https://substackcdn.com/image/fetch/$s_!prYK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 1272w, https://substackcdn.com/image/fetch/$s_!prYK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09ea831d-5194-41cc-a998-4600a566e437_1034x867.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Sample 4662 Event Log from a Successful DCSync Attack</figcaption></figure></div><p>For authentic replication activity the &#8220;<strong>SubjectUserName</strong>&#8221; should contain the name of the machine account of a domain controller or a variation of NT AUTHORITY/SYSTEM. This data field will need to be evaluated within the target environment that is being monitored. What is shown here is only an example. For this detection method, any logs that match the additional criteria listed below and include a regular user account in the &#8220;<strong>SubjectUserName</strong>&#8221; field, should be investigated further.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wuxx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wuxx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 424w, https://substackcdn.com/image/fetch/$s_!wuxx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 848w, https://substackcdn.com/image/fetch/$s_!wuxx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 1272w, https://substackcdn.com/image/fetch/$s_!wuxx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wuxx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png" width="620" height="87" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:87,&quot;width&quot;:620,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wuxx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 424w, https://substackcdn.com/image/fetch/$s_!wuxx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 848w, https://substackcdn.com/image/fetch/$s_!wuxx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 1272w, https://substackcdn.com/image/fetch/$s_!wuxx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F09afcbcc-80c6-4b7a-b74e-16b0fbbeda3c_620x87.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">A Legitimate Replication Log Example</figcaption></figure></div><p>The &#8220;<strong>AccessMask</strong>&#8221; captured in the event log should be <strong>0x100</strong>.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a> This value represents &#8220;control access&#8221; and is specifically registered when access is allowed following extended rights verification (typically associated with the use of high level and explicit permissions that are required to initiate the DCSync attack).</p><p>The &#8220;<strong>Properties</strong>&#8221; field will include 2 pieces of relevant information to search for. The first is the starting string in the log example above, &#8220;<strong>%%7688</strong>&#8221;.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a> This is another flag that is assigned and is associated with &#8220;Control access&#8221;. The second is the long string of characters at the end of that field, which are registered GUIDs that represent each of the RPC functions associated with the replication attempt. Through testing, the GUIDs of interest have been identified as one of three options when tracking DCSync activity.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a> The 4th one listed below may also be associated, however, this has not yet been validated*.</p><ol><li><p><strong>{1131f6aa-9c07-11d1-f79f-00c04fc2dcd2}</strong> - DS-Replication-Get-Changes</p></li><li><p><strong>{1131f6ad-9c07-11d1-f79f-00c04fc2dcd2}</strong> - DS-Replication-Get-Changes-All</p></li><li><p><strong>{9923a32a-3607-11d2-b9be-0000f87a36b2}</strong> - DS-Install-Replica 4.*{89e95b76-444d-4c62-991a-0facbeda640c} - DS-Replication-Get-Changes-In-Filtered-Set</p></li></ol><p>It is important to note that within the community there is some disagreement with regard to the presence of the GUID versus the more generalized statement (&#8220;<strong>Replicating Directory Changes all</strong>&#8221;) that&#8217;s captured in these logs. At this time, it is recommended to enrich the detection criteria to search for either the GUIDs or the replication statement to capture all possible scenarios. While hunting client environments for this type of activity, BLS has found this string instead of the GUIDs above.</p><p>Benjamin Delpy (@gentilkiwi), the researcher who discovered and pioneered the DCSync attack technique, has also provided a few recommended Splunk queries to hunt for this activity.<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a> Some of his searches have been found to be a bit generic when utilized in larger corporate environments and may produce overwhelming results. However, one of the suggestions he makes that could prove useful in tuning efforts is to exclude events where the SubjectUserSID includes &#8220;AUTHORITE NT&#8221;. This may be something to consider should the other criteria above overwhelm the Logs/SIEM with large numbers of events.</p><p><strong>Note:</strong> For those curious about the other GUID seen in the log example above, &#8220;<em>{19195a5b-6da0-11d0-afd3-00c04fd930c9}</em>&#8221;, this is associated with the RPC function: WRITE_DAC. Though this will be present in each of these event logs, it is not very helpful in detecting DCSync activity specifically. This is a standard access permission to modify discretionary access control lists in an object&#8217;s security descriptor.</p><p>After testing using the BLSOPS lab environment, we were able to efficiently detect this activity successfully using the explained log criteria.</p><h4>Lab Sample Splunk Query:</h4><p>index=main EventCode=4662 Access_Mask=0x100 AND (&#8220;Replicating Directory Changes all&#8221; OR &#8220;1131f6ad-9c07-11d1-f79f-00c04fc2dcd2&#8221; OR &#8220;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2&#8221; OR &#8220;9923a32a-3607-11d2-b9be-0000f87a36b2&#8221;) | regex Account_Name!=&#8221;\w+$&#8221;</p><p><strong>Note:</strong> The Splunk instance used during test,  the &#8220;SubjectUserName&#8221; data from the log was parsed and indexed into &#8220;Account_Name.&#8221;.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eDsb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eDsb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 424w, https://substackcdn.com/image/fetch/$s_!eDsb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 848w, https://substackcdn.com/image/fetch/$s_!eDsb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 1272w, https://substackcdn.com/image/fetch/$s_!eDsb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eDsb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png" width="1456" height="612" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:612,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eDsb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 424w, https://substackcdn.com/image/fetch/$s_!eDsb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 848w, https://substackcdn.com/image/fetch/$s_!eDsb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 1272w, https://substackcdn.com/image/fetch/$s_!eDsb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F002e87b1-5b3c-475a-9543-906334aee42f_1638x688.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Splunk Search Example</figcaption></figure></div><p></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.blacklanternsecurity.com/p/detecting-dcsync?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.blacklanternsecurity.com/p/detecting-dcsync?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blog.blacklanternsecurity.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blog.blacklanternsecurity.com/subscribe?"><span>Subscribe now</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><a href="https://adsecurity.org/?p=1729">https://adsecurity.org/?p=1729</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><a href="https://adsecurity.org/?p=1729; https://blog.didierstevens.com/2017/10/08/quickpost-mimikatz-dcsync-detection/">https://adsecurity.org/?p=1729; https://blog.didierstevens.com/2017/10/08/quickpost-mimikatz-dcsync-detection/</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p><a href="https://social.technet.microsoft.com/Forums/windowsserver/en-US/991d4f68-5178-4c9a-8b7d-8f2b5f53867e/how-many-domain-controllers-are-recommended?forum=winserverDS">https://social.technet.microsoft.com/Forums/windowsserver/en-US/991d4f68-5178-4c9a-8b7d-8f2b5f53867e/how-many-domain-controllers-are-recommended?forum=winserverDS</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p><a href="https://blog.didierstevens.com/2017/10/08/quickpost-mimikatz-dcsync-detection/">https://blog.didierstevens.com/2017/10/08/quickpost-mimikatz-dcsync-detection/</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-5" href="#footnote-anchor-5" class="footnote-number" contenteditable="false" target="_self">5</a><div class="footnote-content"><p><a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/audit-directory-service-access">https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/audit-directory-service-access</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-6" href="#footnote-anchor-6" class="footnote-number" contenteditable="false" target="_self">6</a><div class="footnote-content"><p><a href="https://static1.squarespace.com/static/552092d5e4b0661088167e5c/t/5c58669615fcc0dce4024cc1/1549297303121/Windows+Advanced+Logging+Cheat+Sheet_ver_Feb_2019_">https://static1.squarespace.com/static/552092d5e4b0661088167e5c/t/5c58669615fcc0dce4024cc1/1549297303121/Windows+Advanced+Logging+Cheat+Sheet_ver_Feb_2019_</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-7" href="#footnote-anchor-7" class="footnote-number" contenteditable="false" target="_self">7</a><div class="footnote-content"><p><a href="https://www.splunk.com/en_us/blog/tips-and-tricks/controlling-4662-messages-in-the-windows-security-event-log.html">https://www.splunk.com/en_us/blog/tips-and-tricks/controlling-4662-messages-in-the-windows-security-event-log.html</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-8" href="#footnote-anchor-8" class="footnote-number" contenteditable="false" target="_self">8</a><div class="footnote-content"><p><a href="https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662">https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-9" href="#footnote-anchor-9" class="footnote-number" contenteditable="false" target="_self">9</a><div class="footnote-content"><p><a href="https://social.technet.microsoft.com/Forums/windows/en-US/541bad5d-19eb-4de5-8ef7-1b144f0b6113/translate-xxxx-values-in-events?forum=w7itprosecurity">https://social.technet.microsoft.com/Forums/windows/en-US/541bad5d-19eb-4de5-8ef7-1b144f0b6113/translate-xxxx-values-in-events?forum=w7itprosecurity</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-10" href="#footnote-anchor-10" class="footnote-number" contenteditable="false" target="_self">10</a><div class="footnote-content"><p><a href="https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/1522b774-6464-41a3-87a5-1e5633c3fbbb">https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/1522b774-6464-41a3-87a5-1e5633c3fbbb</a>; <a href="http://gist.github.com/gentilkiwi/dcc132457408cf11ad2061340dcb53c2#file-dcsync-dcshadow-splunk">gist.github.com/gentilkiwi/dcc132457408cf11ad2061340dcb53c2#file-dcsync-dcshadow-splunk</a></p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-11" href="#footnote-anchor-11" class="footnote-number" contenteditable="false" target="_self">11</a><div class="footnote-content"><p><a href="http://gist.github.com/gentilkiwi/dcc132457408cf11ad2061340dcb53c2#file-dcsync-dcshadow-splunk">gist.github.com/gentilkiwi/dcc132457408cf11ad2061340dcb53c2#file-dcsync-dcshadow-splunk</a></p><h2>Notable References </h2><ol><li><p><a href="https://www.siliconshecky.com/dcsync-where-the-heck-did-that-come-from/">https://www.siliconshecky.com/dcsync-where-the-heck-did-that-come-from/</a></p></li><li><p><a href="http://themawofeternity.blogspot.com/2018/04/secretsdump-dcsync.html">http://themawofeternity.blogspot.com/2018/04/secretsdump-dcsync.html</a></p></li><li><p><a href="https://yojimbosecurity.ninja/dcsync/#org8b0871c">https://yojimbosecurity.ninja/dcsync/#org8b0871c</a></p></li><li><p><a href="https://www.praetorian.com/blog/active-directory-visualization-for-blue-teams-and-threat-hunters">https://www.praetorian.com/blog/active-directory-visualization-for-blue-teams-and-threat-hunters</a></p></li><li><p>http://pjhartlieb.blogspot.com/2011/10/one-mans-take-on-active-directory.html</p></li><li><p><a href="https://blog.stealthbits.com/extracting-user-password-data-with-mimikatz-dcsync/">https://blog.stealthbits.com/extracting-user-password-data-with-mimikatz-dcsync/</a></p></li><li><p><a href="https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/dump-password-hashes-from-domain-controller-with-dcsync">https://ired.team/offensive-security-experiments/active-directory-kerberos-abuse/dump-password-hashes-from-domain-controller-with-dcsync</a></p></li><li><p><a href="https://wiki.samba.org/index.php/DRSUAPI">https://wiki.samba.org/index.php/DRSUAPI</a></p></li><li><p><a href="https://attack.mitre.org/techniques/T1003/006/">https://attack.mitre.org/techniques/T1003/006/</a></p></li></ol><p></p></div></div>]]></content:encoded></item></channel></rss>