How to get started with Microsoft Sysinternals' Sysmon advanced event logging

Unlocking Deeper System Visibility: A Threat Hunter’s Guide to Getting Started with Sysmon

The most sophisticated cyberattacks don’t just knock on the front door; they quietly slip through the cracks. Catching them requires shining a spotlight on every corner of your system.

For threat hunters and security professionals looking to elevate their defensive capabilities, Microsoft’s System Monitor (Sysmon) is an invaluable free tool. This article will guide you through the initial steps of harnessing the power of Sysmon to significantly enhance your security posture.

What is Sysmon and Why Should You Use It?

Sysmon is a powerful monitoring tool from the Microsoft Sysinternals suite. At its core, it’s a system service and device driver that, once installed, logs a wealth of detailed system activity directly to your Windows Event Logs. This isn’t your standard event logging; Sysmon provides a granular view of what’s happening under the hood, capturing critical events that standard Windows logs often miss.

Think of Sysmon as a high-powered microscope for your operating system. It illuminates activities such as:

  • Process Creations: See every process that starts, including the full command line used to launch it.
  • Network Connections: Monitor all TCP and UDP connections, revealing which processes are communicating with the network and their destinations.
  • File Events: Track file creation, modification, and deletion, which can be crucial for detecting malware and data tampering.
  • Image and Driver Loading: Identify when DLLs or drivers are loaded, a common tactic used by malicious software.
  • Advanced Attack Techniques: Detect more sophisticated threats like remote thread creation (often seen in process hollowing) and WMI persistence.

By installing Sysmon, you’re essentially setting up a persistent surveillance system that records these detailed events across reboots. This rich data source is a game-changer for proactive threat hunting and comprehensive incident response.

Your First Steps: Installing and Configuring Sysmon

Getting started with Sysmon is a straightforward process. First, you’ll need to download it from the official Microsoft Sysmon webpage.

Once you’ve unzipped the download, you can install it via the command line. For a 64-bit system, a basic installation command is:

Bash
Sysmon64.exe -accepteula -i

This command installs Sysmon with its default configuration. While this is a good starting point, the true power of Sysmon is realized through customized configurations, which allow you to fine-tune the logging to your specific environment.

After installation, you can view the logs in the Windows Event Viewer. Navigate to Applications and Services Logs > Microsoft > Windows > Sysmon > Operational. You’ll begin to see events like process creation (Event ID 1) and process termination (Event ID 5) being logged.

Making Sense of Sysmon Event IDs

Sysmon categorizes the activities it logs using specific Event IDs. Understanding these is key to effectively analyzing the data. Some of the most critical Event IDs include:

Event IDDescriptionDefault Status
1Process CreationEnabled
3Network ConnectionDisabled
6Driver LoadedEnabled
8CreateRemoteThreadEnabled
19, 20, 21WMI EventsDisabled
22DNS QueryDisabled

You’ll notice that some of the potentially “noisiest” events, like network connections, are disabled by default. This is to prevent the logs from becoming overwhelming. To check your current configuration, you can run:

Bash
Sysmon64.exe -c

This command will display the active configuration, including which events are being monitored and any filtering rules that are in place.

Tailoring Sysmon with a Custom Configuration

To truly harness Sysmon’s capabilities, you need to create a custom configuration file. These files are written in XML and allow you to specify exactly which events to log and, just as importantly, which to exclude.

To see the schema and all available options for your configuration file, you can run:

Bash
Sysmon64.exe -? config

Let’s walk through a practical example. Imagine you want to monitor network connections but want to exclude the typical noise generated by web browsers. You could create a configuration file like this:

XML
 
<Sysmon schemaversion="4.82">
  <EventFiltering>
    <RuleGroup name="NetworkConnections" groupRelation="or">
      <NetworkConnect onmatch="exclude">
        <Image condition="is">C:\Program Files\Mozilla Firefox\firefox.exe</Image>
        <Image condition="is">C:\Program Files\Internet Explorer\iexplore.exe</Image>
        <Image condition="is">C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe</Image>
      </NetworkConnect>
    </RuleGroup>
  </EventFiltering>
</Sysmon>

In this example, we’re telling Sysmon to exclude network connection events (Event ID 3) if the process image matches the path of Firefox, Internet Explorer, or Microsoft Edge.

To apply this new configuration, save the XML (e.g., as my-config.xml) and run the following command:

Bash
Sysmon64.exe -c my-config.xml

With this rule in place, if a non-browser process, such as a Python script, makes a network connection, it will be logged. This allows you to focus on potentially unauthorized or malicious network activity. You would see the source and destination IP addresses, the process that initiated the connection, and other valuable details right in your event logs.

The Path Forward: From Basic Setup to Advanced Threat Detection

This has been a quick look at getting Sysmon up and running. By moving beyond the default settings and creating even simple custom configurations, you can dramatically reduce noise and focus on the events that matter most.

The real power of Sysmon becomes apparent when you start designing configurations tailored to your specific enterprise environment. You can create different rules for different user groups – for example, excluding network traffic from Adobe products for your design team while scrutinizing it elsewhere.

In our next discussion, we’ll dive into more advanced rule creation, exploring how to map Sysmon configurations to the known TTPs of advanced attackers. This is where Sysmon transitions from a logging tool to a truly proactive threat detection engine. We hope this guide has been helpful, and we encourage you to explore the possibilities that Sysmon can bring to your security program.

See how Insane Cyber transforms security

Our products are designed to work with
you and keep your network protected.