middy1 Flashcards

Passwords Vulnerabilities Execution Control flow hijack Control flow defense ROP CFI Heap attacks Attack surface (54 cards)

1
Q

What is authentification?

A

Proving who you are

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

What are the 4 means of authenticating a user?

A

Something the user:
1. knows
2. possesses
3. is
4. does

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

Regarding authentication, what is an example of something the user knows?

A

car model, password, PIN

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

Regarding authentication, what is an example of something the user possesses?

A

smartphone, physical key, tokens

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

Regarding authentication, what is an example of something the user is?

A

face, fingerprint, iris

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

Regarding authentication, what is an example of something the user does?

A

Typing rhythm, voice pattern

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

What is the safe way to store passwords?

A

By hashing passwords with a salt and storing them in a file only the root user can access.

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

What is a vulnerability?

A

a flaw that is accessible to an adversary who can exploit that flaw.

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

What is a flaw?

A

a functionality that violates security and reachable.

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

What is an exploit?

A

provides input to cause security violation and the adversary can produce an attack payload.

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

What defines how flaws are reachable?

A

threat models

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

What are the 3 security requirements?

A

confidentiality, integrity, availability

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

Regarding security, what is confidentiality?

A

secrecy, sensitive data should be safe from adversary.

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

Regarding security, what is integrity?

A

when sensitive data is safe from unauthorized modification and is accurate.

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

Regarding security, what is availability?

A

when the services are available for users.

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

For the line below, what code form is it in? Explain it:

int t = x + y;

A

( C code )

two integers are being added and the result is stored in t.

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

For the line below, what code form is it in? Explain it:

addl 8(%ebp), %eax

A

( Assembly code )

adding two 4-byte integers

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

For the line below, what code form is it in?

0x80483ca: 03 45 08

A

Object code

This 3-byte instruction is being stored at address 0x80483ca.

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

what is eip?

A

Extended instruction pointer, this register holds the address of the next instruction.

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

what is EFLAGS?

A

the condition codes.

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

What can modify the eip?

A

CALL, RET, JMP, and cond. JMP

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

How can we reference memory?

A

loading a value from memory (mov)
or
loading an address (lea)

23
Q

Is this a direct or indirect jump?

jmp 0x45

24
Q

Is this a direct or indirect jump?

jmp *eax

25
How does the stack grow?
It grows down towards lower addresses.
26
What is stored on the stack frame?
local variables, arguments, temporary space
27
How are the arguments pushed onto stack? printf("%s, %d", aString, anInt)
------------------------- "%s, %d" ------------------------- aString ------------------------- anInt -------------------------
28
What is buffer overflow?
occurs when data is written outside of the space allocated for the buffer (C does not check that write are in-bound)
29
What are the 2 types of buffer overflow?
Stack-based, Heap-based
30
How do you generate a exploit for a basic buffer overflow?
1. Determine size of stack frame up to head of buffer. 2. Overflow buffer with the right size.
31
What are the root cause of hijacks?
Bugs
32
What are defenses against buffer overflow exploits?
canaries, Data Execution Prevention (DEP) / No execute (NOP), Address Space Layout Randomization (ASLR)
33
How does the canary defense work for buffer overflow?
Put canary words between return addresses and local variables. Check before and after the values of the canaries. If the canary value changes, it was overwritten.
34
What are the disadvantages of the canary defense?
The check of the canary does not happen until epilogue (right before the function returns), a function/data pointer can be overwritten, bypassing the canary
35
What is DEP?
Data execution prevention This is a buffer overflow defense that prevents certain regions in memory non-executable.
36
How can you bypass DEP?
You can modify existing executable code or use ROP.
37
What is ASLR?
Address Space Layout Randomization this bufferflow defense randomizes addresses of each region.
38
What is ROP?
Return oriented programming forging shellcode from existing code by assembling sequences of the code (gadgets).
39
What are the principles of a Reference Monitor?
1. complete mediation - the ref monitor must always be invoked. 2. Tamper-proof 3. Verifiable
40
What are the two main (control) data to worry about?
return address and function pointer
41
What is CFI and its purpose?
Control Flow Integrity, ensures that control flow follows a path in CFG
42
What is heap memory?
An allocation is assigned a contiguous range of virtual mem within the heap (malloc), this is were dynamic mem allocations occur
43
Which defenses helps with heap buffer overflow? - canaries - DEP - ASLR - CFI
No, canaries are too expensive to insert and check. No, DEP has no shellcode to inject and execute. No, ASLR doesnt change relative location of objects and their fields. Yes, CFI can help but only with control flow and not for data attacks.
44
What determines the heap mem layout?
heap allocator
45
How does the heap allocator maintain what it stores?
using a doubly linked list
46
What is one way to attack the heap stack?
1. overwrite the metadata from the next chunk. 2. trigger a malloc operation to remove the chunk. 3. Arbitrary write primitive
47
How do you prevent a use-after-free vulnerability?
Check every free chunk to detect any tampering prior to free-ing.
48
What is use-after-free?
When a prog continues to use a pointer after freeing it.
49
What is RASQ?
Relative Attack Surface Quotient - a metric that counts the number of unsafe instances and is used to compare systems
50
Which of the following describes a denial of service attack? a) it can stop legit users from using a service. b) it is hard to notice. c) it can happen either locally or over the network.
a, b
51
Which of the following are true about passwords? a) if the hard drive is stolen, its easy to steal passwords saved on them. b) passwords should be stored on computers securely (e.g. in hashed or encrypted) c) passwords should alway be stored in hashes. Encryption is bad for passwords.
b
52
Describe the purpose of the instruction CALL.
Jumps to the address of the function being called. - pushes the return address - jumps to function being called
53
Describe the purpose of the instruction LEAVE.
cleans up the stack before returning from a function. - restores the stack pointer to the value it had before the function was called.
54
Describe the purpose of the instruction RET.
returns control to the calling function after a function finishes executing. - pops the return address from the stack and jumps to that address and resumes execution right after the point where the function was called.