Top Banner
ANALYSIS OF (UNKNOWN) FILE FORMATS 22nd September 2011 Mario Suvajac
20

Analysis of (unknown) file formats

May 26, 2015

Download

Technology

Mario Suvajac

The goal of this talk is to provide a general overview of effort that goes into, and to familiarize listeners with, making an unpacker or a validator for various ranges of binary file formats. Unpackers and validators are used in various ranges of security and utility products. Anti-virus products use them to do file introspection and ease malware detection while other uses include applications in hard-drive forensics and even everyday file extraction from archives. File format analysis enables writing such tools. The talk will provide real life experience, advice and techniques with insight into both analysis and programming challenges that are encountered daily and suggestions on how to solve them. Focus of this talk will be on the most common file formats that are encountered in the “wild”.
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: 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