23
Principles -Driven Forensic Analysis Sean Peisert, Matt Bishop, Sidney Karin, and Keith Marzullo UC San Diego and UC Davis New Security Paradigms Workshop (NSPW) 2005 Lake Arrowhead, CA September 2023, 2005 1 Monday, August 10, 2009

Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Principles-Driven Forensic Analysis

Sean Peisert, Matt Bishop, Sidney Karin, and Keith Marzullo

UC San Diego and UC Davis

New Security Paradigms Workshop (NSPW) 2005Lake Arrowhead, CA

September 20–23, 2005

1Monday, August 10, 2009

Page 2: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Re-Defining Forensic Analysis

forensic analysis: the process of answering the question:

“What happened?”

22Monday, August 10, 2009

Page 3: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Tools Used For Forensics Today

• Two Parts of Forensics: Lo!ing & Auditing (Gathering, Processing, Examining, Analyzing)

• Logging• syslog, TCPWrappers, IDS logs, firewall logs, process

accounting, keystroke logging, BSM, ReVirt

• Auditing• grep/strings

• Both• BackTracker, Plato, (Tripwire)

33Monday, August 10, 2009

Page 4: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

What can’t we currently (generally) detect forensically?

1. User functions and variables used2. Changes in the user environment3. Race conditions in memory4. Buffer and numeric overflows5. Code injected into the program instruction stream6. Covert channels through memory reads/writes7. Covert channels through raw disk device at points with unallocated

inodes8. Interception of user input9. Programmer backdoors exploited10. Code written to the heap and executed dynamically at runtime

44Monday, August 10, 2009

Page 5: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Principles

1. Consider the entire system

2. Assumptions should not control what is logged.

3. Consider the effects of events, not just the actions that caused them.

4. Context assists in interpreting the meaning of an event.

5. Actions and results must be presented in a way that can be analyzed and understood by a human forensic analyst.

55Monday, August 10, 2009

Page 6: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

What about feasibility?• Significant performance considerations are obvious.

• We have no desire to fundamentally change the system.

• Importance of logging is how well the data it captures enables auditing.

• Currently concentrating on completeness and efficacy, rather than efficiency and performance. Basis for this is two-fold:• We advocate starting from a desired “end state.”• Limited, special-purpose systems may tolerate inefficiency.

• Obvious approaches to future solutions include information compression, co-processor-assisted logging, and dedicated hardware.

66Monday, August 10, 2009

Page 7: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Implementation Goals

• Goal: Collect all data that a human analyst might need. Do this irregardless of: intent of attacker, whether attacker is an insider or outsider, & nature of activities.

• Goal: Automate processing and presentation of that data in a way that makes it easier for a human to understand and direct further processing of later.

• Goal: Automate search for certain activities to draw an analyst’s attention, with limited “false flags.”

77Monday, August 10, 2009

Page 8: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Principles-Based Auditing:The Data Model

• multi-resolution: “a correlated, layered perspective (state table), encompassing all levels of a system’s software state, objects, and events, including memory, network, kernel, disk, applications.”• Example: Program is composed of functions, variables, etc....

• translate abstraction shortcuts• Example: Memory location is 0x2231291

• actions and effects• Example: Keystroke is ‘k’, the effect is ??

• context• Example: When a command is executed, what is the path

searched?

88Monday, August 10, 2009

Page 9: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

socket

httpd

sh

AuditingExample of Desired Output

socket

httpd

sh

addr=X+10

return(Y)

sbrk(X)

X+10program: sh

function: loop

X = ZY

99Monday, August 10, 2009

Page 10: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

1010Monday, August 10, 2009

Page 11: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

1010Monday, August 10, 2009

Page 12: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow

1010Monday, August 10, 2009

Page 13: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow• Need to know the sizes of all memory allocations, both static and

dynamic, and all memory writes. Compare allocations to writes.

1010Monday, August 10, 2009

Page 14: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow• Need to know the sizes of all memory allocations, both static and

dynamic, and all memory writes. Compare allocations to writes.

• Example #2

1010Monday, August 10, 2009

Page 15: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow• Need to know the sizes of all memory allocations, both static and

dynamic, and all memory writes. Compare allocations to writes.

• Example #2• Event Question: Is a location in memory being written to by a process

or thread which does not “own” that location?

1010Monday, August 10, 2009

Page 16: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow• Need to know the sizes of all memory allocations, both static and

dynamic, and all memory writes. Compare allocations to writes.

• Example #2• Event Question: Is a location in memory being written to by a process

or thread which does not “own” that location?• Labelling Question: Is that a race condition? Run models.

1010Monday, August 10, 2009

Page 17: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow• Need to know the sizes of all memory allocations, both static and

dynamic, and all memory writes. Compare allocations to writes.

• Example #2• Event Question: Is a location in memory being written to by a process

or thread which does not “own” that location?• Labelling Question: Is that a race condition? Run models.

• Example #3:

1010Monday, August 10, 2009

Page 18: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow• Need to know the sizes of all memory allocations, both static and

dynamic, and all memory writes. Compare allocations to writes.

• Example #2• Event Question: Is a location in memory being written to by a process

or thread which does not “own” that location?• Labelling Question: Is that a race condition? Run models.

• Example #3:• Event Question: Is a process jumping to unexpected places in memory,

such as non-word boundaries?

1010Monday, August 10, 2009

Page 19: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Auditing:Validating Suspicions

• Not real-time intrusion detection, so we can do this repeatedly.

• Example #1: Buffer or Integer Overflow• Need to know the sizes of all memory allocations, both static and

dynamic, and all memory writes. Compare allocations to writes.

• Example #2• Event Question: Is a location in memory being written to by a process

or thread which does not “own” that location?• Labelling Question: Is that a race condition? Run models.

• Example #3:• Event Question: Is a process jumping to unexpected places in memory,

such as non-word boundaries?• Labelling Question: Are those covert channels? programming errors? Run

models.

1010Monday, August 10, 2009

Page 20: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Principles-Based Logging: Kernel and System Apps

• Start with existing tools: Instrument kernel to capture:• traps & interrupts• events involving the filesystem and network stack• reads/writes directly to raw devices (disk, network)• context

• Instrument shells and other applications (vi, emacs, X Windows)• Application execution paths, library paths, user limits,

current working directory, keystroke mappings, command aliases

1111Monday, August 10, 2009

Page 21: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Principles-Based Logging:User Space

• The mechanism is less relevant

• Can use several methods to gather memory traces:• Virtual machine introspection (e.g. ReVirt/BackTracker)• Binary rewriting (e.g. Eraser)• Compiler instrumentation (e.g. LLVM “passes”)

• Symbol table, data types• Arguably easier

1212Monday, August 10, 2009

Page 22: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

Summary

• Principles may lead to answers will be more easily proved correct, including for the insider problem.

• Techniques based on the principles can enable improvements in forensics: analysts can exhaustively and intelligently view data and validate their suspicions, instead of inferring conclusions from insufficient data.

• Nothing wrong with inferring errors, except when it inhibits collecting data.

• Efficiency is a concern, though results can be valuable, even if not generally or widely applicable.

• Proof of efficacy may lead to OS or hardware changes that could do the same thing by using more predictable/computable data, and therefore less recorded data.

• Open research areas remain about best presentation methods and ways of automatically classifying actions

1313Monday, August 10, 2009

Page 23: Principles Driven Forensic Analysispeisert/research/2005-10-NSPW-Talk.pdfNew Security Paradigms Workshop !NSPW" 2005 Lake Arrowhead, CA September 20#23, 2005 ... ¥ syslog, TCPWrappers,

How can we force the use of a particular compiler on everything?

• NetBSD has verified exec feature.

• Future operating system could offer this features as well, or may use hardware to enforce it.

1414Monday, August 10, 2009