Code Monkey home page Code Monkey logo

ion-storm / sysmon-config Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swiftonsecurity/sysmon-config

763.0 87.0 144.0 1.6 MB

Advanced Sysmon ATT&CK configuration focusing on Detecting the Most Techniques per Data source in MITRE ATT&CK, Provide Visibility into Forensic Artifact Events for UEBA, Detect Exploitation events with wide CVE Coverage, and Risk Scoring of CVE, UEBA, Forensic, and MITRE ATT&CK Events.

License: GNU Lesser General Public License v2.1

PowerShell 100.00%
sysmon threatintel threat-hunting netsec sysinternals logging graylog graylog-plugin dfir threat-intelligence threat-sharing threat-analysis mitre-attack digitalforensics forensic-analysis forensicartifacts forensics siem sigma-rules humio

sysmon-config's Introduction

Sysmon ATT&CK Configuration

The file provided should function as a great starting point for system monitoring in a self-contained package. This configuration and results should give you a good idea of what's possible for Sysmon. Please beware that you may need to fine tune and add exclusions depending on your environment. High CPU usage may be seen if exclusions are not added and one or more rules are firing off multiple times every second.

      sysmonconfig-export.xml

Pull requests and issue tickets are welcomed. Any new additions will be credited in-line or on Git. Tag your name with Author=YourName within the rulename field.

This Sysmon ATT&CK Configuration is designed "Explicitly" to enrich your SIEM for threat intelligence, forensics, and UEBA use cases. You'll want to create a key-value parser for the rulename field to create field names per event within your SIEM.
Ideally this is best used with an Alerting Repository/Index where the "Alert=" field is marked and a non-alerting visibility index/repository where threat hunting and investigations can be done that contains added context and story line information of user behavior and activity leading up to an attack. Non-Alerting visibility rules are tagged with "Desc=" and "Forensic=" and are meant to provide contextual information for analysts to build cases and identify what is happening with SIEM enrichments. Some of these non-alerting visibility rules can be graduated to the Alerting rules or can be used with correlation rules within a SIEM/SOAR/XDR.

The goal with this configuration is a "Control" configuration that provides ultimate visibility that should be ran in conjunction with an EDR.
As we know, allot of EDR's today provide little contextual information, forensic information that is tagged, categorized, risk rated, and some alerts EDR vendors choose to not alert on due to the differences between each environment and how hard it is to baseline some detections. There is many use cases where EDR's fall short. They are not the greatest at identifying suspicious activity that may fall short of being labeled as malicious. The goal here is to detect all common user activity that would lead to exfiltration, infiltration, malware, malicious activity, and questionable activity. If a user is poking around the registry, sending data to cloud storage, downloading and executing random attachments and files, and/or copying files, we want to know. We also want to leave an audit trail by monitoring the registry, artifact locations, and provide our forensic analysts as much detail as possible.

If you have forensic registry keys, file locations, artifacts, behavior detections, and anything that may be beneficial here, feel free to put in a pull request.
The goal here is as much visibility as possible with accurate alerts that are not noisy.

Use

Auto Install with Auto Update Script

The two below PowerShell scripts that are contained in this repo will download and install Sysmon and the config along with creating a scheduled task to run hourly to update the config.

Sysmon Install.ps1
SysmonUpdateConfig.ps1

Install

Run with administrator rights.

sysmon.exe -accepteula -i sysmonconfig-export.xml

Update Existing Configuration

Run with administrator rights.

sysmon.exe -c sysmonconfig-export.xml

Uninstall

Run with administrator rights.

sysmon.exe -u

Hide Sysmon from services.msc

Hide:
sc sdset Sysmon D:(D;;DCLCWPDTSD;;;IU)(D;;DCLCWPDTSD;;;SU)(D;;DCLCWPDTSD;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
Restore:
sc sdset Sysmon D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)

sysmon-config's People

Contributors

cyberkryption avatar darkbat91 avatar dweee avatar ion-storm avatar mmazanec avatar nerbalone avatar rmanly avatar rpunt avatar swiftonsecurity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sysmon-config's Issues

powershell.exel

In code Ivent ID 27
<Rule name="Level=0,Desc=Block Powershell from downloading EXE" groupRelation="and"> <Image condition="contains any">powershell.exel;

Error 255 appears, please help me figure it out.

Please help me figure out how to fix these errors or eliminate them. Events with msgid 255 from sysmon appear in the SIEM system on the host where this config is installed.

Contents of the following event data:

"text": "Events dropped from driver queue: ProcessAccess:1",
"text": "Events dropped from driver queue: ImageLoad:2",
"text": "Events dropped from driver queue: ImageLoad:1 ProcessAccess:16",
"text": "Events dropped from driver queue: ImageLoad:1 ProcessAccess:51 RegistryEvent:4",
"text": "Events dropped from driver queue: ImageLoad:3 ProcessAccess:4 RegistryEvent:4",

Here is the full log:

{
"Event": {
"xmlns": "http://schemas.microsoft.com/win/2004/08/events/event",
"System": {
"Provider": {
"Name": "Microsoft-Windows-Sysmon",
"Guid": "{5770385f-c22a-43e0-bf4c-06f5698ffbd9}"
},
"EventID": "255",
"Version": "3",
"Level": "2",
"Task": "255",
"Opcode": "0",
"Keywords": "0x8000000000000000",
"TimeCreated": {
"SystemTime": "2024-03-01T08:22:36.7399186Z"
},
"EventRecordID": "1239498",
"Correlation": null,
"Execution": {
"ProcessID": "4300",
"ThreadID": "6532"
},
"Channel": "Microsoft-Windows-Sysmon/Operational",
"Computer": "h43-12-4-21211.company.com.local",
"Security": {
"UserID": "S-1-5-18"
}
},
"EventData": {
"Data": [
{
"text": "2024-03-01 08:22:36.738",
"Name": "UtcTime"
},
{
"text": "QUEUE",
"Name": "ID"
},
{
"text": "Events dropped from driver queue: ProcessAccess:1 RegistryEvent:1",
"Name": "Description"
}
]
}
}
}

Duble configs

Hello! I think that the Syssysmonconfig-export_blocking.xml and Syssysmonconfig-export.xml configs are duplicated.

Event ID 27

Hello! Please tell me where did the Event ID 27: FileBlockExecutable go from the config? Was it removed on purpose?

Sysmon schema version

When using the last version of sysmon (sysmon 7.03), the schema version is not supported.

Error:
Error: Incorrect or unsupported schema version 3.30.
Current Sysmon schema version 4.00.

howto add this rule properly, help please

Hi,

thanks for your rule-set. I am using the free forti-client anti-virus, which uses pipes. I have added some rules but cant get sysmon to stop logging it.

The logging is like this:

2017-11-03T22:08:33+00:00 hanscees-PC Microsoft-Windows-Sysmon[3028]: Pipe Connected:  
UtcTime: 2017-11-03 21:08:33.115  ProcessGuid: {CD739E67-C2F2-59FC-0000-0010898F0200}  
ProcessId: 1740  PipeName: \FortiWebFilterNamedPipe  Image: C:\Program Files 
(x86)\Fortinet\FortiClient\FortiProxy.exe

I have tried to make sysmon logging stop by adding these rules before all other rules in the xml file:

	<PipeEvent onmatch="exclude">
		<Image condition="image">FortiProxy.exe</Image>
	</PipeEvent>

Doesn't it read the rules form top to bottom and then quit after the first hit?

Add Antivirus exclusions

Please add exclusions for ESET and Kaspersky antiviruses in Event ID 3 and Event ID 10 and Event ID 12 & 13 & 14

Example for Kaspersky
ID3
<!--SECTION: Antivirus --> <Image condition="begin with">C:\Program Files (x86)\Kaspersky Lab</Image> <Image condition="begin with">C:\Program Files\Kaspersky Lab</Image>

ID10
<Rule name="Antivirus" groupRelation="or"> <SourceImage condition="begin with">C:\Program Files (x86)\Kaspersky Lab</SourceImage> <SourceImage condition="begin with">C:\Program Files\Kaspersky Lab</SourceImage> </Rule>

ID14
<RuleGroup name="RG=RegistryEvent Exclude Group" groupRelation="or"> <RegistryEvent onmatch="exclude"> <Image condition="begin with">C:\Program Files (x86)\Kaspersky Lab</Image> <Image condition="begin with">C:\Program Files\Kaspersky Lab</Image> </RegistryEvent> </RuleGroup>

`condition="excludes"` with `groupRelation="or"`

Is condition="excludes" correct with groupRelation="or"?

<Rule name="Attack=T1036,Technique=Masquerading,Tactic=Defense Evasion,Risk=20,Level=0,Desc=Monitor Common Masquarading Locations" groupRelation="or">
<TargetFilename condition="begin with">C:\PerfLogs\</TargetFilename>
<TargetFilename condition="begin with">C:\Temp\</TargetFilename>
<TargetFilename condition="begin with">C:\Users\Default\</TargetFilename>
<TargetFilename condition="begin with">C:\Users\Public\</TargetFilename>
<TargetFilename condition="begin with">C:\Windows\Temp\</TargetFilename>
<TargetFilename condition="contains">\AppData\Temp\</TargetFilename>
<Image condition="excludes">C:\WINDOWS\system32\dxgiadaptercache.exe</Image>
</Rule>

ID 11

Add please to ID11

<Rule name="Attack=T1036,Technique=Masquerading,Tactic=Defense Evasion,Risk=20,Level=0,Desc=Files Created within System Profile" groupRelation="and">
				<TargetFilename condition="begin with">C:\Windows\</TargetFilename>
				<TargetFilename condition="contains">\config\systemprofile\</TargetFilename>
				<Image condition="excludes any">klnagent.exe;eraagent.exe;</Image>
</Rule>

For exclude many antivirus events:

File created:
RuleName: Attack=T1036,Technique=Masquerading,Tactic=Defense Evasion,Risk=20,Level=0,Desc=Monitor Common Masquarading Locations
UtcTime: 2022-09-23 06:14:58.204
ProcessGuid: {5ade46e7-3168-6324-4a01-000000009800}
ProcessId: 12908
Image: C:\Program Files (x86)\Kaspersky Lab\NetworkAgent\klnagent.exe
TargetFilename: C:\ProgramData\KasperskyLab\adminkit\1103\na_localdata\~1e2s_subscription.~1xml~1

Create contributing guidelines regarding RuleName field

There should be a contributing guide for RuleName field so that it remains consistent.

The RuleName field should either reference Mitre Attack details or be set to None for background or forensic events.

Detection
<CommandLine name="Attack=T1204,Technique=User Execution,Tactic=Execution,Level=0,Desc=Execution from Archive File,Risk=50" condition="contains">AppData\Local\Temp\7z</CommandLine><!-- exec from 7zip -->

Background / Forensic
<CommandLine name="Attack=None,Technique=None,Tactic=None,Level=0,Desc=ScriptFile execution" condition="contains">ScriptFile</CommandLine>

Question on System Performance

Hi, Thanks for putting together this rule set! its brilliant!

I had a question regarding the system performance on standard workstations. A config file with around 3k rules cause any performance issues? How many logs do you receive per 24hr period for a workstation...

I am asking this because I am not sure whether this would be safe for production use or shall I reduce the ruleset? Please let me know your thoughts!

Thanks again!

Eset

  1. Please add exclusions for ESET in the same way as for Kaspersky to ID 3, ID 10, ID 14
    for example:
<Image condition="begin with">C:\Program Files (x86)\ESET</Image>
<Image condition="begin with">C:\Program Files\ESET</Image>
  1. In ID 14 you need to create a group for exceptions:
<RuleGroup name="RG=RegistryEvent Exclude Group" groupRelation="or">
		<RegistryEvent onmatch="exclude">
			<Image condition="begin with">C:\Program Files (x86)\Kaspersky Lab</Image>
			<Image condition="begin with">C:\Program Files\Kaspersky Lab</Image>
		</RegistryEvent>
</RuleGroup>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.