0xcybery Github Io Blog Splunk Use Cases
0xcybery Github Io Blog Splunk Use Cases
T ags: Splunk
index=__your_sysmon_index__ sourcetype=websense*
index=__your_sysmon_index__ sourcetype=symantec:*
| where TimeRange>1800
Windows
Linux
index=web sourcetype=access_combined
| iplocation clientip
index=main sourcetype=iostat
index=main sourcetype=iostat
| eval hostdevice=host+":"+Device
index=main sourcetype=vmstat
| where memused>80
protocol=53 action!=Drop
*HKCU\\software\\microsoft\\windows\\currentversion\\run*) OR (ScriptBlockText=*bypass
noprofile* *-windowstyle* *hidden* *new-object* *system.net.webclient* *.download*) OR
| from datamodel:"Network_Traffic"."All_Traffic"
OR
index=__your_sysmon_index__ sourcetype=firewall*
| from datamodel:"Authentication"."Authentication"
| where like(app,"ssh")
| from datamodel:"Malware"."Malware_Attacks"
| where 'infection_count'>1
| tstats count min( time) as firstTime max( time) as lastTime from datamodel=Endpoint
| tstats count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.
Malware authors often use this technique to hide malicious executables behind legitimate
Windows executable names (e.g. lsass.exe , svchost.exe , etc).
index=__your_sysmon_index__ source="XmlWinEventLog:Microsoft-Windows-Sysmon/Operationa
(process_name=svchost.exe AND NOT (process_path="C:\\Windows\\System32\\svchost.exe" O
OR (process_name=smss.exe AND NOT process_path="C:\\Windows\\System32\\smss.exe")
try and attain SYSTEM: in the first technique, they create a named pipe and connects an
instance of cmd.exe to it, which allows them to impersonate the security context of cmd.exe,
which is SYSTEM. In the second technique, a malicious DLL is injected into a process that is
running as SYSTEM; the injected DLL steals the SYSTEM token and applies it where necessary to
escalate privileges. This analytic looks for both of these techniques.
remove the history file directly may very a bit if the history file is not saved in the default path
on a particular system.
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.
Although this analytic was initially based on MD5 hashes, it is equally applicable to any hashing
convention.
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.
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
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"
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.
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
with
by Abdullah Baghuth