YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Analysis of (unknown) file formats

ANALYSIS OF

(UNKNOWN)

FILE FORMATS

22nd September 2011

Mario Suvajac

Page 2: Analysis of (unknown) file formats

Hi, I’m

Mario Suvajac

@msuvajac

suvajac.org

reversinglabs.com

Page 3: Analysis of (unknown) file formats

FILE

FORMATS

http://www.tripleman.com/index.php?showimage=6

Page 4: Analysis of (unknown) file formats

FILE FORMATS

• Structured information storage/carriers

– Compressed

– Encrypted

– All of the above

Page 5: Analysis of (unknown) file formats

CATEGORIZATION

http://www.flickr.com/photos/fotomele/1072932978

Page 6: Analysis of (unknown) file formats

CATEGORIZATION

• Availability

– Open

– Proprietary

• Different for each information type or contained in generalized container format

• Executables, archives...

Page 7: Analysis of (unknown) file formats

Resources

Overlay*

Data1.cab Data1.hdr

Engine32.cab Layout.bin Setup.exe Setup.ibt Setup.ini Setup.inx

UPX 1.25

File N

Engine32.cab Engine32\*.*

Setup.ibt LZ\setup.ibt\*.*

Overlay

Unpacked PE32

Page 8: Analysis of (unknown) file formats

WHY IS ANALYSIS

IMPORTANT?

http://www.flickr.com/photos/marodesu/5932256377

Page 9: Analysis of (unknown) file formats

WHY IS ANALYSIS IMPORTANT?

• Writing unpackers & validators

– Anti-virus protection

– Computer forensics

– General software development

– ...

Page 10: Analysis of (unknown) file formats

HOW TO

DO IT?

http://www.flickr.com/photos/karenilagan/2163284814

Page 11: Analysis of (unknown) file formats

HOW TO DO IT?

• Specifications

• Reverse Engineering

• Asking Please

Page 12: Analysis of (unknown) file formats

http://www.flickr.com/photos/19666640@N00/2884433955

Page 13: Analysis of (unknown) file formats

FILE FORMAT PATTERNS

• File header

– Magic

– Sizes

– Offsets

– Algorithm ids

– Block descriptors

– ...

• Data

Page 14: Analysis of (unknown) file formats

ZIP FILE FORMAT

Page 15: Analysis of (unknown) file formats

Reverse

engineering

http://www.tripleman.com/index.php?showimage=520

Page 16: Analysis of (unknown) file formats

BY Just Observing

• Experience based

• Hex editor

• Diffing’

Page 17: Analysis of (unknown) file formats

BY Debugging

• Watching reads & further data manipulation

• Compression & encryption algorithms reversing

Page 18: Analysis of (unknown) file formats

CODING TIPS

http://www.flickr.com/photos/the8rgrl/4642045

Page 19: Analysis of (unknown) file formats

CODING TIPS

• Security risks

• Problems in practice

• corelib

Page 20: Analysis of (unknown) file formats

THANKS,

QUESTIONS?!

Btw.

IS HIRING