|
1 | 1 | <!-- |
2 | | - sysmon-config | A Sysmon configuration focused on default high-quality event tracing and easy customization by the community |
3 | | - Source version: 73 | Date: 2021-02-16 |
4 | | - Source project: https://github.com/SwiftOnSecurity/sysmon-config |
5 | | - Source license: Creative Commons Attribution 4.0 | You may privatize, fork, edit, teach, publish, or deploy for commercial use - with attribution in the text. |
6 | | -
|
7 | | - REQUIRED: Sysmon version 13 or higher (due to changes in syntax and bug-fixes) |
8 | | - https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon |
9 | | -
|
10 | | - NOTE: To collect Sysmon logs centrally for free, see https://aka.ms/WEF | Command to allow log access to the Network Service: |
11 | | - wevtutil.exe sl Microsoft-Windows-Sysmon/Operational /ca:O:BAG:SYD:(A;;0xf0005;;;SY)(A;;0x5;;;BA)(A;;0x1;;;S-1-5-32-573)(A;;0x1;;;NS) |
12 | | -
|
13 | | - NOTE: Do not let the size and complexity of this configuration discourage you from customizing it or building your own. |
14 | | - This configuration is based around known, high-signal event tracing, and thus appears complicated, but it is only very |
15 | | - detailed. Significant effort over years has been invested in front-loading as much filtering as possible onto the |
16 | | - client. This is to make analysis of intrusions possible by hand, and to try to surface anomalous activity as quickly |
17 | | - as possible to technicians armed only with Event Viewer. Its purpose is to democratize system monitoring for all organizations. |
18 | | -
|
19 | | - NOTE: Sysmon is NOT a whitelist solution or HIDS correlation engine, it is a computer change logging tool. |
20 | | - Do NOT ignore everything possible. Sysmon's purpose is providing context during a threat or problem investigation. Legitimate |
21 | | - processes are routinely used by threats - do not blindly exclude them. Additionally, be mindful of process-hollowing / imitation. |
22 | | -
|
23 | | - NOTE: By default this monitors DNS, which is extremely noisy. If you are starting out on your monitoring journey, just remove that section. |
24 | | - You can remove DNS events from Event Viewer screen by applying a 'Filter Current View' for event IDs of: -22 |
25 | | - Additionally, if you want to monitor DNS, you should deploy client-side adblocking to reduce lookups. See the DNS section for info. |
26 | | -
|
27 | | - NOTE: This configuration is designed for PER-MACHINE installs of Chrome and OneDrive. That moves their binaries out of user-controlled folders. |
28 | | - Otherwise, attackers could imitate these common applications, and bypass your logging. Below are silent upgrades you can do, no user impact: |
29 | | - - https://docs.microsoft.com/en-us/onedrive/per-machine-installation |
30 | | - - https://cloud.google.com/chrome-enterprise/browser/download/ |
31 | | - - As of 2021-02-16 there is no machine-level version of Microsoft Teams. The one provided copies itself to the user profile. |
32 | | -
|
33 | | - NOTE: Sysmon is not hardened against an attacker with admin rights. Additionally, this configuration offers an attacker, willing |
34 | | - to study it, limited ways to evade some of the logging. If you are in a very high-threat environment, you should consider a broader, |
35 | | - log-most approach. However, in the vast majority of cases, an attacker will bumble through multiple behavioral traps which |
36 | | - this configuration monitors, especially in the first minutes. |
37 | | -
|
38 | | - NOTE: If you encounter unexplainable event inclusion/exclusion, you may have a second Sysmon instance installed under a different exe filename. |
39 | | - To clear this, try downloading the latest version and uninstalling with -u force. If it hangs, kill the processes and run it again to cleanup. |
40 | | -
|
41 | | - TECHNICAL: |
42 | | - - Run sysmon.exe -? for a briefing on Sysmon configuration. |
43 | | - - Sysmon XML cannot use the AMPERSAND sign. Replace it with this: & |
44 | | - - Sysmon 8+ can track which rule caused an event to be logged through the "RuleName" field. |
45 | | - - If you only specify exclude for a filtering subsection, everything in that subsection is logged by default. |
46 | | - - Some Sysmon monitoring abilities are not meant for widely deployed general-purpose use due to performance impact. Depends on environment. |
47 | | - - Duplicate or overlapping "Include" rules do not result in duplicate events being logged. |
48 | | - - All characters enclosed by XML tags are always interpreted literally. Sysmon does not support wildcards (*), alternate characters, or RegEx. |
49 | | - - In registry events, the value name is appended to the full key path with a "\" delimiter. Default key values are named "\(Default)" |
50 | | - - "Image" is a technical term for a compiled binary file like an EXE or DLL. Also, it can match just the filename, or entire path. |
51 | | - - "ProcessGuid" and "LoginGuid" are not random, they contain some embedded information. https://gist.github.com/mattifestation/0102042160c9a60b2b847378c0ef70b4 |
52 | | -
|
53 | | - FILTERING: Filter conditions available for use are: is,is any,is not,contains,contains any,contains all,excludes,excludes any,excludes all,begin with,end with,not begin with,not end with,less than,more than,image |
54 | | - - The "image" filter is usable on any field. Same as "is" but can either match entire string, or only the text after last "\". Credit: @mattifestation |
| 2 | + sysmon-config | A Sysmon configuration focused on default high-quality event tracing and easy customization by the community |
| 3 | + Source version: 73 | Date: 2021-02-16 |
| 4 | + Source project: https://github.com/SwiftOnSecurity/sysmon-config |
| 5 | + Source license: Creative Commons Attribution 4.0 | You may privatize, fork, edit, teach, publish, or deploy for commercial use - with attribution in the text. |
| 6 | +
|
| 7 | + REQUIRED: Sysmon version 13 or higher (due to changes in syntax and bug-fixes) |
| 8 | + https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon |
| 9 | +
|
| 10 | + NOTE: To collect Sysmon logs centrally for free, see https://aka.ms/WEF | Command to allow log access to the Network Service: |
| 11 | + wevtutil.exe sl Microsoft-Windows-Sysmon/Operational /ca:O:BAG:SYD:(A;;0xf0005;;;SY)(A;;0x5;;;BA)(A;;0x1;;;S-1-5-32-573)(A;;0x1;;;NS) |
| 12 | +
|
| 13 | + NOTE: Do not let the size and complexity of this configuration discourage you from customizing it or building your own. |
| 14 | + This configuration is based around known, high-signal event tracing, and thus appears complicated, but it is only very |
| 15 | + detailed. Significant effort over years has been invested in front-loading as much filtering as possible onto the |
| 16 | + client. This is to make analysis of intrusions possible by hand, and to try to surface anomalous activity as quickly |
| 17 | + as possible to technicians armed only with Event Viewer. Its purpose is to democratize system monitoring for all organizations. |
| 18 | +
|
| 19 | + NOTE: Sysmon is NOT a whitelist solution or HIDS correlation engine, it is a computer change logging tool. |
| 20 | + Do NOT ignore everything possible. Sysmon's purpose is providing context during a threat or problem investigation. Legitimate |
| 21 | + processes are routinely used by threats - do not blindly exclude them. Additionally, be mindful of process-hollowing / imitation. |
| 22 | +
|
| 23 | + NOTE: By default this monitors DNS, which is extremely noisy. If you are starting out on your monitoring journey, just remove that section. |
| 24 | + You can remove DNS events from Event Viewer screen by applying a 'Filter Current View' for event IDs of: -22 |
| 25 | + Additionally, if you want to monitor DNS, you should deploy client-side adblocking to reduce lookups. See the DNS section for info. |
| 26 | +
|
| 27 | + NOTE: This configuration is designed for PER-MACHINE installs of Chrome and OneDrive. That moves their binaries out of user-controlled folders. |
| 28 | + Otherwise, attackers could imitate these common applications, and bypass your logging. Below are silent upgrades you can do, no user impact: |
| 29 | + - https://docs.microsoft.com/en-us/onedrive/per-machine-installation |
| 30 | + - https://cloud.google.com/chrome-enterprise/browser/download/ |
| 31 | + - As of 2021-02-16 there is no machine-level version of Microsoft Teams. The one provided copies itself to the user profile. |
| 32 | +
|
| 33 | + NOTE: Sysmon is not hardened against an attacker with admin rights. Additionally, this configuration offers an attacker, willing |
| 34 | + to study it, limited ways to evade some of the logging. If you are in a very high-threat environment, you should consider a broader, |
| 35 | + log-most approach. However, in the vast majority of cases, an attacker will bumble through multiple behavioral traps which |
| 36 | + this configuration monitors, especially in the first minutes. |
| 37 | +
|
| 38 | + NOTE: If you encounter unexplainable event inclusion/exclusion, you may have a second Sysmon instance installed under a different exe filename. |
| 39 | + To clear this, try downloading the latest version and uninstalling with -u force. If it hangs, kill the processes and run it again to cleanup. |
| 40 | +
|
| 41 | + TECHNICAL: |
| 42 | + - Run sysmon.exe -? for a briefing on Sysmon configuration. |
| 43 | + - Sysmon XML cannot use the AMPERSAND sign. Replace it with this: & |
| 44 | + - Sysmon 8+ can track which rule caused an event to be logged through the "RuleName" field. |
| 45 | + - If you only specify exclude for a filtering subsection, everything in that subsection is logged by default. |
| 46 | + - Some Sysmon monitoring abilities are not meant for widely deployed general-purpose use due to performance impact. Depends on environment. |
| 47 | + - Duplicate or overlapping "Include" rules do not result in duplicate events being logged. |
| 48 | + - All characters enclosed by XML tags are always interpreted literally. Sysmon does not support wildcards (*), alternate characters, or RegEx. |
| 49 | + - In registry events, the value name is appended to the full key path with a "\" delimiter. Default key values are named "\(Default)" |
| 50 | + - "Image" is a technical term for a compiled binary file like an EXE or DLL. Also, it can match just the filename, or entire path. |
| 51 | + - "ProcessGuid" and "LoginGuid" are not random, they contain some embedded information. https://gist.github.com/mattifestation/0102042160c9a60b2b847378c0ef70b4 |
| 52 | +
|
| 53 | + FILTERING: Filter conditions available for use are: is,is any,is not,contains,contains any,contains all,excludes,excludes any,excludes all,begin with,end with,not begin with,not end with,less than,more than,image |
| 54 | + - The "image" filter is usable on any field. Same as "is" but can either match entire string, or only the text after last "\". Credit: @mattifestation |
55 | 55 |
|
56 | 56 | --> |
57 | 57 |
|
|
129 | 129 | <CommandLine condition="is">C:\Windows\system32\svchost.exe -k LocalService -p -s BthAvctpSvc</CommandLine> |
130 | 130 | <CommandLine condition="is">C:\Windows\system32\svchost.exe -k localService -s nsi</CommandLine> |
131 | 131 | <CommandLine condition="is">C:\Windows\system32\svchost.exe -k localService -s w32Time</CommandLine> |
132 | | - <CommandLine condition="is">C:\Windows\system32\svchost.exe -k localServiceAndNoImpersonation</CommandLine> <!--Windows: Network services--> |
| 132 | + <CommandLine condition="is">C:\Windows\system32\svchost.exe -k localServiceAndNoImpersonation</CommandLine> <!--Windows: Network services--> |
133 | 133 | <CommandLine condition="is">C:\Windows\system32\svchost.exe -k localServiceAndNoImpersonation -p</CommandLine> <!--Windows: Network services--> |
134 | 134 | <CommandLine condition="is">C:\Windows\system32\svchost.exe -k localServiceNetworkRestricted -s Dhcp</CommandLine> <!--Windows: Network services--> |
135 | 135 | <CommandLine condition="is">C:\Windows\system32\svchost.exe -k localServiceNetworkRestricted -s EventLog</CommandLine> |
|
342 | 342 | <Image condition="image">nc64.exe</Image> <!-- 64-bit version of nc that can be used on 64-bit Windows Architectures https://github.com/DarrenRainey/netcat--> |
343 | 343 | <Image condition="image">ncat.exe</Image> <!-- Nmap's modern version of netcat [ https://nmap.org/ncat/guide/index.html#ncat-overview ] [ https://securityblog.gr/1517/create-backdoor-in-windows-with-ncat/ ] --> |
344 | 344 | <Image condition="image">procdump.exe</Image> <!-- Sysinternals Suite client side that can be used to dump clear text passwords from memory --> |
345 | | - <Image condition="image">procdump64.exe</Image> <!-- Sysinternals Suite client side 64-bit version that can be used to dump clear text passwords from memory --> |
| 345 | + <Image condition="image">procdump64.exe</Image> <!-- Sysinternals Suite client side 64-bit version that can be used to dump clear text passwords from memory --> |
346 | 346 | <Image condition="image">psexec.exe</Image> <!--Sysinternals:PsExec client side | Credit @Cyb3rOps --> |
347 | 347 | <Image condition="image">psexec64.exe</Image> <!-- Sysinernals:PsExec64 client side | 64-bit version of psexec.exe --> |
348 | 348 | <Image condition="image">psexesvc.exe</Image> <!--Sysinternals:PsExec server side | Credit @Cyb3rOps --> |
|
492 | 492 | <CallTrace condition="not begin with">C:\Windows\SYSTEM32\wow64win.dll</CallTrace> |
493 | 493 | </Rule> |
494 | 494 | <CallTrace condition="begin with">UNKNOWN</CallTrace> |
| 495 | + <!-- Inject AMSI Bypass via CobaltStrike BOF Ref: https://github.com/boku7/injectAmsiBypass --> |
| 496 | + <Rule groupRelation="and"> |
| 497 | + <CallTrace condition="contains">UNKNOWN</CallTrace> |
| 498 | + <GrantedAccess condition="contains any">0x1028</GrantedAccess> |
| 499 | + </Rule> |
495 | 500 | <!-- lsass.exe access with critical permission --> |
496 | 501 | <Rule groupRelation="and"> |
497 | 502 | <TargetImage condition="end with">lsass.exe</TargetImage> |
|
529 | 534 | <TargetFilename condition="end with">.docm</TargetFilename> <!--Microsoft:Office:Word: Macro--> |
530 | 535 | <TargetFilename name="DLL" condition="end with">.dll</TargetFilename> <!--Microsoft:Office:Word: Macro--> |
531 | 536 | <TargetFilename name="EXE" condition="end with">.exe</TargetFilename> <!--Executable--> |
532 | | - <TargetFilename name="ProcessHostingdotNETCode" condition="end with">.exe.log</TargetFilename> <!-- [ https://github.com/bitsadmin/nopowershell ] | Credit: @SBousseaden [ https://twitter.com/SBousseaden/status/1137493597769687040 ] --> |
| 537 | + <TargetFilename name="ProcessHostingdotNETCode" condition="end with">.exe.log</TargetFilename> <!-- [ https://github.com/bitsadmin/nopowershell ] | Credit: @SBousseaden [ https://twitter.com/SBousseaden/status/1137493597769687040 ] --> |
533 | 538 | <TargetFilename condition="end with">.jar</TargetFilename> <!--Java applets--> |
534 | 539 | <TargetFilename condition="end with">.jnlp</TargetFilename> <!--Java applets--> |
535 | 540 | <TargetFilename condition="end with">.jse</TargetFilename> <!--Scripting [ Example: https://www.sophos.com/en-us/threat-center/threat-analyses/viruses-and-spyware/Mal~Phires-C/detailed-analysis.aspx ] --> |
|
634 | 639 | <!--ADDITIONAL REFERENCE: [ http://www.silentrunners.org/launchpoints.html ] --> |
635 | 640 | <!--ADDITIONAL REFERENCE: [ https://www.microsoftpressstore.com/articles/article.aspx?p=2762082&seqNum=2 ] --> |
636 | 641 | <!--ADDITIONAL REFERENCE: [ https://web.archive.org/web/20200116001643/http://scholarworks.rit.edu/cgi/viewcontent.cgi?article=1533&context=theses | Understanding malware autostart techniques - Matthew Gottlieb ] --> |
637 | | - <TargetObject name="T1562.002" condition="end with">\MiniNT</TargetObject> <!--Windows: Disable eventlog by acting like WinPE [https://twitter.com/0gtweet/status/1182516740955226112] --> |
| 642 | + <TargetObject name="T1562.002" condition="end with">\MiniNT</TargetObject> <!--Windows: Disable eventlog by acting like WinPE [https://twitter.com/0gtweet/status/1182516740955226112] --> |
638 | 643 | <TargetObject name="T1060,RunKey" condition="contains">CurrentVersion\Run</TargetObject> <!--Windows: Wildcard for Run keys, including RunOnce, RunOnceEx, RunServices, RunServicesOnce [Also covers terminal server] --> |
639 | 644 | <TargetObject name="T1060,RunPolicy" condition="contains">Policies\Explorer\Run</TargetObject> <!--Windows: Alternate runs keys | Credit @ion-storm--> |
640 | 645 | <TargetObject name="T1484" condition="contains">Group Policy\Scripts</TargetObject> <!--Windows: Group policy scripts--> |
|
1225 | 1230 | <!--SYSMON EVENT ID 23 : FILE DELETE [FileDelete]--> |
1226 | 1231 | <!--EVENT 23: "File Delete"--> |
1227 | 1232 | <!--COMMENT: Sandbox usage. When a program signals to Windows a file should be deleted or wiped, Sysmon may be able to capture it. |
1228 | | - Tries to save a copy of the deleted file in the archivedirectory which defaults to C:\Sysmon (to view uncheck "Hide protected |
| 1233 | + Tries to save a copy of the deleted file in the archivedirectory which defaults to C:\Sysmon (to view uncheck "Hide protected |
1229 | 1234 | operating system files (Recommended)" from Folder Options). Can quickly fill the available drive space with copies of files. |
1230 | 1235 | Use EVENT ID 26 if a copy is not needed. |
1231 | 1236 | [ https://isc.sans.edu/forums/diary/Sysmon+and+File+Deletion/26084/ ] |
|
1242 | 1247 |
|
1243 | 1248 | <!--SYSMON EVENT ID 24 : CLIPBOARD EVENT MONITORING [ClipboardChange]--> |
1244 | 1249 | <!--EVENT 24: "Clipboard changed"--> |
1245 | | - <!--COMMENT: Sandbox usage. Sysmon can capture the contents of clipboard events. |
1246 | | - An example of what could be a production usage on restricted desktops is provided below, but it is commented-out. --> |
| 1250 | + <!--COMMENT: Sandbox usage. Sysmon can capture the contents of clipboard events. |
| 1251 | + An example of what could be a production usage on restricted desktops is provided below, but it is commented-out. --> |
1247 | 1252 |
|
1248 | 1253 | <!--DATA: EventType, UtcTime, ProcessGuid, ProcessId, Image, Session, ClientInfo, Hashes, Archived --> |
1249 | 1254 |
|
|
1277 | 1282 | <!--SYSMON EVENT ID 26 : FILE DELETE LOGGED [FileDeleteDetected]--> |
1278 | 1283 | <!--EVENT 26: "File Delete logged"--> |
1279 | 1284 | <!--COMMENT: This event is generated when a program signals to Windows a file should be deleted or wiped, Sysmon may be able to capture it. |
1280 | | - Unlike event ID 23 it does not archive a copy of the file deleted allowing for more widespread use outside of a sandbox or IR triage without |
| 1285 | + Unlike event ID 23 it does not archive a copy of the file deleted allowing for more widespread use outside of a sandbox or IR triage without |
1281 | 1286 | risk of filling up the storage space with deleted archives. |
1282 | 1287 | [ https://medium.com/falconforce/sysmon-13-10-filedeletedetected-fe2475cb419e ] |
1283 | 1288 | --> |
|
0 commit comments