Final Flashcards

(55 cards)

1
Q

Machine Code

A

code computers execute.

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

Complier

A

translates high-level code to machine code.(C to assembly to machine code)

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

Assembly

A

human readable representation of machine code.(
– Intel syntax: <mnemonic> <dst> <src>
– AT&T: <mnemonic> <src> <dst>)</dst></src></mnemonic></src></dst></mnemonic>

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

Memory stores ….

A

both data and code.

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

little-endian architecture

A

least significant byte is stored first (ex. 0x112233, 0x33 0x22 0x11)

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

% is for…

A

register

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

$ is for…

A

immediate (constant value)

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

Number without a $ …

A

memory address

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

displacement formula is what?

A

displacement(base_reg, index_reg, scale)

result = base_reg + displacement + ( index_reg x scale)

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

Memory Layout

A

-kernel space
-stack
-memory mapping
-heap
-bss
-data
-text

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

Stack frame

A

-arg2
-arg1
-return address
- saved ebp
- local data

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

security goals

A

security goals

● Confidentiality
– The property that information is not made available
to unauthorized entities.
● Integrity
– The property that information is not altered or
destroyed in an unauthorized manner.
● Availability
– The property that information is accessible and
usable upon demand by an authorized entity.
● Authentication
– The act of confirming the identity of an entity
interacting with a system.
● Authorization
– The act of assigning rights and privileges to entities
interacting with a system.
● Non-repudiation
– The ability to associate actions or changes to a
unique entity.

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

Jmp + call

A

Jump to call, calls shell code which will push address on to stack, pop address into register

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

Why can’t we use zero bytes?

A

string processing functions will stop copying shell code if it encounters 0x00

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

What to do if zero bytes is in shell code?

A
  • use alternative instructions
    -or encode/restructure data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what does the byte for Nop?

A

\x90

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

Nop Sled

A

Instruction that does nothing, the CPU Jumps to the next Nop until shell code is hit.

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

Shell code injection payload

A

1.NOP SLED
2. Shell Code
3.Return Address

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

PLT and GOT

A

PLT (Procedure Linkage Table) jumps to the address
where a function was previously called and saved in GOT(Global Offset Table)

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

Memory Corruption

A

Go beyond memory bounds.
2) Do something malicious.
a) Hijack the execution flow.
b) Overwrite sensitive data.
c) Overread sensitive data.

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

Human defenses for Memory Corruption prevent from happening in the first place

A

-Input Validation
- Use safer functions (strncpy instead of strcpy)
- Use memory safe languages
- write better code

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

Shell injection steps

A

1)Run out of bounds.
2)Inject malicious code.
3)Overwrite control fields.
4)Guess important addresses.

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

Non Executable Memory and example

A

HARDWARE DEFENSE
If an attacker injects malicious code (shellcode) into those regions — like the stack or heap — the CPU will refuse to execute it and throw a segmentation fault (crash).

Ex. NX, DEP, XD

24
Q

Return-to-libc

A

Execute existing functions with arguments
you choose.

libc is an attractive target.
– Powerful functions: system(), execve().
– Linked by most programs.
✅ It bypasses NX (Non-Executable) memory protections
✅ Because you’re calling code that already exists in memory
❌ It still requires control over the return address

25
memory region cannot be both
writeable and executable
26
return oriented programming
extends Return-to-libc, very fine grained attacks -Borrow small chunks of code(gadget) -chain them together to exploit
27
Gadget
Usable code chunk that end with the ret instruction - gadget perform tiny updates to the program state - the thinner the better
28
Free Branch
ret jmp call
29
Finding gadgets
-existing instruction -unaligned instruction( doesn’t have to start at the beginning of a real instruction — you can start reading in the middle of a legit instruction if it happens to decode into valid instructions ending in ret.) -can start unaligned then align back to original sequence -
30
Stack Canarie aka cookie
random value in stack, if overwritten and canary is not alive, the code will crash ( how canaries were historically used in coal mines to detect dangerous gases. ) starte with zero byte bc \x00, strcpy, strcpy terminate at zero byte Compiler defense
31
ASLR
Address Space Layout randomization Randomizes the memory addresses of: The stack The heap Libraries (like libc) The executable binary itself (if PIE-enabled) OS level defense
32
Bypass ASLR and Canary
- guess -use memory disclosure vulnerability - attack unprotected resource -
33
Control flow integrity
the intended path the program takes through its functions and code.
34
Printf( "hello %why is this a problem"
treats like a memory location and writes to memory and potentially overwrite memory - can be used to read memory
35
Quick sort scheme
Lomuto partintion pivot = rightmost element partition around pivot repeat for each partition
36
Algorithmic complexity attack
attacker makes input that would cause worse case behavior for algorithm, denial of service.
37
Hash table attack
-find weak hash funtion -control input -overload with data -
38
defense for data structure
limit data input monitor resource use use safest also or structure
39
Side Channel Attack
instead of attack bug, attack indirect effects, data leakage, low level implementation detail
40
TDP
thermal design Point
41
DVFS
dynamic voltage and frequency scaling
42
Hamming weight:
number of 1s in a value
43
Hamming distance:
number of bit differences between two values
44
Fault injection
subject hardware to unexpected condition -cooling -heating -high/low volatge -radiation
45
cold boot Attack
RAm retains data after power off, the colder the longer it retains data
46
Row hammer
flip bits in attack
47
defense for hardware
-constant time -make access to side channel harder - execution control flow should not depend on secret data
48
Accident modeling
predict future to prevent - event chain -direct casualty -reliability -component failure
49
Accident analysis
-traiditonal accident look at root cause
50
reliability
measure of time between failure
51
stamp
systems theoretic accident model & processes
52
three approaches to threat model
-focus assets -focus attacker -focus on system
53
model
shows high level architect DFD data flow diagram
54
STRIDE
SPOOF - authentication Tampering - integrity Repudiation information disclosure Denial of Service Elevation of privlege
55