Mod 5 Flashcards

(48 cards)

1
Q

What component translates source code to object code?

A

compiler

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

What component creates the executable bundle?

A

linker

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

What component loads the executable bundle into memory at runtime?

A

loader

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

List 4 loader responsiblities

A

Load program into memory,
Resolve dynamic libraries,
Set up the execution environment,
Transfer control to the program

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

Define intermediate representation (IR)

A

an abstract machine language used by compilers to translate source code to a machine independent code

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

Define bytecode

A

a form of intermediate representation designed for efficient execution by a vm or software interpreter

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

Define kernel

A

the core component of the OS, that handles the management of low-level hardware resources like: memory, processors, and I/O devices

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

How do applications communicate with low-level hardware?

A

Indirectly, by delegating taks to the kernel via system calls.

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

Define process

A

instance of a program that is currently running

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

What component is responsible for setting up the runtime environment for all processes executing on the system?

A

operating system

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

Name the three areas of memory layout

A

Program code section,
Program data section,
Program stack section

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

Which area of memory layout stores executable program instructions for execution by the CPU?

A

Program code section

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

Which area of memory layout stores program variables that aren’t local to functions, such as global and static variables?

A

Program data section

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

Which area of memory layout contains the heap?

A

Program data section

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

Define heap

A

a dynamic memory region for storing dynamically allocated variables

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

Which area of memory layout stores currently executing functions and keeps track of the chain of function calls?

A

Program stack section

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

What causes exception?

A

Internal errors in java virtual machine

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

Java methods must advertise exceptions they throw. How do they do this?

A

Requires the caller to either handle the exception with a try block, or state their method can throw the same exception

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

What are the 7 best practices for handling exceptions?

A
  1. Use exceptions for exceptional circumstances
  2. Use finally to clean up resource usage
  3. Resolve problem as close as possible to where problem occurs
  4. Don’t Bury (Swallow) Exceptions
  5. Do overzealous exception handling!
  6. Don’t do overzealous try blocks!
  7. Provide meaningful messages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How can we monitor our OS?

A
  1. Check your logs frequently
  2. Scan your processes frequently
  3. Scan your filesystem frequently
21
Q

What’s one of the most common methods used to uniquely identify malware?

A

Hashing / Checksumming

22
Q

Define dynamic analysis

A

monitored execution of a program

23
Q

Does dynamic analysis cover the entire code?

A

No, not all paths are explored

24
Q

List dynamic analysis techniques

A

advanced tools,
debuggers,
run-time analyzers,
string analyzers,
trace programs

25
Define debugger
hardware/software used to test or examine the execution of another program
26
What two formats are used to store strings?
ASCII and Unicode
27
Define process injection attacks
when a program spawns a process (another program) via a system call
28
How can you defend against injection attacks?
Sanitize input data
29
What is the most common type of injection attack?
SQL injection
30
What is the most common, most successful type of attack?
Injection attacks
31
''='' will always return...
true. you use it like: 'password' OR ''=''
32
If the developer fails to include checks to whether an input stirng fits into a buffer array, or not, this can lead to which type of attack?
Buffer Overflow attack
33
List 5 ways to mitigate buffer overflow
Stack canaries, Non-executable memory, Compiler-based techniques, Address Space Layout Randomization (ASLR), Secure programming practices
34
Define canaries
Used for stack-based overflows ONLY. Sacrificial node placed in the stack prior to the return address, so that any attempt to overwrite the return address overwrites the node instead. There are 3 types: - Terminator - Random - Random XOR
35
Define non-executable memory
Non-executable stack protection introduces an NX bit that is 'never executed'
36
What compiler-based techniques are used to mitigate buffer overflow?
Bounds checking and Stack cookies
37
Define bounds checking
compiler-based technique that adds run-time bounds information for each allocated block of memory
38
Define stack cookies
protection code that is automatically inserted at compilation, that reorders local variables to place buffers after pointers, copy pointers in function arguments to an area preceding local variable buffers, and omit instrumentation code from functions
39
Define Address Space Layout Randomization (ASLR)
prevents an attacker from reliably jumping to a particular exploited function in memory
40
List the discussed "better programming strategies" for mitigating buffer overflow
Use strongly typed & managed emmory languages. Handle strings carefully.
41
What dynamic analysis technique allows line by line inspection, but can only go through a specific path in code?
Debuggers
42
What dynamic analysis technique allows you to track system calls and resource usage but requires detailed knowlege of assembly and operating environment?
Runtime analyzers and trace programs
43
What dynamic analysis technique can help determine if malware has packed or obfuscated embedded malicious code?
String analyzer
44
What dynamic analysis technique can determine hotspots in code and computational footprints?
Call graphs and profilers
45
Define java security manager
A pessimistic mechanism in Java that requires the deployer to whitelist allowable operations for scoped code on specific data
46
Define sanitization
The process of cleaning input data to prevent injection attacks
47
(T/F) Larger try blocks with many stacked catch blocks of different types is best practice as it surrounds the entire method in safety and is more readable.
False
48
Define checked exception
A typed exception in Java that has to be caught or thrown to the caller (declared in the method signature)