Quiz 1 Flashcards

1
Q

What are bugs/vulnerabilities?

A

Malicious functionalities that extends primary intended design

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

What are exploits/attacks?

A

Inputs that leverage vulnerabilities to take control of the system or leak sensitive information

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

What is software security?

A

Risk management, it involves identifying vulnerabilities and patching vulnerable code

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

What are the three tasks involved in security management

A

Software auditing, security test, and patch develoment

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

What are the six main memory corruption vulnerabilities?

A

Buffer overflow
Integer overflow
Format String
Race Condition
Use-after-free
Double free

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

What are the three types of buffer overflows?

A

Stack overflow
Heap overflow
Type confusion

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

What is a buffer overflow?

A

When data is written outside of the space allocated to the buffer

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

What is the goal of Arbitrary Code Execution?

A

To take over a target machine

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

What are the targets of control flow hijacking?

A

Function pointer/return addresses
Exception handlers
Corrupting vtable
Longjmp buffers

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

What is a type confusion?

A

A type of vulnerability caused by exploiting logical errors that emerges from illegal down casts

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

How do truncation errors occur?

A

An integer is converted to a smaller integer type and the value of the original integer is outside the range of the smaller type

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

How does an arithmetic overflow occur?

A

The result of an integer operation does not fit within the allocated memory space

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

To avoid integer overflows when you need a size of a count what should you use?

A

size_t

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

To avoid integer overflows when you need a specific bit-width what should you use?

A

uint8_t for 8 bit, uint16_t for 16bit ect

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

To avoid integer overflows when you need an integer to hold a pointer what should you use?

A

intptr_t

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

What is Format String Vulnerability?

A

When the format of a string is used in such a way to execute code or crash a program

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

How are format string attacks performed?

A

The attacker walks up the stack until they find the desired pointer and then writes to arbitrary memory

18
Q

What is a dangling pointer?

A

A pointer variable through which the freed memory is accessed

19
Q

What are Use-After-Free vulnerabilities?

A

When data on the heap is freed, but a leftover reference/dangling pointer is used by the code as if the data were still valid

20
Q

What are some causes of use after free errors?

A

Wrongly handled error conditions
Unaccounted for program states
Confusion over which part of the program is responsible for freeing memory

21
Q

Why are Use-After-Free attacks so well liked?

A

Doesn’t require one to corrupt memory
Can be used for info leaks
Can be used to trigger memory corruption or get control of EIP

22
Q

What does each chunk in the malloc() doubly linked list holds?

A

A free bit
A link to the next and previous chunk tags

23
Q

What is a Double Free?

A

Freeing the same chunk of memory twice, without it being reallocated in between

23
Q

What is the attacker goal in shellcode?

A

To execute arbitrary code

24
Q

What are the steps in shellcoding?

A

Hijacking the control flow
Spawn a shell
Write the shellcode to the buffer
Hijack EIP to the shellcode
Use exec(“bin/sh/”) syscall

24
Q

What command is used to spawn a shell?

A

execve

24
Q

What are the steps in executing a system call?

A

1 Store syscall number in eax
2 Save arg 1 in ebx, arg 2 in ecx, arg 3 in edx
3 Execute int 0x80 or sysenter
4 Syscall runs and returns the result in eax

25
Q

How do you get the address of memory-based parameters?

A

Push it to the stack and get addr from esp
Use position independent code

26
Q

What is the use of a NOP sled?

A

To guess the approximate stack state when the target function is called

27
Q

What is the idea behind Code Reuse Attacks?

A

Leverage existing code to perform the function the attacker wants

28
Q

What are the two types of code reuse attacks?

A

Return-to-libc attacks
Return-oriented programming to reuse the gadgets of the victim

29
Q

What are Return to Libc Attacks?

A

The attacks overwrites the control data (like the return addresses) by address of a library function so the function performs another libc function.

30
Q

Why would attackers end their attacks with an exit() call?

A

To prevent a segmentation fault error to avoid detection

31
Q

What is Return Oriented Programming?

A

Gaining control of the call stack to hijack the program’s control flow and execute various machine instruction sequences already present in the machine’s memory to perform what is needed for the attack

32
Q

What are the reasons a return into library attack became more difficult?

A

The first argument to a function is passed into a register instead of on the stack, as a result an attacker could no longer set up a library call function by simply manipulating the call stack

33
Q

What is the normal code execution flow?

A

The Instruction pointer determines which instruction to fetch and execute
The CPU automatically advances EIP to next instruction after executing the current one
Control flow intructions change the value of EIP

34
Q

What is the Return Oriented Programming execution flow?

A

The stack pointer determines which instruction sequence to fetch and execute

35
Q

What is the ROP thesis?

A

That with any sufficiently large program codebase and an attacker’s control of the stack can lead to arbitrary attacker computation and behvior

36
Q

How does ROP attacks simulate the NOP instruction?

A

By using a return only gadget to advance the ESP

37
Q

How does ROP attacks simulate constants?

A

By storing constants on the stack and popping them when needed

38
Q

How does ROP attacks simulate the control flow?

A

By conditionally setting ESP to new values