MISC

Windows Security Log Events

Resources

ITOps

Active Directory

Windows Event Logs

AD - Group and Membership Changes

index=wineventlog source="WinEventLog:Security" (EventCode=4728 OR EventCode=4729)  Group_Name="*"
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| rename time AS Time src_user AS "Actioned By" user AS User  name as "Action Taken" Group_Name AS "Group Name" Account_Domain AS "Account Domain"
| table Time "Actioned By" User "Action Taken" "Group Name" "Account Domain"

AD - Clearing of Windows Audit Logs

index=wineventlog source="WinEventLog:Security" (EventCode=1102 OR EventCode=517) 
| eval Date=strftime(_time, "%Y/%m/%d") 
| stats count by Client_User_Name, host, index, Date 
| sort - Date 
| rename Client_User_Name as "Account Name"

AD - Console logins

index=wineventlog source="WinEventLog:Security" EventCode=4624 Logon_Type=2 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| rename time AS Time host AS Host user AS User dvc AS Device action AS Action
| table Time Host User Device Action
| dedup Time Host User Device Action

AD - Installed Applications

index=windows sourcetype="Script:InstalledApps" 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| rename time AS Time host AS Host 
| table Time,Host,DisplayName,Publisher,InstallSource,InstallDate
| sort Host

AD - Local Admin Account

index=wineventlog source="WinEventLog:Security" EventCode=4732 Group_Name=Administrators
| table _time,ComputerName,Group_Name,Account_Name,Message

AD - Failed Logins for Disabled Accounts

index=wineventlog source="WinEventLog:Security" EventCode=4625 Sub_Status="0xC0000072"
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| rename time AS Time host AS Host app AS Application src AS User src_ip AS "Source IP" dest AS Destination name AS Description
| table Time,Host,Application,User,"Source IP",Destination,Description

AD - Password Never Expires

index=wineventlog source="WinEventLog:Security" EventCode=4738 MSADChangedAttributes="*'Don't Expire Password' - Disabled*" OR MSADChangedAttributes="*'Don't Expire Password' - Enabled*"
| eval time = strftime(_time,"%c") 
| table time,host,name,user,src_user,dest,MSADChangedAttributes
| rename time as "Time" , name as "Action" , user as "User" , src_user as "Actioned By", dest as "Destination", host as "Hostname"

AD - Detect Windows Account Privilege Changes

index=wineventlog source="WinEventLog:Security" (EventCode=4672 OR EventCode=4673) user!="*$" name="Special privileges assigned to new logon" 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| rename time AS Time host AS Host user AS User app AS Application action AS Action 
| table Time,Host,User,Application,Action,Privileges

AD - A Member was Added/Removed from Domain Admin Group

index=wineventlog source="WinEventLog:Security" EventCode=4728 OR EventCode=4729 Group_Name="Domain Admins" 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table time,host,name,user,src_user,Group_Name 
| rename time as "Time" , name as "Action" , user as "User" ,src_user as "Actioned By", host as "Hostname", Group_Name as "Group Name"

AD - A user Account was Created/Deleted

index=wineventlog source="WinEventLog:Security" EventCode=4720 OR EventCode=4726
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table time,host,name,user,src_user 
| rename time as "Time" , name as "Action" , user as "User" ,src_user as "Actioned By",host as "Hostname"

AD - A user Account was Enabled/Disabled

index=wineventlog source="WinEventLog:Security" EventCode=4725 OR EventCode=4722 user!=*$ 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table time,host,name,user,src_user 
| rename time as "Time" , name as "Action" , user as "User" ,src_user as "Actioned By", host as "Hostname"

AD - RDP Connections

index=wineventlog source="WinEventLog:Security" Logon_Type=10 ((EventCode=4624 OR EventCode=528) OR (EventCode=4625 OR EventCode=529))
| eval action=CASE(EventCode=4624 OR EventCode=528, "Success", EventCode=4625 OR EventCode=529, "Failure")
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table time, user, src_user, src_ip, dest,action
| rename time AS Time user AS User src AS Source dest AS Destination action AS Action src_user AS "Source User" src_ip AS "IP Address"

AD - User Account Locked/Unlocked

index="wineventlog" source="WinEventLog:Security" signature="A user account was locked out" OR signature="A user account was unlocked" 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table time,host,user,name,src_user
| rename time as "Time" , name as "Action" , src_user as "Actioned By", host AS Host, user AS User

AD - User Account Changed (Password_Last_Set)

index="wineventlog" source="WinEventLog:Security" signature="A user account was changed" 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table time,host,user,name,src_user,Password_Last_Set
| rename time as "Time" , name as "Action" , user as "User" , src_user as "Actioned By" , host AS Host

AD - Domain Policy Changed/Reset Passowrd

index="wineventlog" source="WinEventLog:Security" signature="An attempt was made to change an account's password" OR signature="An attempt was made to reset an accounts password" 
| eval time=strftime(_time,"%Y-%m-%d %H:%M:%S")
| table time,host,user,name,src_user 
| rename time as "Time" , name as "Action" , user as "User" , src_user as "Actioned By" , host AS Host

AD - Windows Security Daily Domain Activities

index=wineventlog source=WinEventLog:Security src_nt_domain!="NT AUTHORITY" EventCode=4720 OR EventCode=4726 OR EventCode=4738 OR EventCode=4767 OR EventCode=4781 OR EventCode=4727 OR EventCode=4730 OR EventCode=4731 OR EventCode=4734 OR EventCode=4735 OR EventCode=4737 OR EventCode=4744 OR EventCode=4745 OR EventCode=4748 OR EventCode=4749 OR EventCode=4750 OR EventCode=4753 OR EventCode=4754 OR EventCode=4755 OR EventCode=4758 OR EventCode=4759 OR EventCode=4760 OR EventCode=4763 OR EventCode=4764 OR EventCode=4728 OR EventCode=4729 OR EventCode=4732 OR EventCode=4733 OR EventCode=4746 OR EventCode=4747 OR EventCode=4751 OR EventCode=4752 OR EventCode=4756 OR EventCode=4757 OR EventCode=4761 OR EventCode=4762
| rex field=member_id "^\w+\W(?<ITS_Admin>\w*\s\w*\s\w*|\w+_\w+|\w*\s\w*|\w*)(\s\w+\W|\s)(?<Target_Account>.*\S)"
| eval Target_Account=if(Target_Account="NONE_MAPPED", trim(member_dn, ITS_Admin), Target_Account)
| table _time, EventCode, src_nt_domain, ITS_Admin, Target_Account,src_nt_domain,msad_action,Group_Name,MSADChangedAttributes
| sort MSADChangedAttributes,ITS_Admin, Target_Account
| rename ITS_Admin as "ITS Admin", src_nt_domain as "Source Domain"

AD - Potential Suspicious Activity

index=wineventlog source="WinEventLog:Security" Account_Name!="SplunkForwarder" EventCode=4688 NOT (Account_Name=*$) (arp.exe OR at.exe OR bcdedit.exe OR bcp.exe OR chcp.exe OR cmd.exe OR cscript.exe OR csvde OR dsquery.exe OR ipconfig.exe OR mimikatz.exe OR nbtstat.exe OR nc.exe OR netcat.exe OR netstat.exe OR nmap OR nslookup.exe OR netsh OR OSQL.exe OR ping.exe OR powershell.exe OR powercat.ps1 OR psexec.exe OR psexecsvc.exe OR psLoggedOn.exe OR procdump.exe OR qprocess.exe OR query.exe OR rar.exe OR reg.exe OR route.exe OR runas.exe OR rundll32 OR schtasks.exe OR sethc.exe OR sqlcmd.exe OR sc.exe OR ssh.exe OR sysprep.exe OR systeminfo.exe OR system32\\net.exe OR reg.exe OR tasklist.exe OR tracert.exe OR vssadmin.exe OR whoami.exe OR winrar.exe OR wscript.exe OR "winrm.*" OR "winrs.*" OR wmic.exe OR wsmprovhost.exe OR wusa.exe) 
| eval Message=split(Message,".") 
| eval Short_Message=mvindex(Message,0) 
| table _time, host, Account_Name, New_Process_Name, New_Process_ID, Creator_Process_ID, Short_Message

AD - List All Successful Logins by Account Name

index=wineventlog source="WinEventLog:security" (Logon_Type=2 OR Logon_Type=7 OR Logon_Type=10) (EventCode=528 OR EventCode=540 OR EventCode=4624) | rex "New\sLogon:\s+.*\s+Account\sName:\s+(?<UserName>\S+)" | eval Account=coalesce(User_Name,UserName) | stats count by Account | sort - count

AD - Accounts Deleted within 24 Hours of Creation

index=wineventlog source=WinEventLog:Security (EventCode=4726 OR EventCode=4720) 
| eval Date=strftime(_time, "%Y/%m/%d") 
| rex "Subject:\s+\w+\s\S+\s+\S+\s+\w+\s\w+:\s+(?<SourceAccount>\S+)" 
| rex "Target\s\w+:\s+\w+\s\w+:\s+\S+\s+\w+\s\w+:\s+(?<DeletedAccount>\S+)" 
| rex "New\s\w+:\s+\w+\s\w+:\s+\S+\s+\w+\s\w+:\s+(?<NewAccount>\S+)" 
| eval SuspectAccount=coalesce(DeletedAccount,NewAccount) 
| transaction SuspectAccount startswith="EventCode=4720" endswith="EventCode=4726" 
|eval duration=round(((duration/60)/60)/24, 2) 
| eval Age=case(duration<=1, "Critical", duration>1 AND duration<=7, "Warning", duration>7, "Normal")
| table Date, index, host, SourceAccount, SuspectAccount, duration, Age 
| rename duration as "Days Account was Active" 
| sort + "Days Account was Active"

AD - Password Non Compliance

index=wineventlog source="WinEventLog:Security" EventCode=4723  Keywords="Audit Failure" 
| eval Date=strftime(_time, "%Y/%m/%d") 
| rex "Target\sAccount:\s+Security\sID:.*\\\(?<account>\S+)" 
| stats count by Date, account, host 
| sort - Date

AD - Modification to File Permissions

index=wineventlog source="WinEventLog:Security" EventCode=4670 (Security_ID!="NT AUTHORITY*") (Security_ID!="S-*")
| eval Date=strftime(_time, "%Y/%m/%d")
| stats count by Date, Account_Name, Process_Name, Keywords, host
| sort - Date

AD - Failed Authentication to Non-existing Accounts

index=wineventlog source="WinEventLog:Security" EventCode=4625 Sub_Status=0xC0000064 
| eval Date=strftime(_time, "%Y/%m/%d") 
| rex "Which\sLogon\sFailed:\s+Security\sID:\s+\S.*\s+\w+\s\w+\S\s.(?<uacct>\S.*)" 
| stats count by Date, uacct, host 
| rename count as "Attempts" 
| sort - Attempts

AD - System Time Modifications

index=wineventlog source="WinEventLog:Security" EventCode=4616 (NOT Account_Name="*$") (NOT Account_Name="LOCAL SERVICE")
| eval Date=strftime(_time, "%Y/%m/%d %H:%M:%S")
| eval oldtime = strptime(replace(Previous_Time, "\D", ""), "%Y%m%d%H%M%S%9N") 
| eval t=_time 
| rename t as "eventtime" 
| eval diff=round(((eventtime-oldtime)/60)/60,2) 
| where diff!=0
| stats count by host, Account_Name, diff, Date 
| sort - Date
| rename diff as "Hours Between New Time and Actual Time" 
|rename Account_Name as "Source Account" 
| rename host as "Target Machine"
|rename Date as "Date and Time"
| fields - count

AD - User Logon / Session Duration

index=wineventlog source=WinEventLog:Security (EventCode=4624 OR EventCode=4634) (Logon_Type=2 OR Logon_Type=10) 
| eval Date=strftime(_time, "%Y/%m/%d")
| eval LogonType=case(Logon_Type="2", "Local Console Access", Logon_Type="10", "Remote Desktop via Terminal Services")
| transaction host user startswith=EventCode=4624 endswith=EventCode=4634 | where duration > 5 | eval duration = duration/60 
| eval duration=round(duration,2)
| table host, user, LogonType duration, Date 
| rename duration as "Session Duration in Minutes" 
| sort - date

AD - Password Changes by User Account

index=wineventlog source="WinEventLog:Security" (EventCode=628 OR EventCode=627 OR EventCode=4723 OR EventCode=4724) 
| chart count by user

LDAP Queries

AD - Dormant Account

| ldapsearch domain=default search="(&(objectclass=user)(!(objectClass=computer)))" limit=0 attrs="sAMAccountName, displayName, distinguishedName, userAccountControl, whenCreated, accountExpires, lastLogonTimestamp"
| makemv userAccountControl
| search dn!="*OU=_Disabled Users*" userAccountControl!="*ACCOUNTDISABLE*"
| eval lastLoginAge_epoch=strptime(lastLogonTimestamp, "%Y-%m-%dT%H:%M:%S")
| eval lastLoginAge=round((lastLoginAge_epoch - now())/86400, 0)
| where lastLoginAge < -90
| table sAMAccountName, displayName, dn, userAccountControl, whenCreated, lastLoginAge, lastLogonTimestamp, accountExpires

AD - Passwords Never Changed

| ldapsearch domain=default search="(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(userAccountControl:1.2.840.113556.1.4.803:=65536))" attrs="sAMAccountName,pwdLastSet" 
| table sAMAccountName, dn, pwdLastSet

AD - Passwords Last Changed

| ldapsearch domain="default" search="(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))" attrs="sAMAccountName,pwdLastSet"
| table sAMAccountName, dn, pwdLastSet

AD - Check for Disabled User Accounts

| ldapsearch domain="default" search="(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))" attrs="sAMAccountName"
| table sAMAccountName, dn
Linux

Linux - SSH Logins

index=linux "Accepted Publickey" OR "session opened" OR "Accepted password" src!="PAM_IP_ADDR" src!="" user!=""
| table _time,user,src,dest,src_port,sshd_protocol,action

Linux - SSH Logins (map the dest field to an IP address using the deployment server client data)

index=linux sourcetype="linux_secure" OR source="/var/log/sshd.log" 
  ("Accepted Publickey" OR "session opened" OR "Accepted password") 
  app!="" user_name!="grid" src!="PAM_IP_ADDR" 
| table _time, host, user_name, app, action, src, src_port, dest
| eval dest_short = replace(dest, "\..*$", "")
| join type=left dest_short [
    | rest /services/deployment/server/clients 
    | eval host_short = replace(hostname, "\..*$", "")
    | eval dns_short = case(
          match(dns, "^[0-9\.]+$"), null(),
          dns!="", replace(dns, "\..*$", "")
      )
    | eval lookup_key = coalesce(host_short, dns_short)
    | stats values(ip) as ip by lookup_key
    | rename lookup_key as dest_short
  ]
| eval dest_ip = coalesce(ip, dest)
| table _time, host, user_name, app, action, src, src_port, dest_ip

Linux - SSH Logins (Syslog - SC4S)

index=osnix source="program:sshd" "Accepted Publickey" OR "session opened" _raw!="*PAM_IP_ADDR*" 
| table _time,host,sc4s_fromhostip,user 
| dedup _time,host,user | sort -_time

Linux - Console logins

index=osnix OR index=linux "Started Session 7 of" 
| table _time,host,_raw

Linux - Repeated Unsuccessful Logon Attempts

index=linux sourcetype=linux_secure
| eval Date=strftime(_time, "%Y/%m/%d")
| rex ".*:\d{2}\s(?<hostname>\S+)"
| rex "gdm\S+\sauthentication\s(?<status>\w+)"
| rex "\suser[^'](?<User>\S+\w+)"
| search status=failure| stats count as fails by Date, User, hostname
| eval "Alert Level"=case(fails>=50, "Critical", fails<50 AND fails>=20, "Warning", fails<20, "Normal")
| sort - fails| rename fails as "Failed Logon Attempts"
| rename User as "Account in Question"

Linux - Top 10 Most Active Hosts

index=linux sourcetype=linux_secure 
| rex ".*:\d{2}\s(?<hostname>\S+)"
| top limit=10 hostname

Linux - Top 10 Most Active Users

index=linux sourcetype=linux_secure 
| rex "\suser[^'](?<User>\S+\w+)" 
| top limit=10 User

Linux - List of Users

index=linux sourcetype=linux_secure 
| rex "\suser[^'](?<User>\S+\w+)" 
| stats count by User
Appian

Appian - Admin Console

Appian - Blocked Files

Appian - Data Store Deletions

Appian - Decryption

Appian - DevOps Infrastructure

Appian - Devops Infrastructure Handler

Appian - File Attachment Downloads

Appian - Login Audit

Appian - Object Rolemap Audit

Appian - Records Usage

Appian - Removed Processes

Appian - Sites Usage

Appian - Users

Appian - User Management

CrowdStrike

CrowdStrike - Logins

CrowdStrike FW - RDP Sessions

CrowdStrike - Malware Detections

CrowdStrike - Policies

CrowdStrike - FileVantage

CrowdStrike - Identities

CrowdStrike - Event Streams

CrowdStrike - Devices

F5 BIG-IP

F5 - Admin Actions

F5 - Blocked Multi-Severity Attack Incidents

F5 - Multi-Severity Attack Incidents

F5 - Web Logins

F5 - Pool Status

Symantec

Symantec Email - AntiMalware

Symantec Email - AntiSpam

vCenter

vCenter - Logins

vCenter - VM Events

FortiGate

FortiGate - Admin Login Failure Audit

Cisco

Cisco Umbrella (DNS)

Cisco Umbrella (Audit)

Cisco ISE (Guest Users)

Cisco Router logins

Cisco FMC - Blocked File Transfer Services

Cisco FMC - Audit Logs

Cisco FMC Policy Changes

Cisco SNA (Stealthwatch)

Senhasegura

Senhasegura - Sessions

Senhasegura - Device Creation

DBConnect

DBConnect - User Activity in DBConnect

Others

Office365 - Attachment Size Policy

Idrac

Detect Credit Card Numbers using Luhn Algorithm

Windows Event ID
Event Summary

4720

A user account was created

4722

A user account was enabled

4723

An attempt was made to change an account's password

4724

An attempt was made to reset an accounts password

4725

A user account was disabled

4726

A user account was deleted

4738

A user account was changed

4781

The name of an account was changed

4782

The password hash an account was accessed

4624

An account was successfully logged on

4740

A user account was locked out

4634

An account was logged off

4625

An account failed to log on

4648

A logon was attempted using explicit credentials

4732

A member was added to a security-enabled local group

4728

A member was added to a security-enabled global group

4756

A member was added to a security-enabled universal group

4733

A member was removed from a security-enabled local group

4729

A member was removed from a security-enabled global group

4757

A member was removed from a security-enabled universal group

4657

A registry value was modified

4672

Special privileges assigned to new logon

4697

A service was installed in the system

4698

A scheduled task was created

4699

A scheduled task was deleted

4700

A scheduled task was enabled

4701

A scheduled task was disabled

4702

A scheduled task was updated

4608

Windows is starting up

4609

Windows is shutting down

4800

The workstation was locked

4801

The workstation was unlocked

5140

A network share object was accessed

5145

A network share object was checked to see whether client can be granted desired access

1102

The audit log was cleared. (Security)

Failure Information:

The section explains why the logon failed.

Status and Sub Status Codes
Description (not checked against "Failure Reason:")

0xC0000064

user name does not exist

0xC000006A

user name is correct but the password is wrong

0xC0000234

user is currently locked out

0xC0000072

account is currently disabled

0xC000006F

user tried to logon outside his day of week or time of day restrictions

0xC0000070

workstation restriction, or Authentication Policy Silo violation (look for event ID 4820 on domain controller)

0xC0000193

account expiration

0xC0000071

expired password

0xC0000133

clocks between DC and other computer too far out of sync

0xC0000224

user is required to change password at next logon

0xC0000225

evidently a bug in Windows and not a risk

0xc000015b

The user has not been granted the requested logon type (aka logon right) at this machine

Logon Types

Type
Description

2

Console

3

Network

4

Batch (Scheduled Tasks)

5

Windows Services

7

Screen Lock/Unlock

8

Network (Cleartext Logon)

9

Alternate Credentials Specified (RunAs)

10

Remote Interactive (RDP)

11

Cached Credentials (e.g., Offline DC)

12

Cached Remote Interactive (RDP, similar to Type 10)

13

Cached Unlock (Similar to Type 7)

Last updated