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
Output encoding
escaping output
26
Original purpose of sticky bit
Sped up executions by putting executables into swap memory
27
Write and execution bits on a directory allows
1. addition of files | 2. Deletion/renaming of files, subdirectories without requiring write permissions on files/directory
28
Weird case with w, e, bits on a directory prevented by
Sticky bit
29
Sticky bit
Only owner or root can delete, rename the file/directory and contents
30
TOCTOU
Time of check, time of use
31
Toctou caused by
possibility that a resource changes between time permission is checked and time it is used
32
Classic TOCTOU
SetUID program calls access() followed by open()
33
access()
checks REAL userID
34
open()
opens file for reading/writing
35
How TOCTOU works
1. put soft link to owned file in /tmp | 2. run vulnerable setUID repeatedly, replace innocuous link with root only file repeatedly
36
TOCTOU mitigations
1. Temporarily disable root 2. Check-use-check again 3. Use atomic operation 3. Use capabilities
37
TCP/IP Flaws
1. Naive design assumptions (security not intrinsic) 2. Incomplete specification (details left to implementers) 3. Implementation errors (buggy, incorrect implementations)
38
4-Layer TCP/IP Network Model
1. Link 2. Network (TCP/UDP) 3. Transport (IP) 4. Application
39
UDP
unreliable connectionless communication
40
UDP delivery style
best-effort
41
TCP
reliable, connection-oriented communication
42
IP
connectionless, unreliable communication over the internet
43
ARP is a
data link layer
44
ARP
resolves the media access control address corresponding to a forwarding IP address
45
IP is a
Network layer
46
__ sends data in individual packets
IP
47
Data is guaranteed to arrive to the application in correct order
TCP
48
TCP 3 Way Handshake
1. SYN w/ ISN 2. SYN-ACK w/ own ISN 3. ACK
49
ISN
initial sequence number
50
Syn
ISN + bytes of data previously sent
51
ACK
Sequence + bytes of data previously sent + 1
52
SYN Flood
Form of DdOS, floods Syn queue without completing 3rd part of three way handshake
53
Syn Flood Mitigations
- Syn cookies
54
RST Attack
Sends TCP packets transmitted with RST flag set
55
RST Attack mitigation
- Stateful packet filtering
56
Session Hijacking
Insertion of TCP packets into previously established TCP session (using a sniffer)
57
Session hijacking mitigation
IPv6, HTTPS
58
5 components of a cryptosystem
- plaintexts - keys - ciphertexts - enciphering funct - deciphering funct
59
What does cryptosystem achieve?
1) Confidentiality 2) Integrity 3) Authentication 4) Non-repudiation
60
Kerchkoffs Principle
A cryptosystem should be secure even if everything BUT the key is known
61
Symmetric crypto aka
Single key encryption
62
Example of simple crypto
Caesar cipher
63
In a symmetric system, key is
shared by sender and recipient
64
How does symmetric key work?
symmetric key is used with both the encryption and the decryption functions
65
Example of symmetric crypto
AES
66
Asymmetric Crypto aka
public key crypto
67
Why is public key crypto possible?
Because of intractable math problems
68
Example of intractable problem
factoring primes
69
How does symmetric key work?
Key for encryption, key for decryption
70
Asymmetric key examples
RSA, diffie-hellman
71
Digital signatures
Authenticates both origin and contents of message
72
Difference between encryption and hashing
Encryption uses a key
73
HMAC
Message Authentication Code
74
How does a public key message work? (sender)
- 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
How public key message works? (receiver)
- 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
3 Security principles provided by public key crypto:
1. Confidentiality 2. Integrity 3. Authentication
77
PKI
Public key infrastructure uses certs to confirm identity of parties involved
78
CA
Certificate Authority
79
RA
Registration Authority
80
Types of symmetrical cyphers
Stream | Block
81
CERT is a
Certified public key
82
Which hash algorithms have been cracked
MD5 | Sha-1
83
SHA
Secure Hash Algorithm
84
Strength of HMAC depends on
size of secret key
85
Most famous key exchange
Diffie hellman
86
Man in the middle attack
Attack intercepts communication, impersonates each