diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..b7b1db16 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +name: CI + +on: + # Trigger the workflow on push or pull requests, but only for the + # main branch + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + msbuild: + runs-on: 'windows-latest' + steps: + - name: Checkout open-sysmon-conf + uses: actions/checkout@v2 + + - name: Download Sysmon + run: Invoke-WebRequest http://live.sysinternals.com/tools/sysmon.exe -OutFile .\sysmon.exe + shell: powershell + + - name: Run Sysmon + run: .\sysmon.exe -accepteula -i sysmonconfig-export.xml + shell: powershell diff --git a/README.md b/README.md index 6e4ec413..d363ce72 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,149 @@ -# sysmon-config | A Sysmon configuration file for everybody to fork # +# sysmon-config | A Sysmon configuration file -This is a Microsoft Sysinternals Sysmon configuration file template with default high-quality event tracing. +This is a forked and modified version of @SwiftOnSecurity's [sysmon config](https://github.com/SwiftOnSecurity/sysmon-config). -The file should function as a great starting point for system change monitoring in a self-contained and accessible package. This configuration and results should give you a good idea of what's possible for Sysmon. Note that this does not track things like authentication and other Windows events that are also vital for incident investigation. +Currently it is simply a copy with most of the 30+ open pull requests of the original repository merged. Thus we have fixed many of the issues that are still present in the original version and extended the coverage by important new extensions that have been provided over the last year. -      **[sysmonconfig-export.xml](https://github.com/SwiftOnSecurity/sysmon-config/blob/master/sysmonconfig-export.xml)** +## Additional coverage includes -Because virtually every line is commented and sections are marked with explanations, it should also function as a tutorial for Sysmon and a guide to critical monitoring areas in Windows systems. +- Cobalt Strike named pipes +- PrinterNightmare +- HiveNightmare -- For a far more exhaustive and detailed approach to Sysmon configuration from a different approach, see also **[sysmon-modular](https://github.com/olafhartong/sysmon-modular)** by [@olafhartong](https://twitter.com/olafhartong), which can act as a superset of sysmon-config. +## Testing -- Sysmon is a compliment to native Windows logging abilities, not a replacement for it. For valuable advice on these configurations, see **[MalwareArchaeology Logging Cheat Sheets](https://www.malwarearchaeology.com/cheat-sheets)** by [@HackerHurricane](https://twitter.com/hackerhurricane). +This configuration is focused on detection coverage. We have only one rather small testing environment to avoid problematic expressions that trigger too often. It is recommended to test the downloaded configuration on a small set of systems in your environment in any case. -Note: Exact syntax and filtering choices in the configuration are highly deliberate in what they target, and to have as little performance impact as possible. Sysmon's filtering abilities are different than the built-in Windows auditing features, so often a different approach is taken than the normal static listing of paths. +## Feedback -      **[See other forks of this configuration](https://github.com/SwiftOnSecurity/sysmon-config/network)** +Since we don't have more than one environment to test the config ourselves, we rely on feedback from the community. + +Please report: + +1. Expressions that cause a high volume of events +2. Broken configuration elements (typos, wrong conditions) +3. Missing coverage (preferrably as a pull request) + +## Usage + +### Install -## Use ## -### Install ### Run with administrator rights -~~~~ + +```batch sysmon.exe -accepteula -i sysmonconfig-export.xml -~~~~ +``` + +### Update existing configuration -### Update existing configuration ### Run with administrator rights -~~~~ + +```batch sysmon.exe -c sysmonconfig-export.xml -~~~~ +``` + +### Uninstall -### Uninstall ### Run with administrator rights -~~~~ + +```batch sysmon.exe -u -~~~~ +``` + +## Credits + +Since we wanted to be able to receive new pull requests this repository, we had to squash all open(!) pull requests of the original reposiory into a single commit on this one. + +We've pull the following requests: + +Registry key to detect definitions of Windows Defender Exclusions\ +155 opened 12 days ago by @phantinuss + +Outlook Webview URL changes\ +154 opened on 14 Jun by @humpalum + +Event id 26\ +153 opened on 14 Jun by @Richman711 + +Important and relevant NamedPipe names\ +151 opened on 27 May by @Neo23x0 + +Added named pipe used by @Cobalt Strike\ +150 opened on 26 May by @WojciechLesicki + +Fix FileDelete example.\ +149 opened on 26 May by @sigalpes + +Add exclusion for WUDFHost.exe to Event 11\ +148 opened on 19 Apr by @lord-garmadon + +Corrected event name for Event ID 23\ +147 opened on 16 Apr by @lord-garmadon + +Monitor for .js files for Microsoft JScript\ +146 opened on 7 Apr by @KevinDeNotariis + +Added WinRM ports and Service names\ +145 opened on 16 Mar by @tobor88 + +Add ASP files for webshells\ +144 opened on 8 Mar by @GossiTheDog + +Update NetworkConnect rule to fix Metasploit default port\ +143 opened on 6 Mar by @brokenvhs + +Ransomware artifacts added to File Creation config\ +140 opened on 18 Feb by @sduff + +MiniNT registry key check\ +130 opened on 9 Sep 2020 by @ThisIsNotTheUserYouAreLookingFor + +Added detection for CVE-2017-0199 and CVE-2017-8759.\ +118 opened on 21 May 2020 by @d4rk-d4nph3 + +Printer port changes as used in CVE-2020-1048\ +115 opened on 15 May 2020 by @Neo23x0 + +Update sysmonconfig-export.xml\ +108 opened on 1 Mar 2020 by @harmonkc + +Changed the bypassable DNS hostname checks\ +107 opened on 5 Feb 2020 by @MaxNad + +Added most of the missing LOLBAS for downloading executables\ +106 opened on 5 Feb 2020 by @MaxNad + +Change Metasploit Alert port from 444 to 4444\ +105 opened on 5 Feb 2020 by @ION28 + +Add exclusion for Azure MMA agent | Add exclusion for IPAM GP PS script | Add exclusion for MonitorKnowledgeDiscovery\ +104 opened on 29 Jan 2020 by @adrwh + +Fixed wdigest registry path\ +102 opened on 13 Dec 2019 by @qz8xTD + +unnecessary shout out to Alpha version for DNS logging\ +100 opened on 10 Dec 2019 by @itpropaul + +Add scripting filename targets\ +98 opened on 14 Nov 2019 by @bartblaze + +Included some of the entries from PR to sysmonconfig-export.xml\ +97 opened on 6 Nov 2019 by @cudeso -## Required actions ## +Keyboard Layout Load\ +92 opened on 13 Oct 2019 by @Neo23x0 -### Prerequisites ### -Highly recommend using [Notepad++](https://notepad-plus-plus.org/) to edit this configuration. It understands UNIX newline format and does XML syntax highlighting, which makes this very understandable. I do not recommend using the built-in Notepad.exe. +Fixed IMAP port\ +71 opened on 12 Jan 2019 by @esecrpm +66 opened on 21 Aug 2018 by @martboo +59 opened on 25 May 2018 by @paalbra -### Customization ### -You will need to install and observe the results of the configuration in your own environment before deploying it widely. For example, you will need to exclude actions of your antivirus, which will otherwise likely fill up your logs with useless information. +Micro-improvements to monitored scenarios\ +53 opened on 6 Mar 2018 by @threathunting -The configuration is highly commented and designed to be self-explanatory to assist you in this customization to your environment. +Corrected typo for RTF extension\ +50 opened on 24 Jan 2018 by @kronflux -### Design notes ### -This configuration expects software to be installed system-wide and NOT in the C:\Users folder. Various pieces of software install themselves in User directories, which are subject to extra monitoring. Where possible, you should install the system-wide version of these pieces of software, like Chrome. See the configuration file for more instructions. +Add Windows Trust registry keys to log\ +40 opened on 4 Oct 2017 by @mdunten diff --git a/sysmonconfig-export.xml b/sysmonconfig-export.xml index f4acf26c..97305c8a 100644 --- a/sysmonconfig-export.xml +++ b/sysmonconfig-export.xml @@ -1,14 +1,9 @@ - - + md5,sha256,IMPHASH @@ -82,7 +77,10 @@ + "C:\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exe" -Embedding + \Machine\Scripts\Startup\ipamprovisioning.ps1 + C:\Windows\system32\cscript.exe" /nologo "MonitorKnowledgeDiscovery.vbs "C:\Windows\system32\wermgr.exe" "-queuereporting_svc" C:\Windows\system32\DllHost.exe /Processid C:\Windows\system32\wbem\wmiprvse.exe -Embedding @@ -131,7 +129,8 @@ C:\Windows\system32\svchost.exe -k LocalService -p -s BthAvctpSvc C:\Windows\system32\svchost.exe -k localService -s nsi C:\Windows\system32\svchost.exe -k localService -s w32Time - C:\Windows\system32\svchost.exe -k localServiceAndNoImpersonation + C:\Windows\system32\svchost.exe -k localServiceAndNoImpersonation + C:\Windows\system32\svchost.exe -k localServiceAndNoImpersonation -p C:\Windows\system32\svchost.exe -k localServiceNetworkRestricted -s Dhcp C:\Windows\system32\svchost.exe -k localServiceNetworkRestricted -s EventLog C:\Windows\system32\svchost.exe -k localServiceNetworkRestricted -s TimeBrokerSvc @@ -150,8 +149,8 @@ C:\Windows\system32\svchost.exe -k localSystemNetworkRestricted -s TabletInputService C:\Windows\system32\svchost.exe -k localSystemNetworkRestricted -s UmRdpService C:\Windows\system32\svchost.exe -k localSystemNetworkRestricted -s WPDBusEnum - C:\Windows\system32\svchost.exe -k localSystemNetworkRestricted -p -s NgcSvc - C:\Windows\system32\svchost.exe -k localServiceNetworkRestricted -p -s NgcCtnrSvc + C:\Windows\system32\svchost.exe -k localSystemNetworkRestricted -p -s NgcSvc + C:\Windows\system32\svchost.exe -k localServiceNetworkRestricted -p -s NgcCtnrSvc C:\Windows\system32\svchost.exe -k localServiceAndNoImpersonation -s SCardSvr C:\Windows\system32\svchost.exe -k netsvcs -p -s wuauserv C:\Windows\System32\svchost.exe -k netsvcs -p -s SessionEnv @@ -180,6 +179,7 @@ C:\Windows\system32\svchost.exe -k networkService -s NlaSvc C:\Windows\system32\svchost.exe -k networkService -s TermService C:\Windows\system32\svchost.exe -k networkService + C:\Windows\system32\svchost.exe -k networkService -p C:\Windows\system32\svchost.exe -k networkServiceNetworkRestricted C:\Windows\system32\svchost.exe -k rPCSS C:\Windows\system32\svchost.exe -k secsvcs @@ -201,10 +201,12 @@ C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\Ngen.exe + C:\Windows\Microsoft.NET\Framework\v4.0.30319\ngentask.exe + C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorsvw.exe C:\Windows\Microsoft.Net\Framework64\v3.0\WPF\PresentationFontCache.exe - C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe + C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorsvw.exe C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngentask.exe C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorsvw.exe @@ -226,7 +228,7 @@ "C:\Program Files\Google\Chrome\Application\chrome.exe" --type= - + @@ -259,7 +261,7 @@ - + @@ -298,6 +300,7 @@ notepad.exe nslookup.exe powershell.exe + powershell_ise.exe qprocess.exe qwinsta.exe qwinsta.exe @@ -312,10 +315,29 @@ tasklist.exe wmic.exe wscript.exe + + bitsadmin.exe + esentutl.exe + expand.exe + extrac32.exe + findstr.exe + GfxDownloadWrapper.exe + ieexec.exe + makecab.exe + replace.exe + Excel.exe + Powerpnt.exe + Winword.exe + squirrel.exe + netcat.exe nc.exe + nc64.exe ncat.exe + procdump.exe + procdump64.exe psexec.exe + psexec64.exe psexesvc.exe tor.exe vnc.exe @@ -332,7 +354,9 @@ 3389 5800 5900 - 444 + 5985 + 5986 + 4444 1080 3128 @@ -349,15 +373,18 @@ C:\ProgramData\Microsoft\Windows Defender\Platform\ AppData\Local\Microsoft\Teams\current\Teams.exe + microsoft.com .microsoft.com - microsoft.com.akadns.net - microsoft.com.nsatc.net 23.4.43.27 72.21.91.29 + microsoft.com.akadns.net + .microsoft.com.nsatc.net 127.0.0.1 fe80:0:0:0 + + \AppData\Local\Microsoft\OneDrive\OneDrive.exe @@ -483,6 +510,8 @@ .jnlp .jse .hta + .aspx + .asp .job .pptm .ps1 @@ -515,6 +544,22 @@ .xls .ppt .rtf + + .php + .asp + .aspx + .ashx + .jsp + .pl +<<<<<<< HEAD +======= + \SAM-20 + \SAM-haxx + \Sam.save + \hive_sam_ + C:\windows\temp\sam + C:\Windows\System32\spool\drivers\x64 +>>>>>>> upstream/master @@ -529,6 +574,7 @@ C:\Windows\system32\CompatTelRunner.exe \\?\C:\Windows\system32\wbem\WMIADAP.EXE C:\Windows\system32\mobsync.exe + C:\Windows\System32\WUDFHost.exe C:\Windows\system32\DriverStore\Temp\ C:\Windows\system32\wbem\Performance\ C:\Windows\Installer\ @@ -567,6 +613,7 @@ + \MiniNT CurrentVersion\Run Policies\Explorer\Run Group Policy\Scripts @@ -630,7 +677,7 @@ HKLM\Software\Microsoft\Windows\CurrentVersion\Authentication\Credential Provider HKLM\SYSTEM\CurrentControlSet\Control\Lsa\ - HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SecurityProviders + HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\ HKLM\Software\Microsoft\Netsh Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable @@ -647,6 +694,7 @@ Microsoft\Office\Outlook\Addins\ Office Test\ + \Software\Microsoft\Office\;\Outlook\WebView\;URL Security\Trusted Documents\TrustRecords Internet Explorer\Toolbar\ @@ -671,6 +719,7 @@ \SpynetReporting DisableRealtimeMonitoring \SubmitSamplesConsent + HKLM\Software\Microsoft\Windows Defender\Exclusions HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\LocalAccountTokenFilterPolicy @@ -698,9 +747,21 @@ \DriverVerVersion \LinkDate Compatibility Assistant\Store\ + HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Ports + \Keyboard Layout\Preload + \Keyboard Layout\Substitutes regedit.exe \ + HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ + HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\ + + + Microsoft\Cryptography\OID\ + WOW6432Node\Microsoft\Cryptography\OID\ + Microsoft\Cryptography\Providers\Trust\ + WOW6432Node\Microsoft\Cryptography\Providers\Trust\ + Control\Print\Environments\Windows x64\Drivers @@ -808,7 +869,7 @@ - + @@ -820,11 +881,23 @@ - - - - - + + + + paexec;remcom;csexec + + \lsadump;\cachedump;\wceservicepipe + + \isapi_http;\isapi_dg;\isapi_dg2;\sdlrpc;\ahexec;\winsession;\lsassw;\46a676ab7f179e511e30dd2dc41bd388;\9f81f59bc58452127884ce513865ed20;\e710f28d59aa529d6792ca6ff0ca1b34;\rpchlp_3;\NamePipe_MoreWindows;\pcheap_reuse;\gruntsvc;\583da945-62af-10e8-4902-a8f205c72b2e;\bizkaz;\svcctl;\Posh;\jaccdpqnvbrrxlaf;\csexecsvc + \atctl;\userpipe;\iehelper;\sdlrpc;\comnap + + MSSE-;-server + \postex_ + \postex_ssh_ + \status_ + \msagent_ + + @@ -947,7 +1020,8 @@ .akadns.net .netflix.com - aspnetcdn.com + aspnetcdn.com + .aspnetcdn.com ajax.googleapis.com cdnjs.cloudflare.com fonts.googleapis.com @@ -991,7 +1065,7 @@ .criteo.net .crwdcntrl.net .demdex.net - .domdex.com + .domdex.com .dotomi.com .doubleclick.net .doubleverify.com @@ -1084,16 +1158,19 @@ ocsp.godaddy.com ocsp.int-x3.letsencrypt.org ocsp.msocsp.com - pki.goog + pki.goog + .pki.goog ocsp.godaddy.com - amazontrust.com + amazontrust.com + .amazontrust.com ocsp.sectigo.com pki-goog.l.google.com .usertrust.com ocsp.comodoca.com ocsp.verisign.com ocsp.entrust.net - ocsp.identrust.com + ocsp.identrust.com + .ocsp.identrust.com status.rapidssl.com status.thawte.com ocsp.int-x3.letsencrypt.org @@ -1101,8 +1178,11 @@ - - + @@ -1110,8 +1190,8 @@ @@ -1119,7 +1199,7 @@ - + - + - + + + + + + + - \ No newline at end of file +