Software Security Flashcards

1
Q

Processes

A
  • executes programs etc.
  • multiprocess with scheduling
  • can create new processes -> forks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Intel CPU Registers

A

rax -> for values to return
rbx -> base addressing
rbp -> base pointer
rsp -> stack pointer

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

Memory Layout: The Stack in x64

A
...
8th parameter
7th parameter
return address
saved rbp
local variables 
red zone
...
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Buffer Overflow: Code Execution

A
  • Overwrite return address with pointer to shellcode

- Saved rip will blindly be interpreted as address to return to upon ret

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

NOP sleds

A
  • attackers cannot predict exact location of shellcode

- write many nop’s and then hopefully code is executed

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

Canaries

A
  • place canary on stack before rip, rbp

- before ret compare to actual canary

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

Random Canaries, Terminator Canaries

A
  • Random canaries use a random value pre-generated at program start
  • Terminator canaries consist of bytes that terminate C strings
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Limitations of Stack Canaries

A
  • only against stack overflow
  • Byte-by-byte trial-and-error on canary
  • > try first byte if correct continue if crashes directly then to next number
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Non-Executable Stack

A
  • A non-executable stack prevents classical shellcode attacks
  • MMU enforces non-executable stack
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Shadow Stack

A
  • store rip twice and check if the same
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Format Strings Attack

A
  • if %s or equals aren’t use bad!

- with input as %p (pointers) %n (stores data on stack) we can manipulate

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

Code-Reuse Attacks

A
  • assuming stack not executable
  • use already existing code to attack
  • we can return to libc or use a ROP (Return-Oriented Programming)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Address Space Layout Randomization (ASLR)

A
  • randomize data and code addresses
  • needs compiler and linker support
  • if absolute addresses are used problems may happen
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Fine-Grained ASLR

A
  • also reorders functions

- shuffles instructions within a function

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

JIT-ROP

A
  • if one pointer to code is leaked rest can be leaked

- uses JIT environment to read code pages and find pointer etc.

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

Execute-no-Read

A
  • removes read permission from code pages
  • conflict with a lot of things
  • > so map just a small amount of code pages
17
Q

Control Flow Integrity CFI

A
  • enforce control flow foreseen by developer
18
Q

Uninitialized Stack Variables

A
  • if variable isn’t initialised someone can read them in a second insertion or something
19
Q

Overwriting Function Pointers

A
  • if attacker (e.g. with an overflow) controls the function pointer can access it
    Def. fat pointers
    -> give the size of a buffer with an check
20
Q

Use-after-Free (Dangling Pointers)

A
  • free dosen’t erase content of a buffer
  • potentially fee space is used in an buffer with the same size
  • we can put data in it
  • just set a buffer before freeing =NULL