<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mehmet Ergene on Medium]]></title>
        <description><![CDATA[Stories by Mehmet Ergene on Medium]]></description>
        <link>https://medium.com/@mergene?source=rss-f7cc596dfe41------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-X0HmnvBL_5cCVdWC8x8nw.png</url>
            <title>Stories by Mehmet Ergene on Medium</title>
            <link>https://medium.com/@mergene?source=rss-f7cc596dfe41------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 03:08:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mergene/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What Is Threat Hunting in 2026?]]></title>
            <link>https://mergene.medium.com/what-is-threat-hunting-in-2026-7f3c7e496d65?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f3c7e496d65</guid>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Wed, 07 Oct 2026 12:46:01 GMT</pubDate>
            <atom:updated>2026-10-07T12:46:01.456Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Threat Hunting in 2026</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*4-pDD496UarpBZxi.jpg" /></figure><p>Nowadays, it is common to see many different definitions of threat hunting. As the cybersecurity field has expanded, professionals from different disciplines have started labeling a wide range of activities as threat hunting.</p><p>For example, you may see Cyber Threat Intelligence (CTI) analysts, and even CTI vendors, describe their work as threat hunting when they search for malware using YARA rules or track adversary infrastructure with tools such as Censys or VirusTotal.</p><p>Similarly, incident responders who begin investigating logs after receiving an alert sometimes refer to this activity as threat hunting, occasionally calling it <em>reactive threat hunting</em>.</p><p>But if almost any security investigation can be called threat hunting, does the term still mean anything?</p><p>Let’s look at why I don’t consider these activities threat hunting.</p><p>First, we need a working definition:</p><blockquote><em>Threat hunting is a proactive, iterative approach to searching through networks, endpoints, and datasets to detect malicious activity that evades existing security controls.</em></blockquote><p>That definition gives us several useful boundaries: proactive, iterative, searching within an operational environment, and looking for malicious activity that existing controls failed to identify.</p><h3>Adversary Infrastructure Tracking Using VirusTotal or Censys as Threat Hunting</h3><p>Tracking adversary infrastructure using platforms such as VirusTotal or Censys is exactly that: tracking.</p><p>You are researching adversary infrastructure, malware, certificates, domains, IP addresses, relationships, and other artifacts.</p><p>That work can be extremely useful. It can produce intelligence that later becomes input for a hunt.</p><p>But what security control are you trying to determine was bypassed?</p><p>What operational environment are you hunting inside?</p><p>If I pivot through VirusTotal looking for infrastructure related to a malware family, I am conducting intelligence research. I am not searching my environment for malicious activity that escaped my security controls.</p><p>Tracking adversaries is cool and badass. It just doesn’t need to be called threat hunting.</p><h3>Alert Triage and Investigation as Threat Hunting</h3><p>This is probably the most interesting claim.</p><p>Going back to the definition, threat hunting searches for malicious activity that has evaded existing security controls. An alert means that at least one security control detected something. That does not mean the adversary did not evade other controls before or after the alert. An alert can absolutely become a useful starting point for a broader investigation.</p><p>But that does not automatically turn the investigation into threat hunting.</p><p>A common counterargument is:</p><blockquote><em>“I hunt for what else the adversary might have done.”</em></blockquote><p>Fair enough. But at that point, what separates the activity from incident investigation?</p><p>You already have evidence of potentially malicious activity. You now need to determine scope, impact, affected systems, persistence, lateral movement, credential access, and whatever else the attacker may have done. That is exactly what incident responders are supposed to do. Calling part of that process “reactive threat hunting” does not necessarily create a new discipline. In many cases, it simply renames investigation.</p><p>Another common argument involves hypotheses.</p><p>Let’s say an alert indicates initial access, and someone creates the following hypothesis:</p><blockquote><em>The attacker may create a scheduled task for persistence.</em></blockquote><p>So you search for scheduled-task creation.</p><p>What happens if the attacker used a service, WMI event subscription, startup folder, registry Run key, DLL side-loading, account manipulation, or another persistence mechanism?</p><p>Will you stop and close the alert as a false positive because your scheduled-task hypothesis was disproven?</p><p>Of course not.</p><p>You will investigate all plausible persistence mechanisms because you are trying to establish what the attacker actually did.</p><p>That is simply incident investigation.</p><p>Speaking of hypotheses, I’ve also seen people describe steps like these as threat-hunting hypotheses:</p><ul><li>Find the initial-access payload on the system.</li><li>Identify the file referenced by the scheduled task.</li></ul><p>Those are investigative tasks, not hypotheses.</p><p>A hypothesis should make a testable statement about activity that may be occurring in the environment.</p><p>If every investigative question, search query, or SOP step becomes a “hypothesis”, the word loses its purpose too.</p><h3>Grey Area: IOC Hunting</h3><p>IOC-based threat hunting creates much more interesting debate.</p><p>Some practitioners argue that searching for IOCs is not threat hunting at all, while others strongly disagree.</p><p>I think the answer depends on what you are searching for and why.</p><p>Certain IOC searches should probably be automated, especially high-volume or low-context indicators such as IP addresses, file hashes, and domains. If your hunt consists of manually taking 500 SHA256 hashes from a threat-intelligence report and searching your SIEM for matches, you may want to ask why a detection pipeline is not doing that continuously.</p><p>But not all indicators are equal.</p><p>Some indicators describe artifacts or behaviors produced by attacker tooling and can expose malicious activity surprisingly well.</p><p>For example, SharpHound, commonly used to enumerate Active Directory and collect data for BloodHound, can create output files using a predictable naming pattern:</p><p>&lt;timestamp&gt;_BloodHound.zip</p><p>An adversary may not change that behavior. They may not know about it, may not care, or may simply forget. That creates an opportunity. Instead of searching for known malicious hashes, you can search historical file-creation telemetry for files matching that pattern and then investigate the systems, users, processes, and surrounding activity associated with those files.</p><p>Does this provide broad coverage for Active Directory reconnaissance?</p><p>No.</p><p>Could it identify activity that your existing controls missed?</p><p>Absolutely.</p><p>That is where IOC hunting becomes more interesting.</p><h3>Threat Hunting in Practice</h3><p>I’ve been working as a threat hunter in an enterprise environment for a long time, and I’ve never performed threat hunting like some of the examples above.</p><p>Most of my hunting work has involved reducing very large datasets until a small number of interesting observations remain.</p><p>That frequently means looking for unusual behavior.</p><p>Malicious activity usually affects a relatively small number of entities in an environment: a few users, endpoints, servers, applications, processes, or identities.</p><p>That makes rarity useful.</p><p>But rarity alone is not enough.</p><p>DeviceCount == 1 does not mean malicious.</p><p>Sometimes one system behaves differently because it is compromised.</p><p>Sometimes it behaves differently because it is the server of the weird application a small department uses.</p><p>That is why threat hunting cannot simply be reduced to finding outliers.</p><p>There is also a useful distinction between an outlier and an anomaly.</p><ul><li>An outlier is statistically uncommon or extreme.</li><li>An anomaly is an observation that is unusual in a way that becomes meaningful within its operational or security context.</li></ul><p>A rare PowerShell command is an outlier.</p><p>A rare PowerShell command executed by a service account on a domain controller shortly after that account authenticated from a workstation it has never used before is something very different.</p><p>Context turns rarity into a hunting lead.</p><p>Threat hunters therefore need ways to reduce massive volumes of telemetry into a much smaller set of observations worth examining.</p><p>Depending on the hunt, that may involve frequency analysis, clustering, baselining, peer-group analysis, time-series analysis, statistical methods, graph relationships, simple aggregations, or sometimes nothing more sophisticated than a carefully constructed query.</p><p>The technique matters less than the reduction process.</p><p>You might begin with 400 million events.</p><p>Your first query reduces them to 200,000.</p><p>Another aggregation reduces them to 3,000.</p><p>Entity context reduces them to 40.</p><p>Manual investigation leaves you with three.</p><p>And one of those three turns into an incident.</p><p>That is much closer to what threat hunting looks like in practice.</p><p>Once the dataset has been reduced, hunters usually need to validate what remains. That may include:</p><ul><li>Searching for supporting or contradictory evidence across additional logs.</li><li>Correlating activity across endpoints, identities, network telemetry, cloud services, and other data sources.</li><li>Comparing the activity with historical behavior or peer groups.</li><li>Contacting the user or system owner to understand whether the behavior is legitimate.</li><li>Escalating suspicious activity to incident responders for deeper investigation.</li></ul><p>And this is where human judgment becomes difficult to replace.</p><p>A query can tell you that something happened once.</p><p>Statistics can tell you that it is rare.</p><p>Threat intelligence can tell you that attackers have performed similar activity.</p><p>A detection rule can tell you that a known condition was satisfied.</p><p>The hunter still has to answer the harder question:</p><p><strong>Why is this happening here?</strong></p><p>That question is usually where the hunt actually starts.</p><h3>Conclusion</h3><p>Threat hunting should remain distinct from CTI research, alert investigation, and routine IOC searching.</p><p>The key question is simple:</p><p><strong>What am I trying to find that my existing detections and security controls are missing?</strong></p><p>If you cannot answer that clearly, you may still be doing useful security work.</p><p>But you are probably not threat hunting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f3c7e496d65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Defender AV Real-Time Protection Impact on EDR Telemetry]]></title>
            <link>https://mergene.medium.com/defender-av-real-time-protection-impact-on-edr-telemetry-76f80f2053f4?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/76f80f2053f4</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[edr]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 13:21:00 GMT</pubDate>
            <atom:updated>2026-07-04T13:21:00.867Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CiQhtmZRj4NM5GhV.png" /></figure><p>During purple teaming or detection development, we often disable the AV by turning off the real-time protection to execute malicious scripts or binaries. Disabling Microsoft Defender Antivirus real-time protection during such simulations changes more than just allowing the execution. It unfortunately impacts EDR telemetry, at least Defender for Endpoint.</p><p>In this post, I’ll cover the most important telemetry that matters when the telemetry is used to write or validate detection rules.</p><h3>Network telemetry behind a forward proxy</h3><p>With a forward proxy, outbound traffic may look like this:</p><pre>malware.exe -&gt; proxy.contoso.local:8080 -&gt; suspicious-domain.example</pre><p>Basic connection telemetry can show the proxy address as the remote destination (RemoteIP and RemoteUrl) rather than the actual IP and domain the process contacted.</p><p>Network Protection adds HTTP-level visibility that can identify the destination behind the proxy, and EDR can record the actual domain that is contacted. Audit mode is enough to collect this context, but Network Protection depends on Defender Antivirus real-time protection being enabled. When enabled, in Audit or Block mode, the RemoteIP still logs the forward proxy IP address, but the RemoteUrl becomes available for detection development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AYNmtQYB7FC37-BO.png" /></figure><p>Disabling real-time protection can therefore leave you with a TCP connection to the proxy while removing the event that identifies the real destination.</p><blockquote>RemoteUrl may not always be recorded despite the Network Protection being enabled, and I’ll try to cover these situations in a later post.</blockquote><h3>Attack Surface Reduction (ASR) telemetry</h3><p>Attack surface reduction rules evaluate risky application and process behavior. Their audit and block events are available in the DeviceEvents table, with action types beginning with <strong><em>Asr</em></strong>.</p><p>One of the most useful ASR rules is below:</p><ul><li><strong>Block executable files from running unless they meet a prevalence, age, or trusted list criterion</strong></li></ul><p>This rule evaluates executable files using factors such as reputation, age, and prevalence. It’s especially relevant when the simulated payload is a Windows portable executable, such as an <strong>.exe</strong> file.<br>Suppose a test payload is new, uncommon, or untrusted. With the rule enabled in audit or block mode, Defender can produce an ASR event showing that the executable matched the rule. This rule eliminates the need for calculating file prevalence to write a detection.<br>If real-time protection is disabled, the executable may still run and appear in <strong>DeviceProcessEvents</strong> and other tables, but the corresponding ASR event is not recorded.</p><p>Other ASR rules that may be relevant include:</p><ul><li>Block abuse of exploited vulnerable signed drivers</li><li>Block JavaScript or VBScript from launching downloaded executable content</li><li>Block executable content from email client and webmail</li><li>Block credential stealing from the Windows local security authority subsystem</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CEsGoVBe_wg4WG6u.png" /></figure><p>The effect on detection engineering is straightforward. It potentially results in developing an unnecessary query, even a detection, if the ASR rule is in block mode, mitigating the threats already. A rule written only from the remaining process telemetry may be broader than necessary, causing false positives. A rule expecting ASR telemetry may appear broken even though the endpoint wasn’t running with the settings required to generate that telemetry.</p><h3>Other Defender protection telemetry</h3><p>Controlled Folder Access also depends on Defender Antivirus real-time protection. Disabling it during ransomware or file-encryption testing can remove the audit or block events that would normally show an untrusted process modifying a protected folder.</p><p>Network Protection events may appear under action types such as:</p><ul><li><strong>ExploitGuardNetworkProtectionAudited</strong></li><li><strong>ExploitGuardNetworkProtectionBlocked</strong></li></ul><p>These events can contain the destination URL and the initiating-process context. They shouldn’t be confused with the lower-level connection records in DeviceNetworkEvents.</p><h3>Conclusion</h3><p>Disabling real-time protection can make a simulation easier to execute, but it also changes the evidence available afterward.</p><p>For network testing, you may lose the real destination behind a forward proxy. For executable-based simulations, you may lose ASR events from rules such as the prevalence, age, or trusted-list rule.</p><p>The process may still execute and the connection may still be recorded. What’s missing is the Defender context that could make the detection more precise.</p><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master Threat Hunting, Detection Engineering, and KQL in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><p>Mehmet is the founder of <a href="https://academy.bluraven.io/"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized five times as a <strong>Microsoft Security MVP</strong>, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=76f80f2053f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hidden Gaps in Microsoft’s New Linkable Token Identifier]]></title>
            <link>https://mergene.medium.com/the-hidden-gaps-in-microsofts-new-linkable-token-identifier-87d7bb1919dc?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/87d7bb1919dc</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[entra-id]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Fri, 15 Aug 2025 08:50:18 GMT</pubDate>
            <atom:updated>2026-07-04T08:55:32.366Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G5ICCry1LfHKW8hg" /><figcaption>Photo by <a href="https://unsplash.com/@robjoviennawarwick?utm_source=medium&amp;utm_medium=referral">Rob Thompson</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>On 21st July 2025, Microsoft announced the general availability of <a href="https://techcommunity.microsoft.com/blog/microsoft-entra-blog/strengthen-identity-threat-detection-and-response-with-linkable-token-identifier/4434615">linkable token identifiers</a>, which introduces a new identifier SessionId across various logs to enhance incident response and anomaly detection. This feature is now available in:</p><ul><li>Microsoft Entra sign-in logs</li><li>Microsoft Exchange Online audit logs</li><li>Microsoft Graph activity logs</li><li>Microsoft Teams audit logs</li><li>Microsoft SharePoint Online audit logs</li></ul><p>The idea is pretty simple: SessionId allows defenders to track user sessions more effectively, even if the user’s IP address changes. This is especially useful in man-in-the-middle (AiTM) phishing scenarios, where an attacker initiates a new session, resulting a distinct SessionId. The distinct SessionId enables analysts to filter and isolate attacker activity in the logs easily.</p><p>Unfortunately, this approach only works well in specific scenarios like AiTM. In scenarios such as Device Code Phishing or Token Stealing, SessionId provides limited, if any, value. Let’s see why.</p><h3>Where SessionId Falls Short</h3><h4>Device Code Phishing</h4><p>In device code phishing, attackers exploit the device code authentication flow to capture authentication tokens. When the user completes the device code sign-in on their device, the attacker receives the token and uses it to access the victim’s account and perform actions. To simulate this scenario, I used Azure CLI to initiate a device code authentication on a separate device and completed the sign-in on the victim’s device. As shown below, the Azure CLI authentication receives the same SessionId as the victim’s session. Additionally, the DeviceId, found in the DeviceDetail column, matches the victim’s device. <strong>Therefore, </strong><strong>SessionId alone does not help in identifying or investigating malicious activity in device code phishing scenarios.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j72Qy8T9rUeWimvUHNaRog.png" /></figure><h4>Token Stealing</h4><p>Attackers who steal refresh tokens, Primary Refresh Tokens (PRTs), or cookies can silently authenticate and access cloud services. I used ROADToken to simulate the token stealing attack. ROADToken provides a PRT Cookie that can be used in roadtx, roadrecon and other tools to obtain tokens and perform operations on the resources. As you see below, extracting a PRT cookie from the victim device and using it on a different device results in the same SessionId and DeviceId as the original session in the logs. <strong>Therefore, </strong><strong>SessionId alone does not help in identifying or investigating malicious activity in token stealing scenarios.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V7BOuShL-CxPXKt8cwFGng.png" /></figure><h3>Detection Engineering with SessionId</h3><p>Despite these limitations, SessionId can still provide value for anomaly detection when used carefully. For example:</p><ul><li><strong>User Agent Mismatches</strong>: A session maintaining the same SessionId and application but suddenly presenting a different user agent from a newly observed IP address could indicate token reuse or session hijacking.</li><li><strong>Access Patterns</strong>: Clustering activities under a SessionId can help build temporal baselines and detect outliers or behavioral anomalies.</li></ul><h3>Conclusion</h3><p>Microsoft’s introduction of linkable token identifiers is a step forward, especially for streamlining investigations in AiTM scenarios. However, defenders must be aware of its blind spots. Over-relying on SessionId can obscure malicious activity that hides within legitimate sessions. For detections, it’s important to correlate SessionId with additional signals such as application, IP address, and User Agent.</p><p>Used wisely, SessionId can strengthen identity threat detection. Used naively, it could lead defenders straight into a false sense of security.</p><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master KQL for Threat Hunting, Detection Engineering, and DFIR in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HXcHIDzGbo3bxXgl.png" /></figure><p>Mehmet is the founder of <a href="https://academy.bluraven.io/"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized five times as a <strong>Microsoft Security MVP</strong>, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87d7bb1919dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting BadSuccessor: The Shortest Path to Domain Admin]]></title>
            <link>https://mergene.medium.com/detecting-badsuccessor-the-shortest-path-to-domain-admin-eff0fec6ee5b?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/eff0fec6ee5b</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 14:09:32 GMT</pubDate>
            <atom:updated>2025-07-10T14:09:32.104Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EgzLQUZc5MbKTXSu" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=medium&amp;utm_medium=referral">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Yuval Gordon from Akamai has recently introduced a dangerous attack, <a href="https://www.akamai.com/blog/security-research/abusing-dmsa-for-privilege-escalation-in-active-directory">BadSuccessor</a>, that lets low privileged users compromise the whole domain by abusing the delegated Managed Service Accounts (dMSA) feature introduced in Windows 2025.</p><p>In this post, I’ll explain how we can reliably detect this abuse since it cannot be detected with default auditing configuration in Active Directory.</p><h3>Understanding dMSA</h3><p>Delegated Managed Service Accounts (dMSA) are a new feature in Active Directory, introduced in Windows Server 2025, designed to replace and modernize legacy service accounts to reduce attack surface. To leverage dMSA, all domain controllers and participating servers that want to use dMSA must be running Windows Server 2025, and the domain functional level must be Windows Server 2025.</p><p>A typical dMSA migration of a legacy service account involves three steps (the svc_account01 in the examples is the legacy service account):</p><h4>1. Create a new service account</h4><pre>New-ADServiceAccount -Name dMSA-SVC01 -DNSHostName dMSA-SVC01.otrf.local -CreateDelegatedServiceAccount -KerberosEncryptionType AES256</pre><p>This creates the account under the <strong>Managed Service Accounts</strong> OU. As of now, there is no documented parameter to override this OU path. (This information will be important for detection)</p><h4>2. Initiate the migration</h4><pre>Start-ADServiceAccountMigration -Identity dMSA-SVC01 -SupersededAccount &quot;CN=svc_account01,CN=Users,DC=otrf,DC=local&quot;</pre><h4>3. Complete the migration</h4><pre>Complete-ADServiceAccountMigration -Identity dMSA-SVC01 -SupersededAccount &quot;CN=svc_account01,CN=Users,DC=otrf,DC=local&quot;</pre><p>Once complete, the legacy account (svc_account01) is disabled, and the new dMSA takes over.</p><h3>dMSA Telemetry with Recommended Audit Configuration</h3><p>With the default recommended audit configuration (applied via GPO), a standard dMSA migration generates limited telemetry on the domain controller. For instance, Event ID 5137 (object creation) is not generated as seen in the image below.:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qqRrbq7ZDGcfEcqtzMaoAA.png" /></figure><p>This results from default <strong>object level auditing</strong> on the domain, which is insufficient. (Or, I had an issue on a freshly migrated domain which is less likely)</p><h3>BadSuccessor: Exploiting dMSA</h3><blockquote>P.S.: I continued testing without modifying the audit settings since I wasn’t aware during the test. New accounts were used: sus_dMSA and svc_account06(svcAccount06)</blockquote><p>There are currently two public tools, <a href="https://github.com/logangoins/SharpSuccessor">SharpSucessor</a> and <a href="https://github.com/LuemmelSec/Pentest-Tools-Collection/blob/90240bdbd72177ea33100dce3dee3c5075ee7230/tools/ActiveDirectory/BadSuccessor.ps1">BadSuccessor.ps1</a>, to exploit the dMSA feature by:</p><ol><li>Creating a dMSA in an OU where the attacker(low-privileged user) has permissions.</li><li>Linking it to a high-privilege account via <strong>msDS-ManagedAccountPrecededByLink</strong>.</li><li>Faking migration completion by setting <strong>msDS-DelegatedMSAState</strong> to <strong>2</strong>.</li></ol><h4>Example BadSuccessor usage:</h4><pre>BadSuccessor -mode exploit -Path &quot;CN=Users,DC=otrf,DC=local&quot; -Name &quot;sus_dMSA&quot; -DelegatedAdmin &quot;j.taylor&quot; -DelegateTarget &quot;svcAccount06&quot; -domain &quot;otrf.local&quot;</pre><p>With all recommended audit policies enabled, this activity produces no relevant events on the domain controller as seen below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vg2D5j81Vb02QLwA23JHkA.png" /></figure><h3>Improving Object Auditing</h3><p>On top of recommended audit policies(applied via GPO), object-level auditing must be manually configured to monitor dMSA operations effectively and detect abuse:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2a3fMvsbbSsQKgEgHtNZEg.png" /></figure><p>Note that there is currently no option to enable <strong>Write</strong> operation for the <strong>msDS-ManagedAccountPrecededByLink</strong> and <strong>msDS-DelegatedManagedServiceAccount</strong>. Therefore, I enabled “<strong>Write all properties</strong>” option.Therefore, I had to enable <strong>Write all properties</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P2BL3YhZ74R6PVwp.png" /></figure><h3>Telemetry After Object Auditing Enhancements</h3><p>After adding the new auditing configuration and testing the malicious dMSA abuse (with new accounts), all telemetry is generated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KI7GTl1pLrXMDQsNG1l3nQ.png" /><figcaption>Telemetry generated by BadSuccessor.ps1 execution</figcaption></figure><p>Not surprisingly, legitimate dMSA migration generates more events:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5X9g2RXlTi55ovwSDrkzUg.png" /></figure><h3>Detecting dMSA Abuse</h3><p>Based on differences in telemetry between legitimate dMSA migration and malicious dMSA activity, the following detection ideas (and maybe more) can be produced:</p><h4>1. dMSA Creation Outside the Managed Service Accounts OU</h4><p>Legitimate dMSAs are created in the <strong>Managed Service Accounts</strong> OU. Assuming a low-privileged user wouldn’t have enough permissions on this OU, we can flag any dMSA creation outside this OU.</p><pre>let domain_dns_name = &quot;otrf.local&quot;; // replace with your domain dns name<br>let msa_cn = &quot;CN=Managed Service Accounts&quot;;<br>// print replace_string(domain_dns_name, &quot;.&quot;, &#39;,DC=&#39;)<br>let  msa_dn = strcat(msa_cn, &#39;,DC=&#39;, replace_string(domain_dns_name, &quot;.&quot;, &#39;,DC=&#39;));<br>SecurityEvent<br>| where EventID == 5137<br>| where EventData has &quot;msDS-DelegatedManagedServiceAccount&quot;<br>| extend EventData = parse_xml(EventData)<br>| extend EventData = EventData.EventData.Data<br>| mv-apply EventData on (<br>    project k = tostring(EventData[&#39;@Name&#39;]), v = EventData[&#39;#text&#39;]<br>    | project p = bag_pack(k, v)<br>    | summarize edata_p = make_bag(p)<br>)<br>| evaluate bag_unpack(edata_p, columnsConflict=&quot;replace_source&quot;)<br>| where ObjectDN !endswith msa_dn</pre><h4>2. Target (Legacy) Account Not Disabled After dMSA Linking</h4><p>During a legitimate migration, the legacy account is automatically disabled. Assuming the low-privileged user not having rights on the targeted account, we can flag dMSA linking without disabling the target account. I’m leaving this query as an exercise for the reader ;)</p><h4>3. Suspicious msDS-DelegatedMSAState Values</h4><p>Setting this attribute to 2 is essential for <strong>BadSuccessor</strong> but is not observed in legitimate migrations. We can flag this event. Keep in mind that future hotfixes/patches on Windows Server 2025 may result in this event being generated for legitimate dMSA migrations.</p><pre>SecurityEvent<br>| where EventID == 5136<br>| where EventData has_all  (&quot;msDS-DelegatedManagedServiceAccount&quot;, &quot;msDS-DelegatedMSAState&quot;)<br>| extend EventData = parse_xml(EventData)<br>| extend EventData = EventData.EventData.Data<br>| mv-apply EventData on (<br>    project k = tostring(EventData[&#39;@Name&#39;]), v = EventData[&#39;#text&#39;]<br>    | project p = bag_pack(k, v)<br>    | summarize edata_p = make_bag(p)<br>)<br>| evaluate bag_unpack(edata_p, columnsConflict=&quot;replace_source&quot;)<br>| where AttributeValue == 2</pre><h4>4. Malformed dMSA Security Descriptor</h4><p>Currently, BadSuccessor tools that are tested omit setting the <strong>msDS-GroupMSAMembership</strong> attribute, resulting in malformed descriptors. This is a strong indicator of tool-based exploitation. However, it can easily be fixed I think. Therefore, don’t rely 100% on this detection.</p><pre>SecurityEvent<br>| where EventID == 5136<br>| where EventData has_all  (&quot;msDS-DelegatedManagedServiceAccount&quot;, &quot;msDS-GroupMSAMembership&quot;)<br>| extend EventData = parse_xml(EventData)<br>| extend EventData = EventData.EventData.Data<br>| mv-apply EventData on (<br>    project k = tostring(EventData[&#39;@Name&#39;]), v = EventData[&#39;#text&#39;]<br>    | project p = bag_pack(k, v)<br>    | summarize edata_p = make_bag(p)<br>)<br>| evaluate bag_unpack(edata_p, columnsConflict=&quot;replace_source&quot;)<br>| where AttributeValue == &quot;Malformed Security Descriptor&quot;</pre><h3>Conclusion</h3><p>The BadSuccessor is quite a dangerous attack and can’t be detected without manual audit configurations. Once the correct auditing is configured, it becomes trivial to detect this threat. Keep in mind that obect-level auditing must be configured on the domain level (targeting all OUs) for full coverage.</p><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master KQL for Threat Hunting, Detection Engineering, and DFIR in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uZRXXMR9cMT6dkXN.png" /></figure><p>Mehmet is the founder of <a href="https://academy.bluraven.io/"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized four times as a <strong>Microsoft Security MVP</strong>, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eff0fec6ee5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your Logs are Lying: How Network Infrastructure Impacts EDR Network Telemetry]]></title>
            <link>https://mergene.medium.com/your-logs-are-lying-how-network-infrastructure-impacts-edr-network-telemetry-150df879cfc6?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/150df879cfc6</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[telemetry]]></category>
            <category><![CDATA[xdr]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[edr]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Sat, 05 Jul 2025 14:11:40 GMT</pubDate>
            <atom:updated>2025-07-05T14:11:40.283Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3caPo-fp_5kr-WBx" /><figcaption>Photo by <a href="https://unsplash.com/@thomasjsn?utm_source=medium&amp;utm_medium=referral">Thomas Jensen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Detection engineers rely heavily on EDR for visibility into network activity originating from endpoints. But what if your infrastructure is quietly obscuring the truth? A common blind spot emerges from how organizations deploy Web proxies, a core component in enterprise network security to filter and enforce policies on Web traffic, that can severely distort the fidelity of network telemetry captured by EDRs.</p><h3>Web Proxy Deployments: Transparent vs. Explicit</h3><p>All organizations use Web proxy solutions to control, filter, and log outbound web traffic. These proxies are typically deployed in two configurations:</p><ul><li><strong>Transparent Proxy:</strong> In this setup, Web traffic is silently intercepted and redirected to the proxy without any explicit client-side configuration. The client is unaware of the proxy’s presence, and traffic flows through it automatically.</li><li><strong>Explicit Proxy: </strong>Here, the proxy is directly configured in the client’s network settings or enforced via Group Policy, WPAD, or PAC (Proxy Auto-Config) files. Clients send their HTTP/HTTPS requests directly to the proxy, which then makes the outbound request on their behalf.</li></ul><h3>How Web Proxy Deployment Method Impacts EDR Telemetry</h3><p>The architectural choice of Web proxy deployment has significant impact on EDR solutions that rely on network telemetry. In a transparent proxy deployment, EDR tools can observe the true destination IP addresses of outbound connections. This allows analysts to build detection rules or threat-hunting queries that spot communication with known/unknown malicious infrastructure.</p><p>However, with explicit Web proxy deployments, the picture changes dramatically. Since clients are configured to send their requests directly to the proxy, EDR agents records the proxy’s IP address as the destination, not the final target. This introduces a critical blind spot. Malware implants, which are often proxy-aware, seamlessly use the corporate proxy to reach their command-and-control (C2) servers. The result: your detection rules looking for C2 IPs or suspicious geolocations are rendered ineffective because the logs only reflect benign, internal proxy addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qpoQ69ghqo5Oy5_i.png" /></figure><h3>Is All Context Lost?</h3><p>Luckily, depending on how the EDR agent monitors the network activity, some context may still be available.</p><h4>URL and Hostname Visibility</h4><p>EDR agents like Microsoft Defender for Endpoint can inspect the traffic and still capture the URL or the hostname information even if the destination IP appears to be the proxy. This can enable hostname-based detections.</p><h4>DNS Telemetry</h4><p>DNS Telemetry: If the EDR agent monitors DNS queries on the endpoint, it can still provide visibility into the original destination’s IP address and domain name. Microsoft Defender for Endpoint (MDE), for example, includes this data in the <strong>DnsConnectionInspected</strong> event, which can be used for reconstructing a session’s real destination IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*di-7-udoyVihfUvG.png" /></figure><h4>Web Proxy Telemetry</h4><p>Since organizations usually collect Web proxy logs, EDR and Web Proxy telemetry can be correlated to reveal the real destination IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X_HdtvdL1co_BXtx.png" /></figure><h3>Conclusion</h3><p>Understanding your network infrastructure is not optional, it’s essential. Proxy deployment (and other network appliances) architecture can directly shape what your EDR sees and what it misses. Detection engineers and threat hunters must factor in proxy configurations when building detection logic and analyzing telemetry. Otherwise, they risk chasing shadows, or worse, missing real threats that hide behind the safe-looking logs of a Web proxy.</p><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master KQL for Threat Hunting, Detection Engineering, and DFIR in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*65fSCOGjEu7RtmMY.png" /></figure><p>Mehmet is the founder of <a href="https://academy.bluraven.io/"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized four times as a <strong>Microsoft Security MVP</strong>, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=150df879cfc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Querying Azure Resource Graph without Limits Using KQL]]></title>
            <link>https://mergene.medium.com/querying-azure-resource-graph-without-limits-using-kql-d04640c8ae2a?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/d04640c8ae2a</guid>
            <category><![CDATA[sentinel]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[kql]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Thu, 03 Jul 2025 16:59:55 GMT</pubDate>
            <atom:updated>2025-07-03T16:59:55.272Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the cool features of Microsoft Sentinel and Defender XDR is that they allow us to query Azure resources using KQL. However, this capability has limitations which makes it unusable in large environments. In this post, I’ll explain how to query Azure resources using KQL and bypassing the limits.</p><h3>Scenario</h3><p>You want to list all primary endpoints of all storage accounts in your Azure environment so that you can whitelist them when running your hunting query.</p><h4>Querying Azure Resources Using KQL</h4><p>You can query storage accounts using the KQL query below:</p><pre>arg(&quot;&quot;).Resources<br>| where type has &quot;storageAccounts&quot;</pre><p>Azure Resource Graph returns maximum 1000 results when querying it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kk94My17K1R9r6j-uQYfPA.png" /></figure><p>If we just count the number of storage accounts, we see there are 2510 storage accounts in the environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qtSdy-w4g__70w7xE_hpag.png" /></figure><p>How can we get all the data?</p><h4>First Try</h4><p>What if we summarize all the results into a list using make_list() and then expand all of them using mv-expand?</p><blockquote>The primary endpoints information is stored under properties.primaryEndpoints and contains the URLs for blob, table, queue, etc. services</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWg4fXRE8FFlaelb9_4j7A.png" /></figure><p>Summarizing into a list works. How about mv-expand?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpRk3j4dP_9Nd9xH2TWSBg.png" /></figure><p>Unfortunately, we hit the mv-expand limit of Azure Resource Graph.</p><h4>The Why</h4><p>We get this error because the query runs on Azure Resource Graph. Normally, we don’t have any limitations on the mv-expand operator on Microsoft Sentinel or Defender XDR.</p><p>How can we achieve our goal?</p><h3>Enter Cross-cluster Join</h3><p>From the <a href="https://learn.microsoft.com/en-us/kusto/query/join-cross-cluster">docs</a>:</p><blockquote>A cross-cluster join involves joining data from datasets that reside in different clusters.</blockquote><blockquote>In a cross-cluster join, the query can be executed in three possible locations, each with a specific designation for reference throughout this document:</blockquote><blockquote><em>- Local cluster</em>: The cluster to which the request is sent, which is also known as the cluster hosting the database in context.</blockquote><blockquote><em>- Left cluster</em>: The cluster hosting the data on the left side of the join operation.</blockquote><blockquote><em>- Right cluster</em>: The cluster hosting the data on the right side of the join operation.</blockquote><blockquote><strong>The cluster that runs the query fetches the data from the other cluster.</strong></blockquote><p>Since both Microsoft Sentinel and Defender XDR run on Kusto clusters, we can fetch the data onto them and perform the operation. To do that, we need to specify a join hint and say “perform the operation on Sentinel/Defender”.</p><p>But first, we need some data on Sentinel to join with Azure Resource Graph data. How about creating a dummy table and performing a fullouter join on a dummy key?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlOcUJ_wyq8yTu9emaODmQ.png" /></figure><p>That works! We are able to list all storage accounts with this simple trick! There is still a small issue that we get all primary endpoints in a JSON format, which is easy to solve with an array kind mv-expand:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8gvDe_koHpFKsP33RmrTMQ.png" /></figure><p>We can now do the whitelisting, or whatever we want in our query.</p><h3>Conclusion</h3><p>Although Azure Resource Graph has limitations, we can bypass them by fetching the data to our Kuso cluster, be it ADX, Sentinel, Defender, and perform operations. This, of course, doesn’t apply only to the storage accounts; we can do the same for any resource.</p><p>The query:</p><pre>let dummy_table = datatable (primary_endpoints:dynamic, dummy_num:long) [<br>    dynamic([]), 1<br>]<br>;<br>let strg_acc = materialize(<br>    arg(&quot;&quot;).Resources<br>    | where type has &quot;storageAccounts&quot;<br>    | project primary_endpoints = properties.primaryEndpoints    <br>    | summarize primary_endpoints = make_list(primary_endpoints)<br>    | extend dummy_num=long(1)<br>)<br>;<br>dummy_table<br>| join hint.remote=left kind=fullouter  strg_acc on dummy_num<br>| project primary_endpoints = primary_endpoints1<br>| mv-expand primary_endpoints<br>| mv-expand kind=array primary_endpoints<br>| project endpoint = tostring(primary_endpoints[1])</pre><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master KQL for Threat Hunting, Detection Engineering, and DFIR in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vuAFj7U07qt2lPV6.png" /></figure><p>Mehmet is the founder of <a href="https://academy.bluraven.io/"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized four times as a <strong>Microsoft Security MVP</strong>, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d04640c8ae2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detecting Vulnerable Drivers (a.k.a.]]></title>
            <link>https://mergene.medium.com/detecting-vulnerable-drivers-a-k-a-a903ffcc2f1d?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/a903ffcc2f1d</guid>
            <category><![CDATA[byovd]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Fri, 30 May 2025 14:54:08 GMT</pubDate>
            <atom:updated>2025-05-30T14:54:08.253Z</atom:updated>
            <content:encoded><![CDATA[<h3>Detecting Vulnerable Drivers (a.k.a. LOLDrivers) the Right Way Using Microsoft Defender for Endpoint</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0wJN6AEzaIFimJDdTUEOg.png" /></figure><p>A recent poll I conducted revealed a concerning gap in understanding around how to detect vulnerable drivers using Microsoft Defender for Endpoint (MDE) telemetry. The results prompted this post; not just to clarify, but to help prevent the propagation of inaccurate detection methods.</p><h4>Misconceptions in Driver Load Events</h4><p>In the poll, 21% of respondents selected a table that doesn’t even exist in MDE. Even more troubling, 46% chose the <strong>ImageLoadEvents</strong> table (referring to <strong>DeviceImageLoadEvents</strong>), which is an actual table but doesn’t contain driver load events. <strong>Only 33% answered correctly.</strong></p><p>Let’s set the record straight. The <strong>DeviceImageLoadEvents</strong> table, as you see in the documentation, logs DLL load activity, not driver loads. Drivers typically use the .sys file extension, not .dll. If you’ve ever seen a driver in DLL format, I’d genuinely be interested to know.</p><h4>The Correct Data Source: DeviceEvents</h4><p>To accurately detect driver loads, use the <strong>DeviceEvents</strong> table where ActionType == &quot;DriverLoad&quot;. If you don’t know where and how driver load events are logged, you could just do a search in (Table_Name) FileName:”.sys” to identify these events by filtering on .sys file extensions (or simply examining distinct ActionType values for each table).</p><p>Here’s where things also go off-track: AI-generated responses often mislead. For example, some models might suggest queries like:</p><pre>DeviceFileEvents<br>| where ActionType == &quot;DriverLoad&quot; // there isn&#39;t such event in file events</pre><p>or:</p><pre>DeviceImageLoadEvents<br>| where ActionType == &quot;DriverLoad&quot; // there isn&#39;t such event in image load events.</pre><p>These queries are incorrect. While AI can be useful, always validate your detection logic, especially before sharing it publicly to help others (?!?!!?).</p><h4>A Reliable KQL Example Using LOLDrivers.io</h4><p>To detect known vulnerable drivers (LOLDrivers) using MDE telemetry, here’s a query that pulls the data from the <a href="https://www.loldrivers.io/">loldrivers.io</a> dataset and joins it with legitimate driver load events both on SHA1 and SHA256 values since there are some missing SHA1 or SHA256 values in LOLDrivers:</p><pre>let LOLDrivers = externaldata (Category:string, KnownVulnerableSamples:dynamic, Verified:string ) [h@&quot;https://www.loldrivers.io/api/drivers.json&quot;]<br>    with (format=multijson, ingestionMapping=&#39;[{&quot;Column&quot;:&quot;Category&quot;,&quot;Properties&quot;:{&quot;Path&quot;:&quot;$.Category&quot;}},{&quot;Column&quot;:&quot;KnownVulnerableSamples&quot;,&quot;Properties&quot;:{&quot;Path&quot;:&quot;$.KnownVulnerableSamples&quot;}},{&quot;Column&quot;:&quot;Verified&quot;,&quot;Properties&quot;:{&quot;Path&quot;:&quot;$.Verified&quot;}}]&#39;)<br>| mv-expand KnownVulnerableSamples<br>| extend SHA1 = tostring(KnownVulnerableSamples.SHA1), SHA256 = tostring(KnownVulnerableSamples.SHA256)<br>;<br>DeviceEvents<br>| where ActionType == &quot;DriverLoad&quot;<br>| join kind=inner (LOLDrivers | where isnotempty(SHA256)) on SHA256<br>| union (<br>  DeviceEvents<br>  | where ActionType == &quot;DriverLoad&quot;<br>  | join kind=inner (LOLDrivers | where isnotempty(SHA1)) on SHA1<br>)</pre><h4>Final Thoughts</h4><p>Incorrect guidance, whether from AI tools or well-meaning individuals, can dilute the effectiveness of detection engineering. Always verify your queries using documentation and telemetry validation. Precision matters when you’re building detections.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a903ffcc2f1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C2 Beaconing Detection with MDE Aggregated Report Telemetry]]></title>
            <link>https://mergene.medium.com/c2-beaconing-detection-with-mde-aggregated-report-telemetry-b6943f397b7d?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6943f397b7d</guid>
            <category><![CDATA[detection-engineering]]></category>
            <category><![CDATA[threat-hunting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[xdr]]></category>
            <category><![CDATA[threat-intelligence]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Sat, 15 Mar 2025 11:45:21 GMT</pubDate>
            <atom:updated>2025-03-15T11:45:21.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kaBnl7MUCl4t8SEouUTbXg.png" /></figure><p>Microsoft has recently introduced a new telemetry feature in Defender for Endpoint: <a href="https://techcommunity.microsoft.com/blog/microsoftdefenderatpblog/get-greater-visibility-with-aggregated-reporting-of-endpoint-telemetry-signals/4366712"><strong>Aggregated Reports</strong></a>. This new telemetry provides new opportunities for detecting malicious activities. In this post, I will demonstrate how we can leverage Aggregated Reports to identify C2 beaconing activity.</p><h3>Aggregated Reports in DeviceNetworkEvents</h3><p>Defender for Endpoint generates two aggregated report events, <strong><em>ConnectionSuccessAggregatedReport</em></strong> and <strong><em>ConnectionFailedAggregatedReport</em></strong>, for network activity on an hourly-basis. While it’s not documented when MDE starts aggregating the data, it seems like the aggregation window starts when MDE service starts. Therefore, don’t expect receiving aggregated report events at the beginning of each hour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WTvRJxoA-HaSs-Sf.png" /></figure><h3>Detecting Beaconing Activity with Aggregated Reports</h3><p>Beaconing activity is typically identified by analyzing the time intervals (or time delta) between consecutive connections. The hypothesis is that beaconing follows a relatively consistent time pattern, where the time delta between connections remains uniform. While this assumption does not always hold true — especially with more sophisticated adversaries — it can be useful for detecting low/medium-profile adversaries, as well as certain periods within the beaconing activity <a href="https://www.youtube.com/watch?v=UsDqAQs9WFQ">if the adversary changes the sleep intervals during the operation</a>.</p><p>For example, the chart below illustrates the results of running a Sliver beacon with minimal sleep and jitter. This experiment showcases typical beaconing behavior with relatively predictable time intervals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sEpO-jukWZJy5lsO.png" /></figure><h4>What Does Uniform Time Delta Distribution Mean for Aggregated Reports?</h4><p>If beaconing activity follows a uniform time delta distribution, we can expect a consistent number of connections over specific time intervals — whether that be every hour, every 30 minutes, or other defined windows. This is where aggregated reports become highly valuable. By examining the frequency of connections over several hours (e.g., 6-hour, 12-hour, 24-hour, or 48-hour windows), we can identify patterns that indicate beaconing behavior.</p><p>However, it’s important to consider factors like device uptime and time-of-day behavior. For example, the compromised device may not be powered on continuously, or the beacon may stop communicating outside of business hours. These variations must be taken into account when building detection methods.</p><h4>Developing a Detection Method</h4><p>To account for these factors, I have designed a simple detection approach:</p><ol><li>Query 2–3 days of data.</li><li>Identify at least four aggregated report events per day with similar connection counts.</li></ol><p>With a little bit of <a href="https://academy.bluraven.io/course/advanced-kql-threat-hunting-detection-engineering">time series analysis</a> knowledge, it is easy to develop the detection logic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OGhEZEYWn-l7l2nv.png" /></figure><p>While this method is not foolproof, it provides a good starting point for detecting potential beaconing activity. Below is the query that can be used for this detection. It’s also available on my <a href="https://github.com/Cyb3r-Monk/Threat-Hunting-and-Detection/blob/main/Command%20and%20Control/Suspicious%20Network%20Beacons%20-%20MDE%20Aggregated%20Reports.md">GitHub repository</a>.</p><pre>let lookback = 3d;<br>let min_uniform_count = 4 * (lookback / 1d); // (4 uniform distribution per lookback)<br>DeviceNetworkEvents<br>| where Timestamp &gt; ago(lookback)<br>| where ActionType endswith &quot;AggregatedReport&quot;<br>| where ipv4_is_private(RemoteIP) == false<br>| extend ConnectionCount = toint(parse_json(AdditionalFields).uniqueEventsAggregated)<br>| project Timestamp = bin(Timestamp, 1h), DeviceName, InitiatingProcessFileName, RemoteIP, ConnectionCount<br>| sort by Timestamp asc <br>| summarize Timestamp = make_list(Timestamp), ConnCounts = make_list(ConnectionCount) by DeviceName, InitiatingProcessFileName, RemoteIP<br>| extend count_of_hours = array_length(Timestamp)<br>| extend anomalies_decomposed = series_decompose_anomalies(ConnCounts, 1.5, -1),<br>        series_stats(ConnCounts)<br>| mv-apply anomaly = anomalies_decomposed to typeof(int) on (<br>                summarize inliner_count = countif(anomaly !in (-1, 1)), outlier_count = countif(anomaly in (-1, 1))<br>    )<br>| where inliner_count &gt;= min_uniform_count and series_stats_ConnCounts_avg &gt; 45 // avg=45 is roughly 1 min sleep with some jitter<br>| sort by series_stats_ConnCounts_avg desc <br>| extend FirstConnection = Timestamp[0], LastConnection=Timestamp[-1], avg_conn_count=toint(series_stats_ConnCounts_avg)<br>| project-reorder FirstConnection, LastConnection, DeviceName, InitiatingProcessFileName, RemoteIP, count_of_hours, inliner_count, outlier_count, avg_conn_count</pre><h3>Final Thoughts</h3><p>This approach is <strong>not a definitive detection technique</strong> but rather a starting point for hunting beaconing activity using aggregated reports. There is <strong>room for improvement</strong>, and I plan to implement further enhancements in future iterations.</p><p>Happy hunting!</p><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master KQL for Threat Hunting, Detection Engineering, and DFIR in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><figure><a href="https://academy.bluraven.io/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dEjJUHokAFoLhLbYZKaajg.png" /></a></figure><p>Mehmet is the founder of <a href="https://academy.bluraven.io/?source=about_page-------------------------------------"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized four times as a <strong>Microsoft Security MVP</strong>, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6943f397b7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microsoft Sentinel Internals: Hidden Gems in the SecurityAlert Table]]></title>
            <link>https://mergene.medium.com/microsoft-sentinel-internals-hidden-gems-in-the-securityalert-table-34bf656f0c42?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/34bf656f0c42</guid>
            <category><![CDATA[microsoft-sentinel]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[kql]]></category>
            <category><![CDATA[soar]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Fri, 06 Dec 2024 14:47:10 GMT</pubDate>
            <atom:updated>2024-12-06T14:47:10.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g_mjC91xiuXdiDoZXekI_A.png" /></figure><p>Have you ever wondered how Microsoft Sentinel generates alerts and stores them in the <strong>SecurityAlert</strong> table? Recently, while working on a custom Workbook, I explored this table in depth to see what additional insights it might hold. What I found was more than just metadata about alerts — there are some lesser-known features that can significantly enhance investigations and automation. In this blog, I’ll share my findings, particularly focusing on well-known <strong>Entities</strong> and the lesser-known <strong>ExtendedProperties</strong> columns.</p><h3>Entities Column</h3><p>When Microsoft Sentinel generates an alert, it includes a well-known column called <strong>Entities</strong>. This column contains information about the key objects involved in the alert, such as IP addresses, users, or devices. The <strong>Entities</strong> field is both populated by Sentinel analytic rules and other Microsoft Security products. It is useful for performing analysis on top of alerts.</p><h3>ExtendedProperties: The Hidden Goldmine</h3><p>While the <strong>Entities</strong> column is commonly used, the <strong>ExtendedProperties</strong> column contains additional information that might be often overlooked. There are two keys stand out in this JSON string field:</p><h4>OriginalQuery</h4><p>The <strong>OriginalQuery</strong> key within the <strong>ExtendedProperties</strong> column stores the exact KQL query that was run. It’s useful for investigating changes to the query logic over time or troubleshooting analytic rule behavior.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kxJ7AuD4sq9-MyAP2tCJUw.png" /></figure><h4><strong>Query</strong></h4><p>This key contains a cryptic piece of code that might not seem immediately useful at first glance. However, upon closer inspection, I found that it holds a unique treasure trove of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-NCfoTnczTc_PhmBAn4TYQ.png" /></figure><h4><strong>Unlocking the Raw Event</strong></h4><p>Curious about what the <strong>Query</strong> key contained, I copied its value and executed it. To my surprise, it revealed the <strong>raw event</strong> that caused the alert to be generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_1ukx6rqpx3sMZRkKesW9w.png" /></figure><h4><strong>Why Is This Important?</strong></h4><p>The raw event provides the exact context of what triggered the alert. While the <strong>Entities</strong> column is great for summarizing impacted objects, the raw event can include additional details that might not be explicitly mapped to entities.</p><p>Although manually copying and pasting the <strong>Query</strong> key’s value to view raw events is far from efficient, with a simple KQL trick, you can extend it in the query and include the raw event in the results.</p><p>Here’s how to do it:</p><pre>SecurityAlert<br>// | where DisplayName == &quot;Logon with NewCredentials&quot; // Filter certain alerts or analyze all<br>| extend _alertedEvent = parse_json(ExtendedProperties).Query<br>| parse _alertedEvent with * &quot;[&#39;&quot; compressedRec &quot;&#39;]&quot; *<br>| extend OriginalEvent = todynamic(zlib_decompress_from_base64_string(compressedRec))<br>| project AlertGenerated = TimeGenerated, AlertName, Entities, OriginalEvent<br>| evaluate bag_unpack(OriginalEvent)</pre><p>The result? A clean and enriched alert view with raw event data seamlessly integrated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7o-xDs2tOlTMwuoMEJZNzg.png" /></figure><h3><strong>Limitations</strong></h3><p>While this having the raw event inside a key is powerful, there are a few limitations to keep in mind:</p><p><strong>Scope</strong>: This method applies only to alerts generated by <strong>Analytics Rules</strong> in Microsoft Sentinel. Alerts ingested from other Microsoft Security products (e.g., Defender for Endpoint or Defender for Office 365) do not include this information.</p><p><strong>Size Limit</strong>: The <strong>Query</strong> key has a data limit of 10 KB (10,240 bytes). If your analytic rule query results exceed this size due to unnecessary data or verbose results, the raw event gets dropped, and you’ll see a warning indicating the data size limit.</p><h3><strong>Conclusion</strong></h3><p>The <strong>Query</strong> key in the <strong>ExtendedProperties</strong> column holds an often-overlooked gem: the raw event that triggered the alert. By parsing this data, you can enhance your investigations, build richer Workbooks, and enable smarter automations.</p><p>While this feature is quite useful, it’s important to manage analytic rule queries efficiently to stay within the size limit and avoid losing critical data. With proper usage, the raw event hidden inside the <strong>Query</strong> can become a valuable tool in your Microsoft Sentinel arsenal.</p><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master KQL for Threat Hunting, Detection Engineering, and DFIR in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><figure><a href="https://academy.bluraven.io/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dEjJUHokAFoLhLbYZKaajg.png" /></a></figure><p>Mehmet is the founder of <a href="https://academy.bluraven.io/?source=about_page-------------------------------------"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized four times as a Microsoft Security MVP, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34bf656f0c42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[EDR Silencer and Beyond: Exploring Methods to Block EDR Communication — Part 2]]></title>
            <link>https://mergene.medium.com/edr-silencer-and-beyond-exploring-methods-to-block-edr-communication-part-2-5b96d81c1ba3?source=rss-f7cc596dfe41------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b96d81c1ba3</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[edr-bypass]]></category>
            <category><![CDATA[edr]]></category>
            <category><![CDATA[red-team]]></category>
            <dc:creator><![CDATA[Mehmet Ergene]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 17:54:25 GMT</pubDate>
            <atom:updated>2024-12-01T17:56:43.951Z</atom:updated>
            <content:encoded><![CDATA[<h3>EDR Silencer and Beyond: Exploring Methods to Block EDR Communication — Part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ifgjb-iR_4y11nAWI3fSKA.png" /></figure><p>Attackers continuously innovate new ways to bypass security measures. Recently, a new technique called <a href="https://github.com/netero1010/EDRSilencer">EDR Silencer</a> has gained attention for its ability to disable EDR solutions. The method works by leveraging Windows Firewall rules to block EDR agents’ communication with their management centers, effectively cutting off telemetry, resulting in no telemetry or alert generated on the management console.</p><p>While EDR Silencer uses the Windows Filtering Platform (WFP) to achieve its goal, this blog will highlight alternative methods attackers can use to block EDR communication, emphasizing the need for awareness and proactive defense. While discussing with Fabian Bader, we have come up with a few alternative methods. This “Part 2” blog is the continuation of <a href="https://cloudbrothers.info/en/edr-silencers-exploring-methods-block-edr-communication-part-1">Fabian Bader’s Part 1 blog where he explains NRPT</a>.</p><h3>Alternative Methods to Block EDR Communication</h3><h4>Modifying the Hosts File</h4><p>Attackers can manipulate the Windows hosts file to block or redirect EDR domains to non-functional addresses (commonly referred to as “sinkholing”). With administrative privileges, this can be achieved easily using PowerShell commands. For example:</p><pre>Add-Content -Path &quot;C:\Windows\System32\drivers\etc\hosts&quot; -Value &quot;127.0.0.1 edr.domain.com&quot;</pre><p>By associating critical EDR communication domains with 127.0.0.1 or other invalid addresses, attackers effectively cut off communication between the endpoint and the EDR management center.</p><h4>Adding Custom Routes</h4><p>Another straightforward approach is to add custom routes to the Windows routing table. By directing traffic intended for EDR management servers to an unreachable or sinkhole address, attackers can prevent telemetry from reaching its destination. This can be accomplished via PowerShell or the command prompt:</p><pre>New-NetRoute -DestinationPrefix &quot;&lt;EDR_IP_SUBNET&gt;&quot; -NextHop &quot;127.0.0.1&quot; -InterfaceIndex 1</pre><h3>Attack Feasibility</h3><p>EDR solutions often rely on well-documented subnets and domains for connectivity, making it easier for attackers to target them. Combined with the accessibility of built-in Windows tools like PowerShell, these methods require minimal effort to execute.</p><h3>Mitigation Strategies</h3><p>While mitigating these attacks is challenging, the following approaches can help reduce their impact:</p><h4>Zero Trust DNS (In Private Preview)</h4><p>The <a href="https://techcommunity.microsoft.com/blog/networkingblog/announcing-zero-trust-dns-private-preview/4110366">Zero Trust DNS</a> model, currently in private preview, has the potential to mitigate DNS-related attack vectors such as those involving the hosts file and NRPT. This approach enforces strict DNS resolution policies and prevents unauthorized tampering.</p><h4>Zero Trust IP Stack</h4><p>Of course, there is no such thing. Just as an idea, EDR agents may ignore custom routes and use the default gateway on the device. I don’t know if this is even technically possible.</p><h3>Detection Strategies</h3><p>Detecting these methods poses significant challenges because once telemetry flow is blocked, the EDR solution itself is effectively blind. However, alternative log sources can help identify potential issues. For example, if a device is generating logs in the Web proxy but no EDR telemetry is coming from the device, it may indicate an EDR bypass or connectivity issue.</p><h3>Final Thoughts</h3><p>EDR silencing techniques, including the newly identified EDR Silencer method, represent a growing threat to endpoint security. While WFP-based attacks are a concern, attackers can leverage multiple alternative methods to achieve the same outcome. Awareness of these techniques is the first step in defending against them.</p><p>As defenders, focusing on detection through alternative telemetry sources and hardening configurations with features like Zero Trust DNS will be critical in staying ahead of these evolving tactics. It’s a constant race, but by understanding these methods, organizations/vendors can better prepare for and mitigate the risks posed by EDR silencing attacks.</p><p>Thanks for reading this article! If you have any questions, leave a comment below. Want to master KQL for Threat Hunting, Detection Engineering, and DFIR in a hyper-realistic environment? Visit my <a href="https://academy.bluraven.io/"><strong><em>academy</em></strong></a> for a free course!</p><figure><a href="https://academy.bluraven.io/"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dEjJUHokAFoLhLbYZKaajg.png" /></a></figure><p>Mehmet is the founder of <a href="https://academy.bluraven.io/?source=about_page-------------------------------------"><strong><em>Blu Raven Academy</em></strong>.</a> He brings over 15 years of experience in cybersecurity, with a unique blend of expertise in KQL, threat hunting, detection engineering, and data science to his courses to help others advance their skills. Recognized four times as a Microsoft Security MVP, he is renowned for adapting the RITA beacon analyzer to KQL, developing novel methods for detecting threats, and for his insightful presentations at key conferences like the SANS DFIR Summit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b96d81c1ba3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>