Top Banner
Abusing File Processing in Malware Detectors for Fun and Pro t Suman Jana and Vitaly Shmatikov The University of Texas at Austin
33

Abusing File Processing in Malware Detectors for Fun and Profit

Feb 24, 2016

Download

Documents

Nicki

Abusing File Processing in Malware Detectors for Fun and Profit. Suman Jana and Vitaly Shmatikov The University of Texas at Austin. Modern malware research. All about sophisticated detection and evasion techniques Polymorphism, metamorphism, obfuscation… . Topic of this talk. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Abusing File Processing in Malware Detectors for Fun and Profit

Abusing File Processing in Malware Detectors for

Fun and ProfitSuman Jana and Vitaly Shmatikov

The University of Texas at Austin

Page 2: Abusing File Processing in Malware Detectors for Fun and Profit

• All about sophisticated detection and evasion techniqueso Polymorphism, metamorphism, obfuscation…

Modern malware research

Page 3: Abusing File Processing in Malware Detectors for Fun and Profit

• All about sophisticated detection and evasion techniqueso Polymorphism, metamorphism, obfuscation..

the world’s best malware detector

the world’s simplest virus

no changes to virus content

against

Topic of this talk

Page 4: Abusing File Processing in Malware Detectors for Fun and Profit

Malware researcher’s view of malware detection

malware detectorhoneypot

malware

Page 5: Abusing File Processing in Malware Detectors for Fun and Profit

users

internet gateway

malware detector

parseinfer file type

How malware detectors work in practice

internet

intranet

Page 6: Abusing File Processing in Malware Detectors for Fun and Profit

• Detection algorithms are type-specific• Parsing depends on file type

• Detectors may skip less vulnerable types like MPEG

efficiency

Why must malware detectors infer file types?

correctness

Page 7: Abusing File Processing in Malware Detectors for Fun and Profit

Parsing in malware detectors

macros

<a> foo <\a>

<a>foo<\a>

Archive files HTML filesWord documents

find macros extract filesremove whitespace

characters

Page 8: Abusing File Processing in Malware Detectors for Fun and Profit

Parsing in malware detectors

MS CAB

MS CHMJavaScript

PDFMS EXE

ELF

Adobe Flash

RTFMS PPT(X)

COFF

bzip

COM

MS DLL7-zip JAR

GIF

MP3

JPEG

Page 9: Abusing File Processing in Malware Detectors for Fun and Profit

Why must malware detectors parse before detection?

• Identify executable contento Macros in Word fileso Code segments in PE, ELFo JavaScript in CHM

• Normalize input to a form suitable for detectiono Decompresso Preprocess HTML

• Separate metadata from content

detectors must parse lots of file

formats

Page 10: Abusing File Processing in Malware Detectors for Fun and Profit

File-type inference and parsingtake place in two different places

internet

infer file type

parse

if uninfected

malware detector user application/OS

parse difference =

potentialevasion

infer file type

Page 11: Abusing File Processing in Malware Detectors for Fun and Profit

Exhibit A (CVE-2012-1419)

• TAR files: ustar at offset 257• mirc.ini files: [aliases] at offset 0

TAR archive

eicar.com\0

header

initial 100 bytes contains the name

of first file ustar

eicar.com

Page 12: Abusing File Processing in Malware Detectors for Fun and Profit

• TAR files: ustar at offset 257• mirc.ini files: [aliases] at offset 0

TAR archive

[aliases].com\0

header

filename changes but the content is

unmodified ustar

Exhibit A (CVE-2012-1419)

eicar.com

Page 13: Abusing File Processing in Malware Detectors for Fun and Profit

Vulnerable detectors

Page 14: Abusing File Processing in Malware Detectors for Fun and Profit

Exhibit B (CVE-2012-1463)

Executable and Linkable Format (ELF)

offset 51 : little-endian2 : big-endian

header

1

Page 15: Abusing File Processing in Malware Detectors for Fun and Profit

Exhibit B (CVE-2012-1463)

offset 51 : little-endian2 : big-endian

header

2Linux ELF loader does not use this

byte but most malware detectors

do

Executable and Linkable Format (ELF)

Page 16: Abusing File Processing in Malware Detectors for Fun and Profit

Vulnerable detectors

Page 17: Abusing File Processing in Malware Detectors for Fun and Profit

Exhibit C (CVE-2012-1461)

gzip

eicar.tar

eicar.tar.1 eicar.tar.2

eicar.tar.gz

most detectors cannot parse such files correctly but

gunzip does

Page 18: Abusing File Processing in Malware Detectors for Fun and Profit

Vulnerable detectors

Page 19: Abusing File Processing in Malware Detectors for Fun and Profit

Exhibit D (CVE-2012-1459)

TAR archive layout

most detectors ignore

checksum field

length

header 1

header 2

uninfected file

checksum

Page 20: Abusing File Processing in Malware Detectors for Fun and Profit

Exhibit D (CVE-2012-1459)

TAR archive layout

length

header 1

wrong checksum

header 2

uninfected file most detectors ignore

checksum field

GNU tar ignores header with wrong checksum, extracts

malware

Page 21: Abusing File Processing in Malware Detectors for Fun and Profit

Vulnerable detectors

Page 22: Abusing File Processing in Malware Detectors for Fun and Profit

Many more attacks

• 45 different CVE reports for previously unknown evasion exploits

• 9 file formats• 13 applications

Page 23: Abusing File Processing in Malware Detectors for Fun and Profit

36 tested detectors – ALL vulnerable

Page 24: Abusing File Processing in Malware Detectors for Fun and Profit

You might be thinking…

Aren’t these well-known bugs?

Page 25: Abusing File Processing in Malware Detectors for Fun and Profit

Response from AV vendors

• OMG! These exploits completely bypass our detection engineso Patches are being pushed out

Page 26: Abusing File Processing in Malware Detectors for Fun and Profit

You might be thinking…

Aren’t these the same as browser content-sniffing bugs?

No

Page 27: Abusing File Processing in Malware Detectors for Fun and Profit

Content-sniffing bugs in browsers

• MIME content sniffing in Web browsers can be exploited for XSS attacks o First reported by Palant (2007) and Nazario (2009)

• Defense for browsers [Barth et al.]: prefix-disjoint signatures… does not work for malware detectorso Signatures for many formats that detectors must deal

with are not prefix-disjoint

Page 28: Abusing File Processing in Malware Detectors for Fun and Profit

You might be thinking…

These attacks affect only archive formats

Page 29: Abusing File Processing in Malware Detectors for Fun and Profit

Does this affect only archive formats?

• No, we have attacks against ELF, PE, MS CHM, MS Word, etc.

• What is an archive format anyway?o Many modern formats (e.g. PDF, MS Word) allow

embedding different types of content

Page 30: Abusing File Processing in Malware Detectors for Fun and Profit

You might be thinking…

Behavioral detection will save us

Page 31: Abusing File Processing in Malware Detectors for Fun and Profit

No, behavioral detection will not save you

infer file type

parse

malware detector user application/OS

parse

they must be exactly the same

For behavioral detection to work

here ….

infer file type

Page 32: Abusing File Processing in Malware Detectors for Fun and Profit

Possible solutions

• Write better parsers • On-access scanning

o Does not work in network/cloud detectors

• Better integration of malware detectors with applicationso Applications can share intermediate state after

parsing with cloud/network detectors

nonstarter

only works for archive files

Page 33: Abusing File Processing in Malware Detectors for Fun and Profit