27

Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Embed Size (px)

Citation preview

Page 1: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1
Page 2: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Uh oh.

Page 3: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

3

we8106deskFortigate NG

Firewall192.168.250.1

Internetsuricata-idsOD-FM-CONF-NA

(AWS)

splunk-02

wenessus1192.168.2.50WE9041SRV

LAN

WESIFTSVR1WESTOQSVR1

webackupsvr1

Ransomware Lab

Hi! I’m an endpoint!

Page 4: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

4

we8106desk

splunk-02

webackupsvr1

Fortigate NG Firewall

192.168.250.1

Internetsuricata-idsOD-FM-CONF-NA

(AWS)

wenessus1192.168.2.50WE9041SRV

LAN

WESIFTSVR1WESTOQSVR1

USB Drive with Malicious Word Macro Doc

Infected.dotm(via USB drive)

Page 5: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

SELECT "Command",

"ParentCommandLine",

STRLEN(Command)

AS longtell FROM events

WHERE "EventID"='1'

AND "host2"='we8105desk'

AND longtell>500

Page 6: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Related: Finding (very) long command lines

Page 7: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• What is the parent process ID of 121214.tmp? • 3968

Event Chaining - Identifying Parent/Child Processes

Page 8: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• What is the name of the USB key inserted by Bob Smith?

Identifying Removable Media

Page 9: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• Start by googling “finding windows registry usb name site:microsoft.com”

• First hit: https://msdn.microsoft.com/en-us/library/windows/hardware/jj649944(v=vs.85).aspx

• I see something called FriendlyName• Continue researching?• Move Forward with that

hypothesis

I Know Nothing About USB Keys!!!Where Do I Start?

Page 10: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• Use index and windows registry sourcetype as our boundary

• Refine that with the term friendlyname we found on the msdn site

• Let’s see what we get• Maybe we refine (too large of a result set returned), maybe not

• Question asked about Bob Smith, so looking at specific hosts that he has touched would be a good thing to target our search a bit more

Stay Broad in Search To Start

Page 11: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Expand Our Results and See What We Have

Page 12: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• What is the name of the USB key inserted by Bob Smith?• MIRANDA_PRI

Identifying Removable Media

Page 13: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

15

we8106deskFortigate NG

Firewall192.168.250.1

Internetsuricata-idsOD-FM-CONF-NA

(AWS)

LAN

webackupsvr1

wenessus1192.168.2.50WE9041SRV

splunk-02

WESIFTSVR1WESTOQSVR1

Communication to Download Cryptor Code

Page 14: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• The malware downloads a file that contains the Cerber ransomware cryptor code. What is the name of that file?

Identifying Cryptor Code Filename and Origin

Page 15: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

stream:http

Page 16: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

SELECT "URL", "site", COUNT(*) as

num_sites FROM events

WHERE sourceip='192.168.250.100' and

"Vendor"='Suricata' AND NOT (site ILIKE

'%live%') AND NOT (site ILIKE '%bing%')

AND NOT (site ILIKE '%sym%') AND NOT

(site ILIKE '%digicert%') AND NOT (site

ILIKE '%omniroot%')

AND NOT (site ILIKE '%acronis%') AND

NOT (site ILIKE '%windows%') AND NOT

(site ILIKE '%microsoft%') AND NOT (site

ILIKE '%msn%') AND site IS NOT NULL

GROUP BY site,URL ORDER BY

num_sites DESC

Page 17: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Corroboration

Page 18: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

SELECT "Message"

FROM events

WHERE sourceip='192.168.250.100'

AND "Vendor"='Fortinet' AND

"Filename"='mhtr.jpg' AND severity>'8'

GROUP BY Message

SELECT "Message" FROM events

WHERE

sourceip='192.168.250.100' AND

"Vendor"='Fortinet' AND

severity>'8'

GROUP BY Message

Page 19: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

26

we8106desk

splunk-02

webackupsvr1

Fortigate NG Firewall

192.168.250.1

Internetsuricata-idsOD-FM-CONF-NA

(AWS)

wenessus1192.168.2.50WE9041SRV

LAN

WESIFTSVR1WESTOQSVR1

Local File Encryption

Page 20: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Our Initial Search

Page 21: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• Event ID 1: Process creation• The process creation event provides

extended information about a newly created process.

• The full command line provides context on the process execution.

• Event ID 2: A process changed a file creation time• The change file creation time event is

registered when a file creation time is explicitly modified by a process.

• This event helps tracking the real creation time of a file.

Sysmon Event Codes

Page 22: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

TargetFilename

Page 23: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Wildcard on a File Directory Structurewindows_xml.System.EventID:2 AND

result.file_path:"C:\\Users\\bob.smith.WAYNECORPINC\\" AND *.txt

Page 24: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

• The Cerber ransomware encrypts files located in Bob Smith's Windows profile. How many .txt files does it encrypt? • 406

Damage Assessment - Identifying Encrypted Text Files

Page 25: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

37

we8106desk

WE9041SRVwebackupsvr1

wenessus1192.168.2.50

splunk-02

Fortigate NG Firewall

192.168.250.1

Internetsuricata-idsOD-FM-CONF-NA

(AWS)

LAN

WESIFTSVR1WESTOQSVR1

Lateral Move to Fileshare

Page 26: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Searching with the Correct Destination

Page 27: Uh oh. - sans.org · 3 we8106desk Fortigate NG Firewall 192.168.250.1 suricata-ids Internet OD-FM-CONF-NA (AWS) splunk-02 wenessus1 WE9041SRV 192.168.2.50 LAN WESIFTSVR1 WESTOQSVR1

Want this data?https://goo.gl/14rmuU