Skip to content

Commit 3f3ccfe

Browse files
authored
Merge pull request #25 from NerbalOne/master
Repo Overhaul
2 parents 91c9f54 + d0cfa8a commit 3f3ccfe

9 files changed

+1665
-7133
lines changed

.gitignore

-2
This file was deleted.

Auto_Update.bat

-5
This file was deleted.

Install Sysmon.bat

-28
This file was deleted.

LICENSE.txt

+504
Large diffs are not rendered by default.

README.md

+21-27
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
# Sysmon ATT&CK Configuration #
2-
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.
2+
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.
33

44
      **[sysmonconfig-export.xml](https://github.com/ion-storm/sysmon-config/blob/master/sysmonconfig-export.xml)**
55

6-
Pull requests and issue tickets are welcome, and new additions will be credited in-line or on Git, tag your name with Author=YourName within the rulename field.
6+
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.
77

8-
This Sysmon ATT&CK Configuration is designed "Explicitly" to enrich your SIEM for threat intelligence, forensics, UEBA, use cases. You'll want to create a key-value parser for the
8+
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
99
rulename field to create field names per event within your SIEM.
10-
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, investigations can be done
11-
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
12-
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
10+
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
11+
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
12+
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
1313
to the Alerting rules or can be used with correlation rules within a SIEM/SOAR/XDR.
1414

1515
The goal with this configuration is a "Control" configuration that provides ultimate visibility that should be ran in conjunction with an EDR.
16-
As we know, allot of EDR's today provide little contextual information, forensic information that is tagged, categorized, risk rated, some alerts EDR vendors choose to not alert
17-
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
18-
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,
19-
malware, malicious activity, questionable activity. If a user is poking around the registry, sending data to cloud storage, downloading and executing random attachments and files,
20-
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.
16+
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
17+
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
18+
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,
19+
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
20+
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.
2121

22-
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.
23-
The goal here is as much visibility as possible, with accurate alerts that are not noisy.
22+
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.
23+
The goal here is as much visibility as possible with accurate alerts that are not noisy.
2424

2525

26-
This now has an Auto Updater script to update to the latest Sysmon config hourly. This is great for mass deployments without having to manually update thousands of systems.
27-
2826
## Use ##
2927

30-
### Auto-Install with Auto Update Script:###
28+
### Auto Install with Auto Update Script ###
29+
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.
3130
~~~~
32-
Install Sysmon.bat
31+
Sysmon Install.ps1
32+
SysmonUpdateConfig.ps1
3333
~~~~
3434

3535
### Install ###
36-
Run with administrator rights
36+
Run with administrator rights.
3737
~~~~
3838
sysmon.exe -accepteula -i sysmonconfig-export.xml
3939
~~~~
4040

41-
### Update existing configuration ###
42-
Run with administrator rights
41+
### Update Existing Configuration ###
42+
Run with administrator rights.
4343
~~~~
4444
sysmon.exe -c sysmonconfig-export.xml
4545
~~~~
4646

4747
### Uninstall ###
48-
Run with administrator rights
48+
Run with administrator rights.
4949
~~~~
5050
sysmon.exe -u
5151
~~~~
@@ -56,9 +56,3 @@ Hide:
5656
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)
5757
Restore:
5858
sc sdset Sysmon D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)
59-
60-
~~~~
61-
62-
### Graylog Configuration ###
63-
64-
(https://github.com/ion-storm/Graylog_Sysmon)

Sysmon Install.ps1

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#Author: NerbalOne
2+
#This PowerShell script will first create the Sysmon folder if it does not exist. It will then download Sysmon.exe, which supports both 32 bit and 64 bit, along with the Sysmon config and Sysmon Update script. It will then install Sysmon with the config and create a Scheduled Task to run hourly to update the Sysmon config.
3+
4+
# Define Sysmon URLs
5+
$sysmonURL = "https://live.sysinternals.com/sysmon.exe"
6+
$sysmonConfigURL = "https://raw.githubusercontent.com/ion-storm/sysmon-config/master/sysmonconfig-export.xml"
7+
$sysmonUpdateConfig = "https://raw.githubusercontent.com/ion-storm/sysmon-config/master/SysmonUpdateConfig.ps1"
8+
9+
# Define Local Path for Sysmon File and Sysmon Config
10+
$sysmonPath = "C:\Programdata\Sysmon\sysmon.exe"
11+
$sysmonConfigPath = "C:\Programdata\Sysmon\sysmonconfig-export.xml"
12+
$sysmonUpdatePath = "C:\Programdata\Sysmon\SysmonUpdateConfig.ps1"
13+
$sysmonFolderPath = "C:\ProgramData\Sysmon\"
14+
15+
# Create Sysmon Folder if it Doesn't Exist
16+
if (-not (Test-Path $sysmonFolderPath)) {
17+
# Create the Folder
18+
try {
19+
New-Item -ItemType Directory -Path $sysmonFolderPath -Force
20+
Write-Host "Folder created successfully at $folderPath"
21+
}
22+
catch {
23+
Write-Host "Error creating the folder: $_"
24+
}
25+
}
26+
else {
27+
Write-Host "The folder already exists at $folderPath"
28+
}
29+
30+
# Download Sysmon, Config, and Update Script
31+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
32+
Invoke-WebRequest -Uri $sysmonURL -OutFile $sysmonPath
33+
Invoke-WebRequest -Uri $sysmonConfigURL -OutFile $sysmonConfigPath
34+
Invoke-WebRequest -Uri $sysmonUpdateConfig -OutFile $sysmonUpdatePath
35+
36+
# Install Sysmon with Config
37+
Start-Process -FilePath $sysmonPath -ArgumentList "-accepteula -i $sysmonConfigPath" -NoNewWindow -Wait
38+
39+
# Create a New Scheduled Task
40+
Start-Process schtasks.exe -ArgumentList '/Create /RU SYSTEM /RL HIGHEST /SC HOURLY /TN Update_Sysmon_Rules /TR "powershell.exe -ExecutionPolicy Bypass -File "C:\Programdata\Sysmon\SysmonUpdateConfig.ps1"" /f' -Wait -WindowStyle Hidden
41+
Start-Process schtasks.exe -ArgumentList '/Run /TN Update_Sysmon_Rules' -Wait -WindowStyle Hidden
42+
43+
# Define Sysmon service Name
44+
$sysmonServiceName = "Sysmon"
45+
46+
# Check if Sysmon Service Exists
47+
try {
48+
$service = Get-Service -Name $sysmonServiceName -ErrorAction Stop
49+
Write-Output "Sysmon service exists"
50+
} catch {
51+
Throw "Sysmon service does not exist"
52+
}
53+
54+
# Check if Scheduled Task is Created Successfully
55+
try {
56+
$task = Get-ScheduledTask -TaskName "Update_Sysmon_Rules" -ErrorAction Stop
57+
Write-Output "Scheduled task created successfully"
58+
} catch {
59+
Throw "Scheduled task creation failed"
60+
}

SysmonUpdateConfig.ps1

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#Author: NerbalOne
2+
#This PowerShell script will first download the latest Sysmon config. Then it will apply this config to Sysmon.
3+
4+
# Define Sysmon Path
5+
$sysmonPath = "C:\ProgramData\Sysmon\sysmon.exe"
6+
$sysmonConfigPath = "C:\ProgramData\Sysmon\sysmonconfig-export.xml"
7+
8+
# Define Sysmon Config URL
9+
$sysmonConfigURL = "https://raw.githubusercontent.com/ion-storm/sysmon-config/master/sysmonconfig-export.xml"
10+
11+
# Download the Latest Sysmon Config
12+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
13+
Invoke-WebRequest -Uri $sysmonConfigURL -OutFile $sysmonConfigPath
14+
15+
# Run sysmon.exe with Config
16+
& $sysmonPath -c $sysmonConfigPath
17+
18+
# Check the Exit Code of the Previous Command
19+
if ($LASTEXITCODE -eq 0) {
20+
Write-Output "Sysmon executed successfully."
21+
} else {
22+
Write-Output "Sysmon execution failed."
23+
}
24+

0 commit comments

Comments
 (0)