Top Banner
File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata
62

File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Dec 22, 2015

Download

Documents

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: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

File AnalysisChapter 5 – Harlan Carvey

Event Logs

File Metadata

Page 2: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Event LogsLogging Events

• Events

• Logging Events

• Event Log Format

• Event Record Structure

• Various Logs

Page 3: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Usual Event Logs

• Application• Log of application errors, warnings and information

• Security• Dropped Packets, Successful Connections

• Logon/Logoffs

• System• Various device events

Page 4: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Registry References - XP

Page 5: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Windows 7

Location of logs

Page 6: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Event Log Location - XP

Page 7: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Event Log LocationVista, Win7

• C:Windows->System32->winevt->Logs

Page 8: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Location of Event Logs

Page 9: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

App & System Logging

• On by default

• Log size is 512 KB by default

• Written by the application

Page 10: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Security Logging - XP

• Not on by default• Log size is 512 KB by default• Control Panel Admin tools -> Local Security Policy

Page 11: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Security LoggingWindows 7

Page 12: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Log Viewer

• Event Viewer• Control Panel -> Administrative Tools -> Event

Viewer

• Application, Security and System logs available

• Event Properties• DTG of the event

• Important for some timelines

Page 13: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

App Log

Page 14: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

System Log

Page 15: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Security LogSuccess

Page 16: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Security LogFailure

Page 17: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Windows 7

Page 18: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.
Page 19: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.
Page 20: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Event Viewer

• Convenient and pretty

• Works only on live systems

• Does not work on a forensics image

• We have to parse the event logs

Page 21: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Event Logs

• Binary Structure

• Header and a series of records

• Event ID formats• http://www.ultimatewindowssecurity.com/securitylog/encyclopedia/

event.aspx?eventid=528

• Application logs are vendor specific• EventID.net is a good source for this info - $$$

• blogs.msdn.com/ericfiz/default.aspx

• www.microsoft.com/technet/support/ee/ee_advanced.aspx

Page 22: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Event Log ConfigurationXP

• Held in registry keys

Page 23: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Windows 7

Page 24: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Registry Viewer

• Event message

Page 25: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Event Log File FormatXP only

• Event Log Header – 12 DWORD values

• Event Records – Variable length

• Windows 7 & Vista• http://www.dfrws.org/2007/proceedings/p65-schuster.pdf

• http://computer.forensikblog.de/files/talks/SANS_Summit_Vista_Event_Log.pdf

Page 26: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Offset Size Description

0 4 bytes Size of the record (Header = 0x30, Event = 0xF4)

4 4 bytes Magic number 0x4C 66 4C 65 = LfLe

16 4 bytes Offset within the .evt file of the oldest event record

20 4 bytes Offset within the .evt file of the next event record to be written

24 4 bytes ID of the next event record

28 4 bytes ID of the oldest event record

32 4 bytes Maximum size of the .evt file (from the registry)

40 4 bytes Retention time of event records (from the registry)

44 4 bytes Size of the record (repeat of the first DWORD)

Event Log Header Structure

Page 27: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Offset Size Description

0 4 bytes Size of the record (Header = 0x30, Event = 0xF4)

4 4 bytes Magic number 0x4C 66 4C 65 = LfLe

8 4 bytes Record Number

12 4 bytes Time Generated

16 4 bytes Time written

20 4 bytes Event ID – Locates message file/dll/exe

24 2 bytes Event type (0x01 = error, 0x10 = Failure, 0x08 – Success, 0x04 = Info, 0x02 = Warning

26 2 bytes Number of strings

28 2 bytes Event category

30 2 bytes Reserved flags

32 4 bytes Closing record number

36 4 bytes String offset

40 4 bytes Length of user SSID

44 4 bytes Offset to the user SID within this event record

48 4 bytes Data length; length of the binary data associated with this event record

52 4 bytes Offset to data

Event Record Structure

Page 28: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Carvey’s Help

• Best not to depend on the Window’s API to read the Event files

• They can be corrupted

• May miss the next to be over written

• Provides summary stats

• Provides output readable in Excel

Page 29: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

evtstats.exe

Lots of events

Page 30: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

lsevt.exe

Entry for each of the 2464 Event Records

Page 31: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

lsevt2.exe

Entry for each of the 2464 Event RecordsPuts it into an Excel readable format

lsevt –f event_file –c > save_file.csv

Page 32: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Excel – Open .csv file

Page 33: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Change Format

Choose Delimited

Page 34: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Identify Separators

Harlan’s stuff is separated by semicolons.

With Perl knowledge you could change it.

Page 35: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Excel Manipulatible

Page 36: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Information

Page 37: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Other Logs

• IE Browsing History

• Set Up

• XP Firewall

• Recycle Bin

• Shortcut Files

Page 38: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

IE Browsing History

• Index.dat files

• DiscoverPro

• NetAnalysis

• Index dat spy

• SuperWinSpy

• Be careful !!!

Page 39: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

NetAnalysis

Page 40: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Set Up Logs

• Setuplog.txt

• Setupact.log

• SetupAPI.log

• Netsetup.log

Page 41: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Setuplog.txtC:\WINDOWS

Page 42: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Setupact.log C:\WINDOWS

Page 43: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

SetupAPI.log C:\WINDOWS

Page 44: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

NetSetup.logc:\Winodws\Debug

Page 45: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Task Scheduler LogSchedLgU.txt

Page 46: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Enabling Firewall Logging

• Control Panel -> Security Center -> Windows Firewall -> Advanced

• Follow your nose

Page 47: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Firewall Log

• C:\WINDOWS\pfirewall.log

Page 48: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Recycle Bin

• C:\RECYCLER• Each user gets his own folder

• Use the user’s SID

• Each has its own INFO2 file

Page 49: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Recycle Bin

Page 50: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

recbin.exe

Page 51: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

INFO2 File Structure

• Header• 16 bytes

• Final 4 bytes (DWORD) is the size of each record0x320 (little endian) = 800 bytes

• Records• Record # at offset 264 within the record

• Drive designator at offset 2682 = C:\, 3=D:\, etc

• File size in clusters at offset 280

Page 52: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Open INFO2 in WinHex

• Very hard• File -> Open

• Navigate to C:\RECYCLER• Open it• Select a SID file• Open it. It may say you don’t have privileges• Type \INFO2• Try again!• Maybe

Page 53: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

INFO2 Record Size

Record size0x00320 = 80010

Drive indicator0x0002

Size in clusters0x0001

Page 54: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

File MetadataMAC Times

OS - OS Action From To Create time Modification time

FAT to FAT Copy C:\ C:\ Updated Unchanged

FAT to FAT Move C:\ C:\ Unchanged Unchanged

FAT to NTFS Copy Updated Unchanged

FAT to NTFS Move Unchanged Unchanged

NTFS to NTFS Copy C:\ C:\ Updated Unchanged

NTFS to NTFS Move C:\ C:\ Unchanged Unchanged

Page 55: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Word Documents

• Document location

• Statistics

• Magic number

• Version and Language

• Last 10 authors

• MACPS timesModified, accessed, created, printed, saved

Page 56: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

MeargeStreams

• Insert a spreadsheet into a word document

• Call it .doc – you see the Word document

• Call it .xls – you see the spreadsheet

• All sorts of uses• Smuggling out forecasts

• Sharing pictures on the corporate server

Page 57: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

PDF Files

• Similar metadata as Word docs.• Easily accessed• File -> Properties

Page 58: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Image Filesexif Data

Page 59: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.
Page 60: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Original Photo off of the camera

After Photoshop manipulation

Page 61: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

Tw

eet M

etad

ata

Page 62: File Analysis Chapter 5 – Harlan Carvey Event Logs File Metadata.

ADS – Alternative Data Streams

• Native to NTFS

• Permits data file to contain scripts, or executable code

• No NT native tools to detect them

• Native tools to create and launch them