past: threat intelligence and · • past: threat intelligence and apt response • present: builds...

36

Upload: others

Post on 19-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication
Page 2: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

• Microsoft Defender Research

• Past: Threat Intelligence and

APT response

• Present: Builds algorithms to

classify malware in real-time

• Future: ??

Page 3: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Threat Analysis is largely manual work

• Not just automated IOC feeds

• Some Reverse Engineering, Forensics

• Lots of… READING!!

Alphaspirit/Shutterstock.com

Page 4: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

https://www.fireeye.com/content/dam/fireeye-www/global/en/current-threats/pdfs/rpt-apt28.pdf

https://www.csoonline.com/article/3321911/security/russian-cozy-bear-apt-29-hackers-may-be-impersonating-state-department.html

https://www.symantec.com/blogs/threat-intelligence/dragonfly-energy-sector-cyber-attacks

Page 5: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

APT 28Data Obfuscation, Connection Proxy,

Standard Application Layer Protocol, Remote

File Copy, Rundll32 ,Indicator Removal on

Host, Timestomp, Credential Dumping,

Screen Capture, Bootkit, Component Object

Model Hijacking, Exploitation for Privilege

Escalation, Obfuscated Files or Information,

Input Capture, Replication Through

Removable Media, Communication Through

Removable Media, Pass the Hash, Data

Staged, Data from Removable Media,

Peripheral Device Discovery, Access Token

Manipulation, Valid Accounts, Office

Application Startup, System Owner/User

Discovery, Process Discovery, System

Information Discovery, File Deletion,

Credentials in Files, File and Directory

Discovery, Network Sniffing, Dynamic Data

Exchange, Data from Local System, Hidden

Files and Directories, Scripting, Logon Scripts,

Spearphishing Attachment,

Deobfuscate/Decode Files or Information,

Exploitation of Remote Services, Exploitation

for Defense Evasion, Data from Information

Repositories, User Execution

APT 29

PowerShell, Scripting,

Indicator Removal on Host,

Software Packing, Scheduled

Task, Registry Run Keys / Start

Folder, Bypass User Account

Control, Windows

Management Instrumentation

Event Subscription, Windows

Management Instrumentation,

Pass the Hash, Accessibility

Features, Domain Fronting

,Multi-hop Proxy,

Spearphishing Attachment,

Spearphishing Link,

Exploitation for Client

Execution, User Execution

Shoebox of Tools, Tactics and Procedures

DragonflyScreen Capture, PowerShell, Remote File Copy, File Deletion, Create Account, Disabling Security Tools, External Remote Services, Brute Force, Credential Dumping, Scripting, Masquerading, Indicator Removal on Host, Web Shell, Commonly Used Port, Email Collection, Remote Desktop Protocol, Network Share Discovery, Scheduled Task, Forced Authentication

Page 6: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Graph of Techniques used by /bear/APTs

Dragonfly

APT29

APT28

https://mitre-attack.github.io/caret/#/

Page 7: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Graph of Techniques used by /bear/ APTs with prevalence of each technique

Prioritize

DeprioritizeDragonfly

APT29

APT28

https://mitre-attack.github.io/caret/#/

Page 8: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

pa

Can this be done by machine learning?

Input {black box} Output

• Written material

• Blogs

• Whitepapers

• Incident Response

reports

• Extract actor names

• Extract tools names

• Extract techniques

• Extract

relationships

• Attacker graphs

• Timelines

Page 9: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Introduce the idea of Named Entity Extraction

Build a machine learning/deep learning based Cyber Entity Extractor

Training Data

Feature Extraction

Architecture and Models

Evaluation

Demo

Driving Impact

pa

Agenda

Page 10: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

What is Named Entity Extraction?

Page 11: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Dropping Elephant: BADACTOR

Chinastrats: BADACTOR

Patchwork: BADACTOR

spear-phishing: TECHNIQUE

watering hole: TECHNIQUE

https://gameofthrones.fandom.com/wiki/Sansa_Stark https://securelist.com/the-dropping-elephant-actor/75328/

Sansa Stark: PERSON

Eddard Stark: PERSON

Catelyn: PERSON

Winterfell: ORGANIZATION (GEOPOLITICAL ENTITY)

Page 12: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Training Data Feature Extraction

Architecture Assessments

Training our own Cyber Entity Extractor

Page 13: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Training Data

APT Notes

Public threat intelligence blogs

collected since June 2018

2704 Documents

On average, ~1% of the tokens are

“interesting”

Page 14: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Training Data

Labels: Caret Dataset (MITRE)

Automatically annotated using longest

extent pattern matching

Kinda noisy, but best we can do short

of manual annotation

Page 15: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Numbered Panda (also known as IXESHE,

DynCalc, DNSCALC, and APT12) is a cyber

espionage group believed to be linked with the

Chinese military.

('Numbered', 'B-BADACTOR’),

('Panda', 'I-BADACTOR’),

('(', 'O’),

('also', 'O’),

('known', 'O’),

('as', 'O’),

('IXESHE', 'B-BADACTOR’),

(',', 'O’),

('DynCalc', 'B-BADACTOR’),

(',', 'O’),

('DNSCALC', 'B-BADACTOR’),

(',', 'O’),

('and', 'O’),

('APT12', 'B-BADACTOR’),

(')', 'O’),

('is', 'O’),

('a', 'O’),

('cyber', 'O’),

Training Data

('espionage', 'O’),

('group', 'O’),

('believed', 'O’),

('to', 'O’),

('be', 'O’),

('linked', 'O’),

('with', 'O’),

('the', 'O’),

('Chinese', 'O’),

('military', 'O’),

('.', 'O')

Page 16: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Training Data Feature Extraction

Architecture Assessments

Training our own Cyber Entity Extractor

Page 17: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Traditional

Word itself

Part of speech

Lemma

Word type (alphanumeric, digits, punctuation)

Orthographic features (lowercase, ALLCAPS,

Upper initial, MiXedCaPs etc.)

Unsupervised

Word Embeddings

pa

Feature Extraction

Page 18: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Generic Word Embeddings

Page 19: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

apt29

sofacy

dymalloy

apt28

tg-4127

Of the 5 vectors closest to “apt28”, 2

are aliases (sofacy and tg-4127) and 2

are related by attribution

Page 20: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Dogcall, ruhappy, pooraim and

shutterspeed are all malware used by

APT37

ruhappydogcall

shutterspeed

pooraim

slowdrift

Page 21: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Tokens occurring in techniques

Tokens occurring in Actor Names

Tokens occurring in Malware Names

Page 22: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Training Data Feature Extraction

Architecture Assessments

Training our own Cyber Entity Extractor

Page 23: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Architecture

HTML and PDF Parsers

Text Pre-processing

Word embeddings(word2vec)

Blogs,

White Papers,

IR Reports

Labeled training

data

Labeled testdata

Custom Feature Extraction

Word Embedding Features

Model (CRF or LSTM)

Custom Feature Extraction

Word Embedding Features

FIT

TEST

Page 24: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Statistical modeling method

Not Deep Learning

Used for sequence labeling tasks.

Commonly used in Natural Language processing, biological sequences and

computer vision

Has short term memory

2 Experiments with CRF (one with and one without the word embeddings)

Conditional Random Fields (CRF)

Page 25: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Long Short-term Memory (LSTM)

• Special type of RNN

• 2 Stacked Bidirectional LSTM Layers

• With Dropout

• Categorical Cross Entropy Loss Function

• Softmax activation for the final layer

• Keras + tensorflow

Embedding Layer Output Shape: None, 75, 100

Bidirectional (LSTM) Output Shape: None, 75, 300

Dropout Output Shape: None, 75, 100

Bidirectional (LSTM) Output Shape: None, 75, 300

Dropout Output Shape: None, 75, 100

Timedistributed (dense) Output Shape: None, 75, 300

Page 26: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Training Data Feature Extraction

Architecture Assessments

Training our own Cyber Entity Extractor

Page 27: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Assessment

3500

2417

966

2396

2087

840

2294

2071

876

3009

1885

942

0 500 1000 1500 2000 2500 3000 3500 4000

Actor

Malware

Technique

Recall CountsLSTM

CRF Without Embeddings

CRF With Embeddings

Actual

Page 28: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Assessment0.99

0.76

0.98

0.74

0.93

0.93

POSI T I VE PRE C I S I ON POSI T I VE RE C ALL

OVERALL PRECISION AND RECALL

CRF With Embeddings CRF Without Embeddings LSTM

1

0.22

0.47

0.03

0.84

0.07

POSI T I VE PRE C I S I ON POSI T I VE RE C ALL

PRECISION AND RECALL FOR UNSEEN TOKENS

CRF With Embeddings CRF Without Embeddings LSTM

Precision = TP/(FP+TP)

Recall = TP/(TP+FN)

Page 29: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Demo

udi Steinwell via PikiWiki - Israel free image collection project. CC Attribution 2.5 Generic

Page 30: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication
Page 31: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Next Steps…

• Attention networks

• Data Augmentation

• Sophisticated Relationship Extraction

• Temporal relationships

CCO 1.0 https://picryl.com/media/fish-kids-clip-art-people-b9882d

Page 32: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Driving Impact

Page 33: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Graph of Techniques used by /bear/ APTs with prevalence of each technique

Prioritize

DeprioritizeDragonfly

APT29

APT28

https://mitre-attack.github.io/caret/#/

Page 34: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Overlap in techniques used by commodity malware vs APTs

Emissary Panda

Emotet

Saffron Rose

Muddywater

Stone Panda

Snake

Hangover

Page 35: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Move beyond IOC feeds

Rich unstructured data can be extracted

with Machine Learning

Graphs

Timelines

We can use this to make better decisions

to improve security of our orgs

In conclusion

Page 36: Past: Threat Intelligence and · • Past: Threat Intelligence and APT response • Present: Builds algorithms to classify malware in real-time ... Removable Media, Communication

Contributors:

Arun Gururajan, Daewoo Chong and Jugal

Parikh for Data Science Expertise

Peter Cap and Jessica Payne for Threat

Intelligence Expertise

Chris Ackerman for the demo website

Karen Lavi for encouragement, better

presentation

[email protected]

@bsoman3

Acks/Q&A/Thanks

CC BY 2.0 https://www.flickr.com/photos/signote/6102820227