Program and network threats
Program and network threats
Recorded by Dr. Krithika L.B. Slot m5-threats
The CIA goals of security, how Trojan horses, trap doors, buffer overflows, viruses, worms and denial-of-service attacks work, and how symmetric, public-key and hash-based cryptography defend against them.
By the end of this session you should be able to:
A system is secure if its resources are used and accessed as intended under all circumstances. Security distinguishes threats (potential violations) from attacks (attempts to break security). The classic goals are confidentiality (no unauthorised reading), integrity (no unauthorised modification) and availability (no unauthorised destruction or denial of service) — the CIA triad. Security must be applied at four levels: physical, human (phishing, social engineering), operating system, and network.
Protection (Session 5.4) is the internal mechanism controlling access to resources; security also guards against external attacks.
A program that appears useful but secretly misuses the rights of the user who runs it — e.g. a fake login screen that steals passwords, or a free utility that installs spyware.
A hidden entry point left by the programmer, e.g. a secret user ID or password that bypasses checks. Can even be inserted by a compromised compiler.
Code that does harm only when a condition is met — a date, or the programmer's name disappearing from the payroll.
Writing past the end of an array on the stack to overwrite the return address, so the function “returns” into code supplied by the attacker. The most common attack on network services.
A fragment of code embedded in a legitimate program; it replicates by infecting other programs and needs a host to run. Types: file, boot-sector, macro, polymorphic, stealth…
A standalone program that spreads itself over the network without a host program (see below).
#include <string.h>
void greet(char *input)
{
char buffer[16];
strcpy(buffer, input); /* no length check! */
}
/* An input longer than 16 bytes overwrites the saved frame pointer
and the return address on the stack. A crafted input puts machine
code in the buffer and sets the return address to point to it.
Fixes: strncpy/snprintf, bounds checks, non-executable stacks (NX),
address-space layout randomisation (ASLR), stack canaries. */The Morris worm (1988) exploited a finger buffer overflow, sendmail debug mode and trusted rsh hosts to infect ~6000 machines in hours. Modern worms spread through unpatched services.
Automatically connecting to ranges of ports to find services with known vulnerabilities (e.g. nmap) — reconnaissance, not an attack by itself.
Overloading a system so legitimate users cannot use it — e.g. SYN flooding half-opened TCP connections. Distributed DoS uses thousands of compromised machines (a botnet).
Eavesdropping on traffic; masquerading as another party; or sitting between two parties and reading or changing their messages.
On a network we cannot trust that a message came from whom it claims, or that nobody read or changed it. Cryptography constrains the possible senders and receivers using keys.
An encryption algorithm E(k) turns plaintext m into ciphertext c; decryption D(k) recovers m. It must be computationally infeasible to obtain m from c without the key.
The same key encrypts and decrypts. Fast. Examples: DES (old, 56-bit), 3DES, AES (128/256-bit, today's standard). Problem: how to share the key securely?
A public key (anyone may know it) encrypts; only the matching private key decrypts. Solves key distribution, but is much slower. Example: RSA.
TLS (HTTPS) puts it all together. The browser connects and the server sends its certificate (public key signed by a CA).
The browser checks the CA's signature with the CA's public key, built into the browser.
Browser and server agree on a fresh symmetric session key using asymmetric cryptography (e.g. Diffie–Hellman).
All further data is encrypted with fast symmetric encryption (AES) and protected with MACs.
Passwords are stored as salted hashes, never in plain text (Linux: /etc/shadow). Stronger schemes use one-time passwords, biometrics and multi-factor authentication (something you know + have + are).
Program and network threats
Recorded by Dr. Krithika L.B. Slot m5-threats
Cryptography as a security tool
Recorded by Dr. Krithika L.B. Slot m5-crypto
Work through these in order after the lecture — each one expands a part of the notes with diagrams, hover notes and a quick check.
Answer each question in your own words first, then reveal the model answer.
Revealed 0A virus needs a host program and spreads when the host runs; a worm is a standalone program that spreads by itself over a network.
It copies until the terminating 0 without checking the destination size, allowing a stack buffer overflow.
Asymmetric cryptography solves key exchange but is slow; it is used once to agree on a symmetric key that encrypts the bulk data quickly.
25 = 32; 32 mod 91 = 32.
Authentication of the sender and non-repudiation (the sender cannot deny signing), plus integrity.
Cryptography protects data on the wire. Inside the machine, the OS must decide which process may touch which object — the job of protection.
Continue to 5.4 — Domains of protection, access matrix and capabilities →