Splunk Use Cases
Splunk Use Cases
Splunk Use Cases
index=__your_sysmon_index__ sourcetype=websense*
| where bytes_out > 35000000
| table _time src_ip bytes* uri
index=__your_sysmon_index__ sourcetype=symantec:*
| stats count range(_time) as TimeRange by Risk_Name, Computer_Name
| where TimeRange>1800
| eval TimeRange_In_Hours = round(TimeRange/3600,2), TimeRange_In_Days = round(TimeRange/3600/24,2)
Windows
Linux
https://0xcybery.github.io/blog/Splunk+Use+Cases 1/17
16/03/2024, 13:24 Splunk Use Cases
index=web sourcetype=access_combined
| iplocation clientip
| geostats dc(clientip) by Country
index=main sourcetype=iostat
| timechart avg(latency) by host
https://0xcybery.github.io/blog/Splunk+Use+Cases
/ 2/17
16/03/2024, 13:24 Splunk Use Cases
index=main sourcetype=iostat
| eval hostdevice=host+":"+Device
| timechart avg(total_ops) by hostdevice
index=main sourcetype=vmstat
| stats max(memUsedPct) as memused by host
| where memused>80
| from datamodel:"Network_Traffic"."All_Traffic"
| stats dc(dest_port) as dc_dest_port by src, dest
| where dc_dest_port > 10
OR
index=__your_sysmon_index__ sourcetype=firewall*
| stats dc(dest_port) as num_dest_port dc(dest_ip) as num_dest_ip by src_ip
| where num_dest_port >500 OR num_dest_ip >500
https://0xcybery.github.io/blog/Splunk+Use+Cases 3/17
16/03/2024, 13:24 Splunk Use Cases
| from datamodel:"Authentication"."Authentication"
| where like(app,"ssh")
| stats list(action) as Attempts, count(eval(match(action,"failure"))) as Failed,
count(eval(match(action,"success"))) as Success by user,src,dest,app
| where mvcount(Attempts)>=6 AND Success>0 AND Failed>=5
| from datamodel:"Malware"."Malware_Attacks"
| stats dc("signature") as "infection_count" by "dest"
| where 'infection_count'>1
https://0xcybery.github.io/blog/Splunk+Use+Cases 4/17
16/03/2024, 13:24 Splunk Use Cases
IP or domain used. Typically once executed, a follow on command will be used to execute the dropped file. Note that
the network connection or file modification events related will not spawn or create from bitsadmin.exe , but the
artifacts will appear in a parallel process of svchost.exe with a command-line similar to svchost.exe -k netsvcs -s
BITS . It’s important to review all parallel and child processes to capture any behaviors and artifacts. In some
suspicious and malicious instances, BITS jobs will be created. You can use bitsadmin /list /verbose to list out the
jobs during investigation.
https://0xcybery.github.io/blog/Splunk+Use+Cases 5/17
16/03/2024, 13:24 Splunk Use Cases
`sysmon` EventID=8 TargetImage=*lsass.exe | stats count min(_time) as firstTime max(_time) as lastTime by Computer,
EventCode, TargetImage, TargetProcessId | rename Computer as dest
Malware authors often use this technique to hide malicious executables behind legitimate Windows executable
names (e.g. lsass.exe , svchost.exe , etc).
sourcetype='firewall_logs' dest_ip = 'internal_subnet' | stats dc(dest_port) as pcount by src_ip | where pcount >5
https://0xcybery.github.io/blog/Splunk+Use+Cases 7/17
16/03/2024, 13:24 Splunk Use Cases
index=__your_sysmon_index__ (ParentImage="C:\\Windows\\System32\\services.exe"
Image="C:\\Windows\\System32\\cmd.exe" (CommandLine="*echo*" AND CommandLine="*\\pipe\\*"))
OR (Image="C:\\Windows\\System32\\rundll32.exe" CommandLine="*,a /p:*")
index=__your_sysmon_index__ (ParentImage="C:\\Windows\\System32\\services.exe"
Image="C:\\Windows\\System32\\cmd.exe" (CommandLine="*echo*" AND CommandLine="*\\pipe\\*"))
OR (Image="C:\\Windows\\System32\\rundll32.exe" CommandLine="*,a /p:*")
“INJECTRUNNING” as a related signature here. Whitelisting certain applications may be necessary to reduce noise for
this analytic.
https://0xcybery.github.io/blog/Splunk+Use+Cases 9/17
16/03/2024, 13:24 Splunk Use Cases
53- CMSTP
CMSTP.exe is the Microsoft Connection Manager Profile Installer, which can be leveraged to setup listeners that will
receive and install malware from remote sources in trusted fashion. When CMSTP.exe is seen in combination with an
external connection, it is a good indication of this TTP.
https://0xcybery.github.io/blog/Splunk+Use+Cases 10/17
16/03/2024, 13:24 Splunk Use Cases
https://0xcybery.github.io/blog/Splunk+Use+Cases 12/17
16/03/2024, 13:24 Splunk Use Cases
Although this analytic was initially based on MD5 hashes, it is equally applicable to any hashing convention.
Could be applied to a number of different types of monitoring depending on what information is desired. Some use
cases include monitoring for all remote connections and building login timelines for users. Logon events are
Windows Event Code 4624 for Windows Vista and above, 518 for pre-Vista. Logoff events are 4634 for Windows Vista
and above, 538 for pre-Vista.
Powershell can be used to hide monitored command line execution such as:
net use
sc start
To survive the timeout, adversaries and red teams can create services that direct to cmd.exe with the flag /c ,
followed by the desired command. The /c flag causes the command shell to run a command and immediately
exit. As a result, the desired program will remain running and it will report an error starting the service. This analytic
will catch that command prompt instance that is used to launch the actual malicious executable. Additionally, the
children and descendants of services.exe will run as a SYSTEM user by default. Thus, services are a convenient way
for an adversary to gain Persistence and Privilege Escalation.
https://0xcybery.github.io/blog/Splunk+Use+Cases 13/17
16/03/2024, 13:24 Splunk Use Cases
Because these commands are built in, they may be run frequently by power users or even by normal users. Thus, an
analytic looking at this information should have well-defined white- or blacklists, and should consider looking at an
anomaly detection approach, so that this information can be learned dynamically.
Although this analytic was created after CAR-2014-12-001, it is a much simpler (although more limited) approach.
Processes can be created remotely via WMI in a few other ways, such as more direct API access or the built-in utility
https://0xcybery.github.io/blog/Splunk+Use+Cases 14/17
16/03/2024, 13:24 Splunk Use Cases
73- Squiblydoo
Squiblydoo is a specific usage of regsvr32.dll to load a COM scriptlet directly from the internet and execute it in a
way that bypasses application whitelisting. It can be seen by looking for regsvr32.exe executions that load the
scrobj.dll (which execute the COM scriptlet) or, if that is too noisy, those that also load content directly via HTTP or
HTTPS.
Squiblydoo was first written up by Casey Smith at Red Canary, though that blog post is no longer accessible.
index=__your_sysmon_data__ EventCode=10
TargetImage="C:\\WINDOWS\\system32\\lsass.exe"
(GrantedAccess=0x1410 OR GrantedAccess=0x1010 OR GrantedAccess=0x1438 OR GrantedAccess=0x143a OR
GrantedAccess=0x1418)
CallTrace="C:\\windows\\SYSTEM32\\ntdll.dll+*|C:\\windows\\System32\\KERNELBASE.dll+20edd|UNKNOWN(*)"
| table _time hostname user SourceImage GrantedAccess
ProcDump may be used to dump the memory space of lsass.exe to disk for processing with a credential access tool
such as Mimikatz. This is performed by launching procdump.exe as a privileged user with command line options
indicating that lsass.exe should be dumped to a file with an arbitrary name.
Adversaries may delete these shadow copies, typically through the usage of system utilities such as vssadmin.exe or
wmic.exe, in order prevent file and data recovery. This technique is commonly employed for this purpose by
ransomware.
The analytic is based on a Sigma analytic contributed by Samir Bousseaden and written up in a blog on MENASEC. It
looks for a call trace that includes either dbghelp.dll or dbgcore.dll, which export the relevant functions/permissions
to perform the dump. It also detects using the Windows Task Manager (taskmgr.exe) to dump lsass, which is
described in CAR-2019-08-001. In this iteration of the Sigma analytic, the GrantedAccess filter isn’t included because
it didn’t seem to filter out any false positives and introduces the potential for evasion.
https://0xcybery.github.io/blog/Splunk+Use+Cases 16/17
16/03/2024, 13:24 Splunk Use Cases
This analytic takes all instances of LoLBAS execution and then looks for instances of command lines that are not
normal in the environment. This can detect attackers (which will tend to need the binaries for something different
than normal usage) but will also tend to have false positives.
The analytic needs to be tuned. The 1.5 in the query is the number of standard deviations away to look. It can be
tuned up to filter out more noise and tuned down to get more results. This means it is probably best as a hunting
analytic when you have analysts looking at the screen and able to tune the analytic up and down, because the
threshold may not be stable for very long.
References:
Splunk How-To
car.mitre.org
Analytics
https://0xcybery.github.io/blog/Splunk+Use+Cases 17/17