PLP Final Flashcards

1
Q

What does dynamic linking mean?

A

Dynamic linking means that there is no link phase at compile time. Classes that refer to each other are resolved at runtime

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

What are the 5 features of java?

A

Object-oriented
Multi-threaded
Strongly typed
Exception handling
Garbage handling(objects no longer in use are automatically removed)

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

What is a native method?

A

A java method whose implementation is also written in another programming language

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

What is the primordial class loader?

A

Loads trusted classes(systems classes which are on the boot class path) into the JVM

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

What are native methods needed for?

A

Methods needed to access some of the underlying OS functions. Once loaded, they are stored in the native method area

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

What is the execution engine

A

A virtual processor that executes bytecode. Performs memory management

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

What is the JIT - Just in time compiler

A

Translates bytecode into native code as needed. This happens after the class has been loaded and verified. Has performance overhead

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

What is the sandbox?

A

The java security model in which java programs can run safely without risk to the system or other users. Restricted what downloaded code could do.

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

What did the JDK 1.0 sandbox allow

A

Trusted code could run without any restrictions. Untrusted code could not access files, and only socket connections to the applets origin server were allowed

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

What verifies a signed applet

A

Certificate authority servers

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

What is a policy file?

A

A configuration file used by the JRE to determine permissions for each program

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

What is fine grained access control?

A

Allows every code access to system resources based on the definition in the policy file

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

What are the three pillars of java security?

A
  1. The security manager - Ensures permissions in policy file are not overridden
  2. Class loaders - Establish the protection domain/set of permissions for a loaded class
  3. The bytecode verifier - Checks code to ensure that rules arent violated, stack isnt overflowed, no illegal operations, etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do cookies add to the http protocol?

A

State

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

Where does a XSS attack run?

A

An xss attack runs in client-side code that is executed by a browser

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

What tags does an XSS attack most commonly run in?

A

Script or Body

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

What is a reflected XSS attack?

A

An XSS attack in which the malicious script comes from the current HTTP request. Malicious JS is sent as part of the victims request

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

What is a stored XSS attack

A

An XSS attack in which the malicious script comes from the websites database. When an application receives data from an untrusted source but still includes that data in later HTTP responses

19
Q

What is a DOM-based XSS attack?

A

An XSS attack where the vulnerability exists in client-side and not server-side code

20
Q

What is same origin policy?

A

A policy used by a browser to separate mutually untrusted scripts. Created from domain name + protocol + port

21
Q

How to prevent XSS?

A

Secure input handling - Either encoding or validation.

22
Q

What are encoding and validation?

A

Encoding escapes user input so the browser interprets it only as data, not code.

Validation filters user input so that any malicious parts are removed

23
Q

What is functional programming?

A

Functional programming is programming that teats computation as the evaluation of mathematical functions

24
Q

Write a function to check if 1 + 1 = 2 in racket

A

(=2 (+ 1 1))

25
Q

Equal vs eqv vs eq

A

Equal works with the most comparisons(like lists), then eqv, then eq.

26
Q

What is read-line vs read?

A

Read line reads strings. Read can take an input value of any type

27
Q

How are expressions represented in Racket

A

Expressions are represented as lists

28
Q

What is the first element of every list in racket?

A

A function. A ‘ mark leading the expressions will tell racket to not treat the leading element as a function

29
Q

What does flatten do in racket

A

Flatten will compact nested lists into one list

30
Q

What does map do in racket?

A

Map applies a function to every element in a list and returns a new list with the new values

31
Q

What does filter do in racket?

A

Filter will create a new list based on a predicate function(such as filter even? number)

32
Q

What does foldl do in racket?

A

(define numbers ‘(1 2 3 4))
Foldl will apply a binary function to the elements of a list cumulatively. Define product(foldl *1 numbers) = 24

33
Q

What does cons to in racket?

A

Takes an element and a list and adds the element to the front of the list

34
Q

What does car do in racket

A

Car retrieves the first element of a list

35
Q

What does cdr do in racket?

A

cdr retrieves every element except the first from a list

36
Q

What is DEP?

A

Data execution prevention marks areas of the stack of non-executable, enforced by the NX hardware bit

37
Q

How is DEP circumvented?

A

DEP is circumvented by using pieces of already existing code to create a sequence of operations to be carried out

38
Q

What does stackguard do?

A

Stackguard places a canary word before each return address in each stack frame

39
Q

What is a type safe language?

A

A language that automatically performs array bound checking, such as java

40
Q

What is code randomization in the context of preventing buffer overflows?

A

Encrypting code and decrypting it before it is run

41
Q

What does control flow integrity do?

A

It prevents a wide variety of malware attacks from redirecting the flow of execution.
It enforces the integrity of a programs execution flow path.

42
Q

What are the steps of a CFI?

A
  1. Build a CFG at compile time
  2. Rewrite the binary with IDs and ID checks at install time
  3. Perform ID checks at run time
43
Q

What is the In-line reference monitor

A

A rewriting of the program by inserting instructions to check if Control Flow Integrity is maintained

44
Q

What is simplest labeling in CFI?

A

Simplest labeling uses the same label for every function. This prevents calls to functions outside of scope, however a function can return to an unintended function in the scope