Notes computer security
- 1. Introduction 3
- 2. Cryptography 4
- 2.1 Symmetric cryptography 5
- 2.2 Asymmetric cryptography 6
- 3. Authentication 7
- 3.1 Something to know 7
- 3.2 Something to have 7
- 3.3 Something to be 7
- 4. Access control 8
- 4.1 Discretionary access control - OS style 8
- 4.2 Mandatory access control (MAC) 8
- 5. Introduction to software security 9
- 5.1 x86 Recup 9
- 5.2 Parameter passing 10
- 6. Buffer overflow 11
- 6.1 Possible solution 11
- 7. Format string buffer 13
- 7.1 How to write 13
- 7.2 Essence of the problem 13
- 8. Web application security 14
- 8.1 Content security policy 14
- 8.2 SQL injection 14
- 8.2 URL parameter tampering 15
- 8.3 Cookies 15
- 8.4 Cross-Site request forgery (CSRF) 15
- 9. Network protocol attacks 17
- 9.1 DOS 17
- 9.2 Sniffing 18
- 10. Secure network architectures 20
- 10.1 Packet filtering 20
- 10.2. Application proxy 20
- 10.3 Multizone architectures for secure networks 21
- 10.4 VPN 21
- 11.5 Bestemmie e cose da ricordare 21
- 11. Network security 22
- 12. Malicious software 23
- 12.1 Virus and worm stealth techniques (obfuscation) 23
- 12.2 Counteracting malware: analysis overview 24
- 12.3 Notes 24
- 13. Mobile security and malicious apps 25
1. Introduction
A secure system should provide the following features. CIA paradigm for security:
- Confidentiality: information should be accessed only by authorized entities
- Integrity: information should be modified only by authorized entities in the expected way
- Availability: information must be available to all the parties who have a right to access it, within a specified time constraints
Vulnerability is something that allows one to violate one of the constraints of the CIA paradigm.
Exploit is a way to use some vulnerabilities to accomplish a specific object that violates the constraint.
Asset: identifies what is valuable for a organization
Threat: circumstance potentially causing a CIA violation (aka Potential Attack)
Risk: statistical and economical evaluation of the exposure to damage because of the presence of vulnerability: Risk= Asset x Vulnerability x Threat
Security: Balance the reduction of vulnerability + damage containment vs (direct or indirect) costs
Attack is an intentional use of some exploits with the objective of compromising a system's CIA
Threat Agents: whatever may cause an attack to occur (the attacker goal)
A protected system is not synonymous of secure system.
Our Goal is not to create an invulnerable system, but create a system that is secure enough with respect to the correspondent assets
Tips: Refer always to CIA when discussing this question. Use generic responses when discuss about possible attacks (do not use specific attacks sentences)
2. Cryptography
The problem of cryptography and cryptosystems is to allow the communication between two elements that want to communicate over an untrusted channel. Provide:
- Confidentiality: data can be accessed only by chosen entities
- Integrity \freshness: detect and prevent tampering or replayes
- Authenticity: data and their origin are guaranteed
- Non-Repudiation: data creator cannot repudiate them
Kerckhoffs - Shannon Principle: States that the security of a cryptosystem relies uniquely on the secrecy of the key, never on the secrecy of the algorithm, which must be known, even to the attacker
Perfectly secure cipher
In a perfect cipher, seeing a ciphertext gives us no information on what the plain text corresponds to.
A cipher is the perfect one if and only if even if the ciphertext is observed, it does not leak any secret about the message
- It is not vulnerable to an exhaustive search as all the keys will yield a meaningful plaintext.
- A well known perfect cipher is a uniform random variable used as key to XOR only 1 message with the same dimension of the message. Also |key|≥|messages|
Generally, a cryptosystem is broken if there is any attack faster than trying all the possible keys to obtain the plaintext (less than 2 operations)
Secure PRG (Pseudo Random Generator): We often refer to as the expansion factor of the PRG. Intuitively, a PRG is secure if no efficient adversary can distinguish the output of a PRG from a uniformly random string of the same length, except with vanishingly small probability
PRF = Pseudo Random Function = implementation of a PRG
Computational security
We have no possibility to define a “secure” cipher, but we can provide the definition of computational security in which we define the behavior of an ideal attacker and we define a problem that is “easy” to solve by us (with the key) and computational impossibile to the attacker
We assume that an attacker can compute only poly() computations+1
We define a CSPRNG a deterministic function {0,1} →{0,1} whose output cannot be distinguished from an uniform random sampling
We don’t have no proof that a function like this exists
To understand how fast it is to brute force an algorithm, the keyspace has to be analyzed. When evaluating the key length, a trade-off must be found between the number of bits and the computational power required to encrypt the message
Malleability: work on the ciphertext and know the effect on the plaintext even if you cannot decrypt it
2.1 Symmetric cryptography
Is it possible to encrypt a plaintext with a key smaller than the plain text?
Electronic Code Block ECB We divide the plain text in blocks and crypt them with the key.
Problem: deterministic crypting, the attacker can leak information from the chipertext
Counter Mode CTR Add a counter to modify the key don't dismiss the problem.
CPA-Secure Counter mode
Here we use a Nonce generator to generate different byte streams to change the key. Now the same plaintext have different ciphertext in different moments
Problem: making changes to the ciphertext maps to predictable changes in the plaintext
We can fix the problem adding a nonce to the program, it generate random number and even if one is discovered, the older one are safe
A mechanism ensuring data integrity is added. Add a small piece of information (tag) allowing us to test for the message integrity of the encrypted message itself. A Message Authentication Codes (MAC) must prodive 2 function: CompTag (msg,key) and VerTag(msg,tag,key)
CBC-MAC Here the problem is solved so we have a tag that can be computed and verified. This doesn’t work on 2 message that are one the prefix of the other (in order)
If we encrypt the tag the problem is solved
Problem: we have to test all the bytes of a file. It would be better to test only a small part of it. Also this is not a good hash function
A secure MAC does not allow an attacker, who has seen a valid message-tag pair, to forge a valid tag for a different message. It provide message integrity
Hash function
Cryptographic hash is a function H:{0,1}*-> {0,1}’ for which the this problems are computationally hard:
- Given d=H(s) find s [in reality O(2d)]
- Given s, d=H(s) find r ≠ s with H(r)=d [in reality O(2d)]
- Find r.s: r≠s with H(s)=H(r) [in reality O(2d/2)]
2.2 Asymmetric cryptography
Diffie-Hellman Exchange
Simple method to exchange kies on a insicure channel. Broken by MIMT:
- No Authentication
- P and g are small number to guess
NowAday:
Asymmetric schemes to provide key transport\agreement.
Symmetric schemes to encrypt the bulk of the data
The public key authenticity is guaranteed with another signature.
Digital Certificates. The CA is the authority that sign the certificate and can be nested until a root, that must be trusted A Priori
The only way to to revoke the digital certificate itself by exploiting Certificate Revocation Lists, which are stored online
Another way to distribute CAs is the Web of Trust: in this case, rather than exploiting a chain mechanism, a "social network" method is used: a certificate is trusted if it has been signed by a "friend" within the network
Building MAC: generate tag hashing together the message and a secret string, verify tag recomputing the same hash
For performance reasons, sign the hash of the document instead of the document. Signature properties now guaranteed only if both signature and hash algorithms are not broken
3. Authentication
Authentication: the entity provides a proof that verifies its identity. Based on:
- Something you know
- Something you have
- Something you are
3.1 Something to know
Low cost and easy to deploy. But can be cracked, stolen or guessed
- Snooping: get information “watching” the user data
- Cracking: try to bruteforce the password (or exploit some other method, enumerating)
- Guessing: try to guess the password exploiting user characteristic
3.2 Something to have
Human friendly, low cost and good level of security but Hard to deploy and token can be stolen
3.3 Something to be
Users must prove that it has some specific characteristics. Biometric systems are not deterministic
High level of security, no required hardware to carry. But hard to deploy, invasive measurement, can be cloned and could change over time.
False Positive or Negative are a problem of utilization\security tradeoff
Which is the best? In order to evaluate the level of security we need to know more of the system they are designed to pro
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
-
Computer Security - Appunti Completi
-
Computer security - Appunti
-
Appunti completi corso Computer Security
-
Security, Privacy and Storage: Appunti di Sistemi