A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pojntfx.github.io/uni-itsec-notes/main.slides.html below:

Uni IT Security Notes

Uni IT Security Notes

Notes for the IT security course at HdM Stuttgart

2022-02-01

Basics

Security Mindset Aspects of IT Security Security Objectives Safety vs. Security Attacks, Threats and Vulnerabilities Risk and Threat Analysis
graph TD
    subgraph Threat analysis
        A[System inventory and definition]-->B
        B[Threat identification]-->C
        C[Threat evaluation]
    end

    C-->D

    subgraph Risk analysis
        D[Impact evaluation]-->E
        E[Risk calculation]-->A
    end
Threat Identification Trade-offs in Security

Security Frameworks

Network Specific Threat Examples STRIDE: Attacks on a Multi-User System Security Policies Security Mechanisms and Concepts
graph TD
    A[Security policy]-->|requires|B
    B[Security objectives]-->|realized by|C
    C[Security mechanisms]-->|described by|D
    D[Security concept]
Mitigation Strategies

Malware

Malware General Definition Infection Paths Malware Types Trojan Horses Backdoors

Intentionally created remote code execution vulnerability/ingress into system (Hello, Five Eyes!).

Logic Bomb

Malicious function, which is called once condition evaluates to true.

Rootkit

Collection of services installed on a compromised system, which enables hiding …

from users other than root.

Advanced Persistent Threat

Advanced:

Persistent:

Threats: Often uses Zero-Day vulnerabilities

Botnet Common Reasons for Vulnerabilities

Issues in …

… lead to attack vectors:

Side-Channel Attacks

Indirect (physical) attack on a system; i.e. smudge patterns on a smartphone

Buffer Overflow Race Conditions

Information is being changed after it has been checked, but before it has been executed.

Networking

TCP Overview TCP Connection Establishment

An example connection from the client to the server:

<Client>                                              <Server>

[Closed]                                              [Closed]
                  SEQ=x     CTL=SYN               =>
[SYN Sent]
              <=  SEQ=y     CTL=SYN+ACK   ACK=x+1
                                                      [SYN Received]
                  SEQ=x+1   CTL=ACK       ACK=y+1 =>
[Established]                                         [Established]
IP Security Issues TCP Security Issues Port Scanning TCP Protection Mechanisms Session Hijacking RST Attacks (In-Connection DoS)

Inject packet with RST flag into ongoing connection: Connection has to be aborted immediately

Blind IP Spoofing

Firewall is configured to only allow one source IP address and destination IP address (A → B).

To circumvent this restriction:

  1. Attackers starts DoS attack on A to prevent A from sending RST packets to B
  2. Attacker sends TCP connection setup packet with A’s source IP address to B
  3. B sends SYN+ACK packet to A, but can’t respond due to DoS
  4. Attacker sends TCP connection ACK packet to B with ACK matching the initial sequence number chosen by B (which has to be guessed, as B sent the SYN+ACK packet to A, not the attacker)

Only works if B uses a predicable algorithm for it’s ISN and packet filters aren’t in place.

Perimeter Defense in Practice

Architecture Recommendations Application in Networking Stateless Packet Filter Stateful Packet Filters Stateful Firewalls Application Layer Proxies Application Level Gateways Circuit Level Gateway Demilitarized Zone (DMZ)

The DMZ creates 2/3 lines of defense by the use of a stub network.

Multi-Level DMZs can create even more secure perimeter defenses:

Global Internet → Access Router and Packet Filter → Public Services Host (offers i.e. public Web services) → Screening Router and Packet filter (prevents IP spoofing) → Mail host (for external mail communication) → Bastion host (i.e. proxy for FTP and Web access) → Intranet

Web Application Firewalls (WAFs) Cross-Site Scripting (XSS)

Injection of malicious client-side code (JS, WASM) into site. There are multiple types:

Cross Site Request Forgery (CSRF)

Sniffing of cookies/tokens from a connection in another tab.

Intrusion Detection Systems (IDS) Injections

Symmetric Encryption

Symmetric Encryption Overview

Alice:

  1. Creates message
  2. Chooses key
  3. Computes ciphertext
  4. Send ciphertext to Bob

Eve (Attacker):

  1. Copies ciphertext
  2. Tries to guess the key

Bob:

  1. Receives ciphertext
  2. Uses key
  3. Computes plaintext
  4. Reads message
Kerckhoffs’ Principle Strong Algorithms Crypto Attack Classes Perfect Security

Ciphertext does not give any information you don’t already have about the plaintext (p(m(c))=p(m))

One-Time-Pad Stream Cyphers

Encryption like one-time-pad, but using pseudo-random bits instead of true random (using a Crytographically Secure Pseudo-Random Number Generator (CSPRNG))

True Random Number Generators (Cryptographically Secure) Pseudo-Random Number Generators (CSPRNG)

PSRNGs compute the output based on a seed and an internal state.

A CSPRNG must …

… when the initial state of the CSPRNG is not known

Design Principles for Block Cyphers

Two methods for frustrating a statistical analysis:

Feistel Networks DES (Tripple DES) AES Key Features Modes of Operation for Block Cyphers Cypher Block Chaining (CBC) Counter Mode (CTR) Padding Key Length Considerations

Message Authentication

Message Authentication Codes (MACs) General Scenario

Alice:

  1. m = "I love you. Alice"
  2. Select secret key K
  3. Compute MAC_K(m)

Bob:

  1. Receives m'
  2. Selects secret key K
  3. Computes MAC_K(m')
  4. Compares computed MAC with received MAC → Matches!

Assertion: If computed MAC equals the MAC included in the received message, an owner of the key (Alice) really sent this message and it was not changed on the way.

Scenario with Modified Message

Alice: Same as in General Scenario

Mallory:

Bob

  1. Receives m'
  2. Selects secret key K
  3. Computes MAC_K(m')
  4. Compares computed MAC with received MAC → Doesn’t match!
  5. Ignore m
MAC Computation Hash Function Requirements

Asymmetric Encryption

Public Key Cryptography

Alice:

  1. Generates key pair (PK_{Alice},SK_{Alice})
  2. Published PK_{Alice} at Trent’s
  3. c received → decrypts m=D_{SK_{Alice}}(C)

Trent:

Bob:

  1. Wants to send m to Alice confidentially
  2. Obtains PK_{Alice} from Trent
  3. Computes c=E_{PK_{Alice}}(m)
  4. Sends c to Alice
RSA Key Generation

Also see the handwritten notes.

  1. Alice chooses 2 large prime numbers p, q and computes n=p \cdot q, \phi(n)=(p-1)(q-1)
  2. Alice chooses an integer e with 1<e<\phi(n) that is relatively prime to \phi(n)
  3. Alice computes an integer d with 1<d<\phi(n) and d \cdot e = k \cdot \phi(n) + 1
  4. Alice publishes her public key PK_{Alice}=(e,)
  5. Alice keeps her private key SK_{Alice}=d and p, q, \phi(n) secret
RSA Encryption

Also see the handwritten notes.

  1. Bob obtains PK_{Alice}=(e,n)
  2. Bob composes plaintext m \in M=\{1,2,...,n-1\}
  3. Bob computes the ciphertext c=E_{PK{Alice}}(m)=m^e\mod n
  4. Bob sends c to Alice
RSA Decryption

Also see the handwritten notes.

Alice can obtain the plaintext message m by computing m=D_{SK_{Alice}}(c)=c^d\mod n = m^{ed} \mod n

RSA Security Hybrid Method

Combination of asymmetric and symmetric key methods.

Alice:

  1. Generates key pair (PK_{Alice}, SK_{Alice})
  2. Publishes PK_{Alice} at Trent’s
  3. c received → Decrypts K=D_{SK_{Alice}}(c)
  4. Alice and bob switch over to the symmetric key algorithm with key K

Trent:

Bob:

  1. Obtains PK_{Alice} from Trent
  2. Generates symmetric key K
  3. Computes c=E_{PK_{Alice}}(K)
  4. Sends c to Alice
Discrete Logarithms

Primitive element: Let p be a prime number. An element g\leq p-1 is called primitive element \mod p if for each A \in \{1,2,...,p-1\} there is an x such that A=g^x \mod p

Discrete logarithm: Let p be a prime number and let g \leq p-1 be a primitive element \mod p. Then an element x is called discrete logarithm of A to base g \mod p if A=g^x \mod p.

Discrete logarithm problem: Given A, g, p, find x \leq p-1 with A=g^x \mod p

One-Way Functions Diffie-Hellman Key Exchange Protocol

Purpose: Allow communication partners without prior knowledge of another to establish a shared secret key over an insecure communication channel

Also see the handwritten notes.

  1. Alice and Bob agree publicly on prime number p and a primitive element g \leq p-1
  2. Alice randomly chooses \alpha \in \{2,...,p-2\} and computes A=g^\alpha \mod p
  3. Bob randomly chooses \beta \in \{2,...,p-2\} and computes B=g^\beta \mod p
  4. Alice and Bob publicly exchange A and B
  5. Alice and Bob hold a common secret key K:
    1. K_B=A^\beta \mod p=g^{\alpha \beta} \mod p
    2. K_A=B^\alpha \mod p=g^{\alpha \beta} \mod p = K_B
Diffie-Hellman Key Exchange Protocol Security

It depends on three properties which can’t be relaxed:

Trust

Digital Signatures

Alice:

  1. Generates key pair (PK_{Alice}, SK_{Alice})
  2. Publishes PK_{Alice} at Trent’s
  3. Computes sigAlice(m)=E_{SK_{Alice}}(hash(m))

Trent:

Bob:

  1. Obtains PK_{Alice} from Trent
  2. Computes hash(m_{received})
  3. Decrypts signature D_{PK_{Alice}}(sig_{received})
  4. Compares hash(m_{received}) to the received signed hash
RSA Signatures Certificates

Transport Security

Internet Model TLS Handshake Overview
title TLS Handshake

Client->Server: Hello
Server->Client: Hello
Server->Client: Cert public key
Server->Client: Hello Done

note over Client: Pre-master secret
note over Client: Symmetric key

Client->Server: Change cypher key exchange
Client->Server: Client finished

note over Server: Pre-master secret
note over Server: Symmetric key

Server->Client: Change cypher sec
Server->Client: Finished

Client<->Server: Encrypted data transfer
TLS Record Protocol

Sender:

  1. Fragmentation
  2. Compression (optional)
  3. MAC computation (Key dependent; MD5, SHA-1, SHA-256 etc.)
  4. Encryption

Receiver:

  1. Decryption
  2. MAC verification
  3. Decompression (optional)
  4. Reassembly
Connection States SSH Transport Layer Protocol

Frequently Asked Questions

Phishing Attacks Phishing Attack Prevention Certificates and CAs Certificate Revocation Validation of Certificates Why can DES be decrypted even though F is not invertible? SQL Injection DNS Spoofing Replay Attacks and Signatures VPN Access from Intranet to external Mail Server Stateless vs. Stateful Packet Filters/Firewalls Hash Functions and their Applications Diffie-Hellman Key Exchange Man-in-the-Middle Attack Diffie-Hellman Key Exchange Protocol Characteristics

Sequence diagram of protocol

It is an asymmetric challenge-response protocol which is used to provide authentication by checking authentication factors. It does so by sending a hash of a random number, which has been encrypted using Alice’s public key/cert, to Alice, who then decrypts the hash and sends it to Bob.

Plaintext Awareness Key Reuse in the One-Time Pad

The following is no longer true (C = Cypher, K = Key, M = Message):

C1=M1+K
C2=M2+K
D=C1-C2=(M1+K)-(M2+K)=M1-M2

The difference D now has the same characteristics like M1-M2; this means that frequency analysis can be used.

Ingress and Egress Caesar Cypher Vulnerability Authentication vs. Authorization TCP Vulnerabilities if PRNG is predicable

Attacker can generate a sequence number, which can be used in an existing session between two communication partners → Enables session hijacking

Analog Examples for Security Objectives Server vs. Client Authentication in HTTPS

A web server is typically accessible to anyone; it is not important who accesses it. A client however wants to know that a site is trustworthy/authentic, which is why typically only the server is authenticated.

Vulnerabilities of non-revoked, faked Certs Applied Security Objectives

A person is communicating with amazon.com.

Firewall Appliance vs. Personal Firewall Diffie-Hellman vs. RSA Indirect Blocklisting

Sender’s mail address is faked and used to send spam, which leads the recipient to block the sender’s address, despite them never having sent any spam themselves. Can be fixed by checking signature and certificate instead and blocking based on signature or blocking all messages without signature or certificate.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4