Collecting Windows Security Audit Log data with NXLog and Sysmon. Collecting Windows Security Audit Log data with NXLog and Sysmon



Similar documents
Using NXLog with Elasticsearch and Kibana. Using NXLog with Elasticsearch and Kibana

Tracking Hackers on Your Network with Sysinternals Sysmon

DETECTING ADVANCED THREATS WITH SYSMON, WEF AND ELASTICSEARCH

Eventlog to Syslog v4.5 Release 4.5 Last revised September 29, 2013

WildFire Cloud File Analysis

Log Processing Tools. PS Tools Suite. PSTools Suite. PSTools Suite

3M SelfCheck Self-Pay Software. Implementation Guide

Symantec Event Collector 4.3 for Microsoft Windows Quick Reference

TZWorks Windows Event Log Viewer (evtx_view) Users Guide

WinAgentLog Reference Manual

etrust Audit irecorder Reference Guide for Microsoft NT Event Log 1.5 SP2

Manage Traps in a VDI Environment. Traps Administrator s Guide. Version 3.3. Copyright Palo Alto Networks

WhatsUp Log Management Installation and Migration Guide, including Getting Started Information. (Applies to v and later)

JobScheduler Web Services Executing JobScheduler commands

Windows PowerShell Cookbook

Backup and Recovery Procedures

NXLOG Community Edition Reference Manual for v

WINDOWS PROCESSES AND SERVICES

Windows Quick Start Guide for syslog-ng Premium Edition 5 LTS

BlackBerry Enterprise Service 10. Secure Work Space for ios and Android Version: Security Note

Cloud Services. Introduction...2 Overview...2. Security considerations Installation...3 Server Configuration...4

Log management with Logstash and Elasticsearch. Matteo Dessalvi

Monitoring Linux and Windows Logs with Graylog Collector. Bernd Ahlers Graylog, Inc.

Using Process Monitor

Installing your Digital Certificate & Using on MS Out Look 2007.

Log Forwarder for Windows SolarWinds, Inc.

McAfee One Time Password

EVENT LOG MANAGEMENT...

There are numerous ways to access monitors:

Management, Logging and Troubleshooting

orrelog SNMP Trap Monitor Software Users Manual

Troubleshooting for Yamaha router

E-CERT C ONTROL M ANAGER

Matisse Installation Guide for MS Windows

Guidance Regarding Skype and Other P2P VoIP Solutions

Extreme Networks Security WinCollect User Guide

Security Guide. BlackBerry Enterprise Service 12. for ios, Android, and Windows Phone. Version 12.0

Configuring Security Features of Session Recording

SECUR IN MIRTH CONNECT. Best Practices and Vulnerabilities of Mirth Connect. Author: Jeff Campbell Technical Consultant, Galen Healthcare Solutions

ObserveIT User Activity Monitoring software meets the complex compliance and security challenges related to user activity auditing.

F-Secure Internet Security 2014 Data Transfer Declaration

32-Bit Workload Automation 5 for Windows on 64-Bit Windows Systems

Centralized Auditing in Windows Derek Melber

Federated Threat Data Sharing with the Collective Intelligence Framework (CIF)

Using IPSec in Windows 2000 and XP, Part 2

Authoring for System Center 2012 Operations Manager

CLC License Server Administrator Manual

BYOD Guidance: BlackBerry Secure Work Space

Safewhere*ADFS2Logging

Advanced Install & Configuration Guide

VMware vcenter Log Insight Security Guide

keyon true-xtender Luna SA Monitor Service Manual Release Version Autor Date Keyon January 2016 Release with Luna SA 6 support

Configuring and Monitoring SiteMinder Policy Servers

Introduction to PsPing - a new Microsoft Windows tool for measuring network performance. Bartek Gajda gajda@man.poznan.pl

FileMaker Server 11. FileMaker Server Help

How to Time Stamp PDF and Microsoft Office 2010/2013 Documents with the Time Stamp Server

ESX 4 Patch Management Guide ESX 4.0

Dove User Guide Copyright Virgil Trasca

IBM Campaign Version-independent Integration with IBM Engage Version 1 Release 3 April 8, Integration Guide IBM

Tracking Network Changes Using Change Audit

This document describes the installation of the Web Server for Bosch Recording Station 8.10.

How To Encrypt A Computer With A Password Protected Encryption Software On A Microsoft Gbk (Windows) On A Pc Or Macintosh (Windows Xp) On An Uniden (Windows 7) On Pc Or Ipa (Windows 8) On

HP A-IMC Firewall Manager

SafeGuard Enterprise Tools guide

TANDBERG MANAGEMENT SUITE 10.0

Lab Configure Intrusion Prevention on the PIX Security Appliance

Intrusion Detection Systems (IDS)

Basic Exchange Setup Guide

VMware vcenter Log Insight Developer's Guide

Configuring Secure Socket Layer HTTP

How to Prepare for the Upgrade to Microsoft Dynamics CRM 2013 (On-premises)

MCTS Guide to Microsoft Windows 7. Chapter 7 Windows 7 Security Features

How To Install Outlook Addin On A 32 Bit Computer

Ekran System Help File

Network-Enabled Devices, AOS v.5.x.x. Content and Purpose of This Guide...1 User Management...2 Types of user accounts2

WPU-7700 APS MANAGEMENT

Installation and Deployment

Exostar LDAP Proxy / Secure Setup Guide. This document provides information on the following topics:

For Splunk Universal Forwarder and Splunk Cloud

11.1. Performance Monitoring

Dwebs IIS Log Archiver Installation and Configuration Guide for Helm 4

Lab Configure IOS Firewall IDS

Unlocking data creating knowledge. How to run Nesstar with IIS Socket Pooling

Maintenance Guide. Outpost Firewall 4.0. Personal Firewall Software from. Agnitum

HRC Advanced Citrix Troubleshooting Guide. Remove all Citrix Instances from the Registry

Managing the SSL Certificate for the ESRS HTTPS Listener Service Technical Notes P/N REV A01 January 14, 2011

Integrating LANGuardian with Active Directory

AppWall SIEM Integration Guide

Novell Sentinel Log Manager 1.2 Release Notes. 1 What s New. 1.1 Enhancements to Licenses. Novell. February 2011

Monitor Mobile Devices via ActiveSync Using EventTracker

Upgrade Guide. Upgrading to EventTracker v6.0. Upgrade Guide Columbia Gateway Drive, Suite 250 Publication Date: Sep 20, 2007.

By default, pilight uses a random port for its socket server. Use the port setting If you want to set this to a fixed port.

VMware vcenter Log Insight Security Guide

insync Installation Guide

CLC License Server ADMINISTRATOR MANUAL

IriScene Remote Manager. Version 4.8 FRACTALIA Software

Magento Search Extension TECHNICAL DOCUMENTATION

INSTALLATION AND CONFIGURATION MANUAL ENCODER

Transcription:

Collecting Windows Security Audit Log data with NXLog and Sysmon i Collecting Windows Security Audit Log data with NXLog and Sysmon

Collecting Windows Security Audit Log data with NXLog and Sysmon ii Contents

Collecting Windows Security Audit Log data with NXLog and Sysmon 1 / 6 The Windows Security log already contains a lot of audit data such as login/logon activity, account changes, audit policy changes and other events. Recording of additional security related events such as file access and modification can be turned on by altering the security audit policy. The list of security audit events are published by Microsoft and can be downloaded as a spreadsheet: Security Audit Events for Windows 7 and Windows Server 2008 R2 Windows 8 and Windows Server 2012 Security Events Sysmon is a tool available from Sysinternals/Microsoft free of charge and is part of the Windows SysInternals tools. It was first released in August 2014 and version v3.0 came out recently on April 20, 2015. Sysmon is and advanced background monitor that can record additional security-related events for use in intrusion detection and forensics such as: Process creation with full command line, Loading of drivers, Network connections, Changes to file creation time. Sysmon is a simple command line tool, the service can be installed running Sysmon from the command prompt. Below is the Sysmon help output: -------------------------------------------------------------------------------- Sysinternals Sysmon v3.00 - System activity monitor Copyright (C) 2014-2015 Mark Russinovich and Thomas Garnier Sysinternals - www.sysinternals.com Usage: Install: Configure: Sysmon.exe -i <configfile> [-h <[sha1 md5 sha256 imphash *],...>] [-n (<process,...>)] [-l (<process,...>)] Sysmon.exe -c <configfile> [-- [-h <[sha1 md5 sha256 imphash *],...>] [-n (<process,...>)] [-l (<process,...>)]] Uninstall: Sysmon.exe -u -c Update configuration of an installed Sysmon driver or dump the current configuration if no other argument is provided. Optionally take a configuration file. -h Specify the hash algorithms used for image identification (default is SHA1). It supports multiple algorithms at the same time. Configuration entry: HashAlgorithms. -i Install service and driver. Optionally take a configuration file. -l Log loading of modules. Optionally take a list of processes to track. -m Install the event manifest (done on service install as well). -n Log network connections. Optionally take a list of processes to track. -u Uninstall service and driver. The service logs events immediately and the driver installs as a boot-start driver to capture activity from early in the boot that the service will write to the event log when it starts. On Vista and higher, events are stored in "Applications and Services Logs/Microsoft/Windows/Sysmon/Operational" On older systems, events are written to the System event log. If you need more information on configuration files, use the -? config command. More examples are available on the Sysinternals website. Specify -accepteula to automatically accept the EULA on installation, otherwise

Collecting Windows Security Audit Log data with NXLog and Sysmon 2 / 6 you will be interactively prompted to accept it. Neither install nor uninstall requires a reboot. -------------------------------------------------------------------------------- Once configured and installed on a system, Sysmon will remain resident as a windows service to log system activity to the Windows event log. This audit log data can be collected and forwarded by NXLog to SIEM and log analytics systems to allow us to identify malicious or anomalous activity and understand how intruders and malware operate on our network. On Vista and higher, events are stored in "Applications and Services Logs/Microsoft/Windows/Sysmon/Operational". On older systems, events are written to the System event log. Figure 1: An Eventlog record generated by Sysmon Sysmon can be quite noisy and we may not want to record all the events it logs. An XML configuration file can be used with the -c or -i command line switch to fine-tune the behavior of Sysmon. Below is an XML configuration example: <Sysmon schemaversion="1.0"> <Configuration> <!-- Capture MD5 Hashes --> <Hashing>MD5</Hashing> <!-- Enable network logging --> <Network />

Collecting Windows Security Audit Log data with NXLog and Sysmon 3 / 6 </Configuration> <Rules> <!-- Log all drivers except if the signature --> <!-- contains Microsoft or Windows --> <DriverLoad default="include"> <Signature condition="contains">microsoft</signature> <Signature condition="contains">windows</signature> </DriverLoad> <!-- Do not log process termination --> <ProcessTerminate /> <!-- Exclude certain processes that cause high event volumes --> <ProcessCreate default="include"> <Image condition="contains">noisyprogram.exe</image> </ProcessCreate> <!-- Do not log file creation time stamps --> <FileCreateTime /> <!-- Do not log network connections of a certain process or port --> <NetworkConnect default="include"> <Image condition="contains">someapp.exe</image> <DestinationPort>4041</DestinationPort> </NetworkConnect> </Rules> </Sysmon> The Sysmon manual has more details about the configuration file and the event filtering tags. Now we will want to collect and ship these logs to our SIEM or log analytics system. This is where NXLog steps in. The following nxlog.conf configuration collects Sysmon generated event records from the Windows Eventlog. For testing purposes we use a configuration which only reads Sysmon s events and writes them to a file in JSON format. define ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modules CacheDir %ROOT%\data Pidfile %ROOT%\data\nxlog.pid SpoolDir %ROOT%\data LogFile %ROOT%\data\nxlog.log LogLevel INFO <Extension _json> Module xm_json </Extension> <Input in> Module im_msvistalog Query <QueryList> <Query Id="0"> <Select Path="Microsoft-Windows-Sysmon/Operational ">*</Select> </Query></QueryList> </Input> <Output out> Module om_file File C:\test\sysmon.json Exec to_json(); </Output> <Route 66> Path </Route> in => out Sysmon generated events contain event details in a structured format in the EventData section as shown in the screenshot below.

Collecting Windows Security Audit Log data with NXLog and Sysmon 4 / 6 Figure 2: EventData XML fields of a Sysmon generated Eventlog record This data is recorded in the same structure as the events under the Security log using the <Data name="key">value</data> tags. NXLog will automatically parse this so that these values are accessible as NXLog fields. When converted to JSON with our NXLog configuration, the event record will look as follows. Note that this JSON is pretty-printed for readability, NXLog generates single-line JSON records. { "EventTime":"2015-04-27 15:23:46", "Hostname":"WIN-OUNNPISDHIG", "Keywords":-9223372036854775808, "EventType":"INFO", "SeverityValue":2, "Severity":"INFO", "EventID":1, "SourceName":"Microsoft-Windows-Sysmon", "ProviderGuid":"{5770385F-C22A-43E0-BF4C-06F5698FFBD9}", "Version":3, "Task":1, "OpcodeValue":0, "RecordNumber":2335906, "ProcessID":1680, "ThreadID":1728,

Collecting Windows Security Audit Log data with NXLog and Sysmon 5 / 6 "Channel":"Microsoft-Windows-Sysmon/Operational", "Domain":"NT AUTHORITY", "AccountName":"SYSTEM", "UserID":"SYSTEM", "AccountType":"Well Known Group", "Message":"Process Create:\r\nUtcTime: 2015.04.27. 13:23\r\nProcessGuid: {00000000-3862-553E-0000-001051D40527}\r\nProcessId: 25848\r\nImage: c:\\program Files (x86)\\nxlog\\nxlog.exe\r\ncommandline: \"c:\\program Files (x86)\\nxlog\\nxlog.exe\" - f\r\nuser: WIN-OUNNPISDHIG\\Administrator\r\nLogonGuid: {00000000-568E-5453-0000-0020 D5ED0400}\r\nLogonId: 0x4edd5\r\nTerminalSessionId: 2\r\nIntegrityLevel: High\r\ nhashtype: SHA1\r\nHash: 1DCE4B0F24C40473CE7B2C57EB4F7E9E3E14BF94\r\nParentProcessGuid: {00000000-3862-553E-0000-001088D30527}\r\nParentProcessId: 26544\r\nParentImage: C:\\ msys\\1.0\\bin\\sh.exe\r\nparentcommandline: C:\\msys\\1.0\\bin\\sh.exe", "Opcode":"Info", "UtcTime":"2015.04.27. 13:23", "ProcessGuid":"{00000000-3862-553E-0000-001051D40527}", "Image":"c:\\Program Files (x86)\\nxlog\\nxlog.exe", "CommandLine":"\"c:\\Program Files (x86)\\nxlog\\nxlog.exe\" -f", "User":"WIN-OUNNPISDHIG\\Administrator", "LogonGuid":"{00000000-568E-5453-0000-0020D5ED0400}", "LogonId":"0x4edd5", "TerminalSessionId":"2", "IntegrityLevel":"High", "HashType":"SHA1", "Hash":"1DCE4B0F24C40473CE7B2C57EB4F7E9E3E14BF94", "ParentProcessGuid":"{00000000-3862-553E-0000-001088D30527}", "ParentProcessId":"26544", "ParentImage":"C:\\msys\\1.0\\bin\\sh.exe", "ParentCommandLine":"C:\\msys\\1.0\\bin\\sh.exe", "EventReceivedTime":"2015-04-27 15:23:47", "SourceModuleName":"in", "SourceModuleType":"im_msvistalog" } Generally we will want to send the security audit events to a remote server. The following NXLog configuration does that. The important eventlog sources are read by the im_msvistalog module. On the output side the event are converted to JSON and then the JSON is inserted into the message part of a syslog record which is sent over a TCP connection to the server. define ROOT C:\Program Files (x86)\nxlog Moduledir %ROOT%\modules CacheDir %ROOT%\data Pidfile %ROOT%\data\nxlog.pid SpoolDir %ROOT%\data LogFile %ROOT%\data\nxlog.log LogLevel INFO <Extension _json> Module xm_json </Extension> <Extension _syslog> Module xm_syslog </Extension> <Input in> Module im_msvistalog Query <QueryList> \ <Query Id="0"> \ <Select Path="Microsoft-Windows-Sysmon/Operational">*</Select> \ <Select Path="Application">*</Select> \ <Select Path="System">*</Select> \

Collecting Windows Security Audit Log data with NXLog and Sysmon 6 / 6 </Input> <Select Path="Security">*</Select> \ </Query> \ </QueryList> <Output out> Module om_tcp Host 10.0.0.1 Port 1514 Exec to_json(); $Message = $raw_event; to_syslog_bsd(); </Output> <Route 66> Path </Route> in => out There are many different options for sending the data, e.g. using NXLog s Binary data format to preserve structured data, using TLS for security and encryption, sending only selected events, etc. We won t be discussing these here, except for the filtering options. We may not want to store or send all the eventlog records to the server so we need to filter them. There are three different options for filtering Sysmon generated data. The second two apply to any other eventlog record as well. Filtering data using the Sysmon configuration The most efficient method is to instruct Sysmon not to collect and store the event in the eventlog at all. This can be done with the filtering tags in the Sysmon XML configuration file as discussed earlier. Using the Query directive The im_msvistalog has a Query directive which can be used to specify an XML Query that gets passed to the Windows EventLog API in order to read only the selected events. The Windows Event Viewer can help construct such XML queries. The following example will only collect only process creation event records from the Sysmon source. Query <QueryList> \ <Query Id="0">\ <Select Path="Microsoft-Windows-Sysmon/Operational">*[System[(EventID= 1 ) ]]</Select>\ </Query>\ </QueryList> The event records filtered with the Query directive do not reach NXLog so this might be slightly more efficient than the next native NXLog filtering method. Filtering with NXLog s log processing language The NXLog log processing language is available for use by all modules and may be easier to write than the XML query syntax provided by the Windows EventLog API that the im_msvistalog exposes. The following NXLog style filter statement achieves the same as the XML Query above. Exec if not ($Channel == Microsoft-Windows-Sysmon and $EventID == 1) drop(); The following filtering rule will remove event records that are HTTP network connections to a specific server: Exec if $SourceName == Microsoft-Windows-Sysmon and $DestinationPort == 80 and $DestinationIp == 10.0.0.1 drop(); We hope that this short tutorial helped to get started with the basics of collecting Windows Security Audit logs. Feel free to drop us a line if you have any questions and comments or are interested in the enterprise offering and support.