Incident Response splunk filters

List All Indexes

 | eventcount summarize=false index=* 
 | stats count by index

 | rest /services/data/indexes
 | table title

Identify Available Sourcetypes

  | metadata type=sourcetypes
  | table sourcetype, totalCount

 | metadata type=sources
 | table source totalCount firstTime lastTime

Explore the Fields in Your Data

 | eventcount summarize=false index=*
 | fields *
 | stats count by sourcetype

Search for Specific Event Types (e.g., Security Logs): 
 index=windows sourcetype=WinEventLog:Security
 | stats count by EventCode
 
 index="botsv1" sourcetype=WinEventLog
 | stats count by EventCode,source
 | rename count as total_count
 | sort - total_count

Check for Sysmon Logs:
 index=sysmon sourcetype=XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
 | stats count by EventCode

List Data Sources by Host:

SPL Basic Structure

Sure! Let's break down each of the commands and functions in Splunk:

1. dc(field)

  • Description: Stands for "distinct count." It counts the number of unique values in a specified field.

  • Example:

  • Counts the number of unique users in the user field

2. sum(field)

  • Description: Adds up all the values in a specified field.

  • Example:

  • Adds up all values in the bytes field to calculate the total

3. iplocation

  • Description: Retrieves geographic information about an IP address, such as country, region, city, latitude, and longitude.

  • Example:

  • Enhances events by adding fields like City, Region, Country, and Longitude/Latitude for the ip field

4. dedup

  • Description: Removes duplicate events based on one or more fields, keeping only the first occurrence of each unique value.

  • Example:

  • Removes duplicate events based on the user field, keeping only the first event for each unique user

5. eval

  • Description: Used to create or modify fields by applying expressions and functions. It's highly flexible and supports various operations, such as mathematical calculations, string manipulation, and conditionals.

  • Example:

  • Concatenates the first_name and last_name fields into a new field called full_name

6. timechart count BY <field>

  • Description: Creates a time-based chart showing the count of events, grouped by a specific field.

  • Example:

  • Produces a chart that shows the count of events over time, broken down by the status field (e.g., 200, 404)

7. rename

  • Description: The rename command is used to rename fields in your search results. This is helpful when you want to use more descriptive field names or avoid conflicts when combining data from multiple sources.

  • Example:

  • Renames the client_ip field to IP_Address and the status field to HTTP_Status

  1. chart

  • Description: The chart command is used to transform the data into tables or visualizations.

  • Example: index=windowslogs | chart count by User

Network Connections

Identifying Brute Force Attacks

Detecting File Uploads

LOGON activity

Detect Changes to High-Value Accounts

Privilege Escalation Detection

Monitoring Malicious File Execution

Scheduled Task

Persistence Registry Detection

PowerShell Detection

Lateral Movement & Pivot Detection

Golden Ticket Attack Detection

Kerberoasting Attack Detection

Last updated