Control Hijacking - Attacks Flashcards

1
Q

What are the different types of control hijacking attacks?

A
  • Buffer overflow
  • Integer overflow
  • Stack overflow
  • Index overflow
  • C++ VTables overflow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define

Control Hijacking Attacks

A

An attacker hijacks the control flow by corrupting memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe

Buffer Overflow

A

Writing more data in the buffer and over its adjacement memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe

Integer Overflow

A

Unexpected results from comparing, casting, and positive/negative integers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How could integer overflow be prevented?

A

Using assertions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe

Stack Overflow

A

Overwriting the stack information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the stack overflow cause?

A

Segmentation faults

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What can an attacker do after a stack overflow?

A

Jump to user-defined code, overwrite sensitive data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Describe

Index Overflow

A

Access an array index beyond boundary check

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does an integer flow allow?

A

Direct write to memory locations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe

C++ VTables Overflow

A

Overwriting a variable or pointer pointing to the vtable with a fake vtable in order to execute malicious code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A program’s state is described by what

A

Processor registers and memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define

Processor Registers

A

Loads data for operations copied back/from main memory; stores local data for arithmetic computations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define

Stack

A

Collection of push/pop operations and stack frames

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which way does the stack grow and towards what?

A

Down towards lower memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe

ESP

A

Points to the top of the stack and the most recent item

17
Q

What does push() do on the stack?

A
  • Decrements the ESP’s position in memory
  • Updates the stored ESP value with the newest stack item
18
Q

What does pop() do on the stack?

A
  • Increments the ESP’s position in memory
  • Returns the value stored in the ESP (top of the stack)
  • Removing top element from the stack
19
Q

Define

EBP

A

Stores the address of the current stack frame

20
Q

Define

Stack Frame

A

The function being invoked or return

21
Q

What happens to a function after it executes in relation to the stack?

A

The frame is removed from the stack to signify completion of the function

22
Q

How are local variables stored on the stack?

A

Little Endian

23
Q

Given the following, how would they be stored on the stack from highest in memory to lowest?

local_var(a, b, c)

A

c
b
a

24
Q

Define

Memory Safety

A

No access to “undefined”

25
Q

What constitutes as access?

A

Read, write, or execute privileges

26
Q

How do you build confidence with memory safety?

A
  • Module-by-module analysis
  • Preconditions
  • Postconditions
27
Q

Define

Precondition

A

Holds true for a statement or function to execute

28
Q

Define

Postcondition

A

Holds true after function returns or statement executes

29
Q

What does the postcondition imply?

A

The precondition was true

30
Q

What is the layout of a stackframe from top of memory to bottom of memory?

A

Caller’s Frame
Function Arguments/Params
Return Addr
Pointer to previous frame
Local variables