Memory Layout + Vulnerabilities Flashcards

1
Q

What is the stack?

A

Used to collect items or elements with fixed origin and variable size
Initially, the size of the stack is zero and the stack pointer (%esp) points to the top of the stack
Items are added in last in first out order (higher to lower memory addresses)

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

What happens when a function is called?

A

Frame containing
- functions actual parameters
- return address to jump to at end of function
- pointer to previous frame
- functions local variables
is pushed onto the stack

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

What does function prologue consist of?

A

push %ebp
mov %esp, %ebp
sub $n, %esp

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

What does function epilogue include?

A

leave
mov %ebp, %esp
pop %ebp
ret
places value at top of stack (pointed to by %esp) in instruction pointer %eip

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

What are typical components of an injection vector in the context of remote buffer overflow vulnerability exploitation?

A

A NOP sled, the shellcode, and the sequence of addresses enough to overflow the buffer and overwrite a code pointer on the stack. These components may be in any order, but the NOP sled must precede the shellcode

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

What happens to data in excess copied in a buffer?

A

If buffer is allocated on the stack, overflows may cause the corruption of code pointers stored on the stack

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

Why might local memory corruption exploitations facilitate attack success?

A

Attackers don’t need to guess the shellcode address but can place the shellcode onto the environment (knowing how the kernel sets up the stack when the process starts would help to compute the precise address the shellcode will be)

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

A shellcode is a machine code that…

A

Ultimately, invokes one or more system calls attackers rely on to perform arbitrary actions

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

Why is it important to make sure we don’t have NULL bytes in our shellcode?

A

A vulnerability caused by strcpy-like functions terminate the copy upon encountering a NULL byte in the source operand

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

What code pointers can be overflowed?

A

return address, function pointers, GOT, destructors

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