Final Flashcards

1
Q

Problems that lead to command injection flaws

A

Failure to properly separate commands and data

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

Possibly True SQL Statements

A

’ or 1=1 – a

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

Malicious input to drop table ‘users’

A

’ ; DROP TABLE Users –

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

Input Validation

A

PHP Magic Quotes

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

Example of Parameterized Query

A

Prepared Statements

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

Best practice of SQL injection prevention

A

parameterized queries

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

Bind variable

A

? serves as placeholder within SQL

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

With prepared statements, parameters are bound when?

A

At runtime

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

URI

A

Uniform Resource Identifier

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

XSS term

A

buzz word for specific type of Command Injection vulnerability

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

XSS do what

A

exploit the trust a user’s browser has for a web server

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

XSS typically ends in

A

malicious script run on victim’s host

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

XSS involves

A

3 actors:

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

Why are XSS possible?

A

Hard to differentiate data from code

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

Javascript has access to

A

User’s information such as cookies

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

Types of XSS Vuln.

A
  1. Non-persistent / reflected
  2. Persistent / stored
  3. DOM-based / Local
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Non-persistent / Reflected XSS

A

browser data (in url) used by server-side scripts to generate malicious webpage sent back to user

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

Persistent / Stored XSS

A

Malicious script provided to web app is stored on server and is used to continue rendering pages

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

DOM-Based / Local

A

Malicious script is generated through local client-side DOM processing

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

Example of non-persitant XSS attack

A

Eve convinces Alice to click on a URL that makes Bob’s server send Alice a malicious script

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

Example of Persistant XSS attack

A

Eve posts message to board with embedded XSS attack script which Bob’s browser reads as code, not data

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

Real world persistent xss attack

A

Samy Worm on Myspace

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

DOM

A

Document Object Model

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

XSS Mitigations

A
  1. Input validation, sanitation

2. Output encoding

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

Output encoding

A

escaping output

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

Original purpose of sticky bit

A

Sped up executions by putting executables into swap memory

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

Write and execution bits on a directory allows

A
  1. addition of files

2. Deletion/renaming of files, subdirectories without requiring write permissions on files/directory

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

Weird case with w, e, bits on a directory prevented by

A

Sticky bit

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

Sticky bit

A

Only owner or root can delete, rename the file/directory and contents

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

TOCTOU

A

Time of check, time of use

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

Toctou caused by

A

possibility that a resource changes between time permission is checked and time it is used

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

Classic TOCTOU

A

SetUID program calls access() followed by open()

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

access()

A

checks REAL userID

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

open()

A

opens file for reading/writing

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

How TOCTOU works

A
  1. put soft link to owned file in /tmp

2. run vulnerable setUID repeatedly, replace innocuous link with root only file repeatedly

36
Q

TOCTOU mitigations

A
  1. Temporarily disable root
  2. Check-use-check again
  3. Use atomic operation
  4. Use capabilities
37
Q

TCP/IP Flaws

A
  1. Naive design assumptions (security not intrinsic)
  2. Incomplete specification (details left to implementers)
  3. Implementation errors (buggy, incorrect implementations)
38
Q

4-Layer TCP/IP Network Model

A
  1. Link
  2. Network (TCP/UDP)
  3. Transport (IP)
  4. Application
39
Q

UDP

A

unreliable connectionless communication

40
Q

UDP delivery style

A

best-effort

41
Q

TCP

A

reliable, connection-oriented communication

42
Q

IP

A

connectionless, unreliable communication over the internet

43
Q

ARP is a

A

data link layer

44
Q

ARP

A

resolves the media access control address corresponding to a forwarding IP address

45
Q

IP is a

A

Network layer

46
Q

__ sends data in individual packets

A

IP

47
Q

Data is guaranteed to arrive to the application in correct order

A

TCP

48
Q

TCP 3 Way Handshake

A
  1. SYN w/ ISN
  2. SYN-ACK w/ own ISN
  3. ACK
49
Q

ISN

A

initial sequence number

50
Q

Syn

A

ISN + bytes of data previously sent

51
Q

ACK

A

Sequence + bytes of data previously sent + 1

52
Q

SYN Flood

A

Form of DdOS, floods Syn queue without completing 3rd part of three way handshake

53
Q

Syn Flood Mitigations

A
  • Syn cookies
54
Q

RST Attack

A

Sends TCP packets transmitted with RST flag set

55
Q

RST Attack mitigation

A
  • Stateful packet filtering
56
Q

Session Hijacking

A

Insertion of TCP packets into previously established TCP session (using a sniffer)

57
Q

Session hijacking mitigation

A

IPv6, HTTPS

58
Q

5 components of a cryptosystem

A
  • plaintexts
  • keys
  • ciphertexts
  • enciphering funct
  • deciphering funct
59
Q

What does cryptosystem achieve?

A

1) Confidentiality
2) Integrity
3) Authentication
4) Non-repudiation

60
Q

Kerchkoffs Principle

A

A cryptosystem should be secure even if everything BUT the key is known

61
Q

Symmetric crypto aka

A

Single key encryption

62
Q

Example of simple crypto

A

Caesar cipher

63
Q

In a symmetric system, key is

A

shared by sender and recipient

64
Q

How does symmetric key work?

A

symmetric key is used with both the encryption and the decryption functions

65
Q

Example of symmetric crypto

A

AES

66
Q

Asymmetric Crypto aka

A

public key crypto

67
Q

Why is public key crypto possible?

A

Because of intractable math problems

68
Q

Example of intractable problem

A

factoring primes

69
Q

How does symmetric key work?

A

Key for encryption, key for decryption

70
Q

Asymmetric key examples

A

RSA, diffie-hellman

71
Q

Digital signatures

A

Authenticates both origin and contents of message

72
Q

Difference between encryption and hashing

A

Encryption uses a key

73
Q

HMAC

A

Message Authentication Code

74
Q

How does a public key message work? (sender)

A
  • Sender acquires receivers key
  • Encrypt message with key
  • Hash unencrypted message (digest)
  • Encrypt digest with private key
  • Send encrypted message and digest to the receiver
75
Q

How public key message works? (receiver)

A
  • Decrypt encrypted message with private key
  • Compute message digest of unencrypted message
  • Decrypt encrypted message digest using sender’s public key
  • Compare decrypted digest to computed digest
76
Q

3 Security principles provided by public key crypto:

A
  1. Confidentiality
  2. Integrity
  3. Authentication
77
Q

PKI

A

Public key infrastructure uses certs to confirm identity of parties involved

78
Q

CA

A

Certificate Authority

79
Q

RA

A

Registration Authority

80
Q

Types of symmetrical cyphers

A

Stream

Block

81
Q

CERT is a

A

Certified public key

82
Q

Which hash algorithms have been cracked

A

MD5

Sha-1

83
Q

SHA

A

Secure Hash Algorithm

84
Q

Strength of HMAC depends on

A

size of secret key

85
Q

Most famous key exchange

A

Diffie hellman

86
Q

Man in the middle attack

A

Attack intercepts communication, impersonates each