Security fundamentals: CIA, threats and attacks
The concepts of asset, vulnerability, threat, attack and risk; the CIA triad; DoS/DDoS, MITM, spoofing, phishing and types of malware. The definition and risk calculation questions of the final exam come from here.
The second half of the course starts here. In the first eight weeks you learned how packets are carried; now we will look at how the same packets are abused. This week looks like a vocabulary week, but the exam has two kinds of questions: choosing the right definition (is this a vulnerability or a threat?) and small risk calculations (risk score, ALE, DDoS traffic). Five golden rules:
- The vulnerability is inside, the threat is outside. A vulnerability is a weakness of the system; a threat is the event or person that could exploit it. An attack is the two meeting.
- Tie every attack to one of the CIA properties. Reading → confidentiality, modification → integrity, inability to access → availability.
- Risk = likelihood × impact. The monetary version: .
- In DDoS, find the traffic by multiplying. Number of bots × bot rate, or attacker rate × amplification factor.
- The smaller the attack surface, the better. Every open port, every service, every user is an entry door.
Basic concepts
In the language of security, the words are very close to each other, and these are exactly what the exam asks. Let’s think about it through a bank’s online branch.
| Term | Meaning | Bank example |
|---|---|---|
| Asset | Anything worth protecting | Customer account data, servers, reputation |
| Vulnerability | A weak point in the system | A login form that doesn’t validate input |
| Threat | A possible event that could cause harm | A criminal group that wants to steal data |
| Threat agent | The one who carries out the threat | An external attacker, a malicious employee, a natural disaster |
| Attack | The actual exploitation of a vulnerability | An attempted SQL injection through the form |
| Exploit | The code or technique that carries out the attack | A ready-made script that triggers the vulnerability |
| Risk | The combination of the likelihood and the size of the harm | “A likely large data loss each year” |
| Countermeasure (control) | A measure that reduces risk | Parameterized query, WAF, patch |
The chain is this: a threat agent carries out an attack through a vulnerability and harms the asset. A countermeasure breaks one link of this chain: it closes the vulnerability, detects the attack, or limits the harm.
PITFALL · confusing a vulnerability with a threat. An “unpatched server” is not a threat, it is a vulnerability. “A botnet scanning this server” is a threat. Ask yourself: is this a property of my system (vulnerability), or something that could come from outside (threat)?
The CIA triad
Information security has three basic goals. The abbreviation is CIA (the CIA triad):
- Confidentiality: only authorized people read the information. Tools: encryption, access control.
- Integrity: information is not modified without authorization; if it is modified, this is noticed. Tools: hash, MAC, digital signature.
- Availability: an authorized user reaches the information when needed. Tools: redundancy, backups, DDoS protection.
Two goals often added to these: authentication / authenticity, meaning the message really comes from the claimed person, and non-repudiation, meaning the sender cannot say “I didn’t send it”.
| Event | What is violated |
|---|---|
| A password being sniffed on unencrypted Wi-Fi | Confidentiality |
| A grade being changed in the grading system | Integrity |
| A website going down because of DDoS | Availability |
| Ransomware locking the files | Availability (and confidentiality too if there is exfiltration) |
| Impersonating the CEO with a forged email | Authenticity |
| A customer denying the order they placed | Non-repudiation |
Risk calculation
There is no budget to close every risk at once. First you rank the risks. The simplest method is a qualitative scale: likelihood and impact are scored from 1 to 5 and multiplied.
| Risk | Likelihood | Impact | Score |
|---|---|---|---|
| SQL injection in the login form | 4 | 5 | 20 |
| A malicious employee leaks data | 2 | 5 | 10 |
| A laptop is stolen | 3 | 3 | 9 |
| DDoS on the website | 2 | 4 | 8 |
The risk with 20 points is addressed first. The product determines the order; two risks with impact 5 are not equally important.
Monetary risk: SLE and ALE
The quantitative method converts risk into money:
- AV (asset value): the value of the asset.
- EF (exposure factor): the fraction lost in a single event (between 0 and 1).
- SLE (single loss expectancy): loss from a single event, .
- ARO (annualized rate of occurrence): the expected number of events per year. For “once every 4 years” it is 0.25.
- ALE (annualized loss expectancy): the expected yearly loss, .
Worked example. A database valued at 400 000 USD loses 30% of its value in a breach. A breach is expected once every two years.
SLE = AV × EF = 400000 × 0.30 = 120000 USD
ARO = 1 / 2 = 0.5
ALE = SLE × ARO = 120000 × 0.5 = 60000 USD / year
Whether to adopt a control is decided like this: (ALE before − ALE after) − annual cost of the control. If the result is positive, the control pays for itself. If negative, accepting the risk (risk acceptance) or transferring it by insurance (risk transfer) makes more sense. The four strategies: avoid, mitigate, transfer, accept.
Types of attacks
First the big distinction: a passive attack only listens (eavesdropping, traffic analysis); since it does not change the system, it is hard to detect, and the countermeasure is encryption. An active attack changes something: it modifies a message, replays it, impersonates an identity (masquerade) or stops the service. Active attacks are hard to prevent, but they can be detected.
DoS and DDoS
Denial of service (DoS) targets availability. If it comes from a single source it is called DoS, and if it comes from thousands of compromised machines (a botnet) it is called distributed DoS (DDoS). Three main classes:
- Volumetric: fills the link with traffic. Example: UDP flood, amplification.
- Protocol: exhausts the server’s state tables. Example: SYN flood.
- Application layer: sends expensive requests. Example: thousands of queries per second to a search page.
Botnet calculation. 5000 bots, each sending 2 Mbps: Mbps Gbps. A 1 Gbps link is exceeded ten times over.
Amplification (reflection/amplification). The attacker sends a small request to an open server, making the source address the victim’s address (spoofing). The server sends a much larger response to the victim. If the request is 64 bytes and the response 3200 bytes:
factor = 3200 / 64 = 50
attacker = 10 Mbps of forged requests
to the victim = 10 × 50 = 500 Mbps
SYN flood. Recall the TCP three-way handshake (week 7). When the server receives a SYN, it sends a SYN-ACK and keeps the half-open connection in a queue (backlog) until the final ACK arrives. The attacker sends SYNs from forged addresses, and the ACK never arrives. If the queue is 2048 entries and the timeout is 60 s, SYN/s is enough to keep the queue full. A very low rate. The defense is SYN cookies: the server keeps no state and encodes the information in the sequence number of the SYN-ACK.
TIP · DDoS questions are always multiplication. Bots × rate, attacker rate × factor, backlog / timeout. Watch the units: when converting Mbps to Gbps, divide by 1000.
Man-in-the-middle (MITM)
The attacker gets between the two parties and acts toward each as if it were the other. It can read the traffic (confidentiality) and modify it (integrity). On a local network the typical way is ARP poisoning (week 4): the attacker broadcasts a forged ARP reply saying “the gateway’s MAC address is mine”. Countermeasures: end-to-end encryption and server verification with a certificate (TLS), static ARP entries, dynamic ARP inspection on the switch.
Spoofing (identity forgery)
Forging an identity. IP spoofing: changing the source address of the packet; used in DDoS reflection. ARP spoofing: a forged MAC mapping. DNS spoofing: redirecting a user to another server with a forged DNS reply. Email spoofing: forging the “From” field; reduced with SPF, DKIM and DMARC.
Phishing
Convincing a user with a fake message to enter a password or open a file. The targeted version is spear phishing, the one aimed at executives is whaling, the SMS version is smishing, and the phone version is vishing. It exploits human weakness more than technical weakness; it is a kind of the social engineering in week 11. Countermeasures: awareness training, multi-factor authentication (MFA), email filters.
Malware
| Type | Distinguishing feature |
|---|---|
| Virus | Attaches to a file, spreads when the file runs |
| Worm | Spreads itself over the network without a user |
| Trojan horse | Looks useful, does the bad work secretly, does not replicate |
| Ransomware | Encrypts data, demands a ransom |
| Spyware, keylogger | Collects information, records keystrokes |
| Rootkit | Hides itself from the operating system |
| Backdoor | A hidden entrance that bypasses normal authentication |
| Logic bomb | Triggers when a condition occurs |
| Bot | Takes remote commands, is part of a botnet |
The attack surface
The attack surface is the sum of all the points where an attacker can touch the system. Three components: the network surface (open ports, services), the software surface (every function that takes input, APIs, plugins) and the human surface (every employee who could fall for phishing). Ways to reduce it: shutting down unused services, restricting ports with a firewall, deleting unnecessary code and accounts, giving each component the least privilege.
Authentication is part of the surface too. Weak passwords are open to brute force:
8 characters, lowercase only: 26^8 = 208 827 064 576
10^9 guesses per second → ~209 s (3.5 minutes)
8 characters, 62 symbols: 62^8 ≈ 2.18 × 10^14
10^9 guesses per second → ~2.5 days
As the length and the symbol set grow, the time increases exponentially. Still, the real defense against an offline attack is a slow, salted password hash.
Common mistakes
| Wrong idea | Correct |
|---|---|
| Unpatched software is a threat | It is a vulnerability; the threat is whoever will exploit it |
| Ransomware is a confidentiality violation | Primarily an availability violation |
| Modifying a message is a confidentiality violation | It is an integrity violation; reading is confidentiality |
| “Once every 4 years” → ARO = 4 | ARO = 1/4 = 0.25 |
| ALE = AV × ARO | First SLE = AV × EF, then ALE = SLE × ARO |
| If the control’s cost is less than the ALE, always take it | Compare: is the ALE reduction − cost > 0? |
| An IDS easily catches a passive attack | A passive attack leaves no trace; the countermeasure is encryption |
| Worm and virus are the same | A worm spreads without a user or a file |
| SYN flood needs a lot of traffic | Only backlog / timeout, tens of packets per second are enough |
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
A web server runs an outdated library with a publicly known flaw that has not been patched. In security terminology, the unpatched flaw itself is best described as a:
- threat
- vulnerability
- attack
- countermeasure
Show answer
A vulnerability is a weak point in the system: the unpatched library is exactly this. A threat is a possible event or person that could exploit this weakness. An attack is the actual exploitation of the vulnerability. The countermeasure would be installing the patch.
Ransomware encrypts all files on a hospital file server so that staff cannot open patient records. Which CIA property is primarily violated?
- Confidentiality
- Integrity
- Availability
- Non-repudiation
Show answer
The files were encrypted, and the staff cannot access the records. An authorized user being unable to reach the data when needed is a violation of availability. If the ransomware also exfiltrates the data, confidentiality is violated too, but the primary effect in the question is the inability to access.
An attacker on the path between a customer and a bank changes the amount in a transfer request from 100 to 9000 without being noticed. Which property is violated?
- Confidentiality
- Integrity
- Availability
- Anonymity
Show answer
The content of the message was modified without authorization. Integrity means data is not modified without authorization. Even if the attacker also read the message, the real damage comes from the modification. The countermeasure is a MAC or a digital signature (week 12).
On a 1 to 5 scale, a threat has likelihood 3 and impact 4. Using risk = likelihood × impact, what is the risk score?
Show answer
. 12 out of 25 is a medium-high risk. In a risk matrix, 1-6 is usually considered low, 8-12 medium, and 15-25 high; the thresholds vary by organization, so use them if the question gives them.
A customer database is valued at 250,000 USD. A breach would destroy 20% of its value, and such a breach is expected once every 4 years. Compute the annualized loss expectancy (ALE).
Show answer
First the single loss expectancy (SLE): .
Expected number of events per year: one event every 4 years means .
USD/year.
Without a control, ALE = 50,000 USD. With a new intrusion prevention system, ALE drops to 10,000 USD. The system costs 25,000 USD per year. What is the net annual benefit, and is the control justified?
Show answer
Value of the control = (previous ALE − new ALE) − annual cost.
USD.
Since the result is positive, the control makes economic sense. If it had come out negative, accepting the risk or transferring it (insurance) would have been more appropriate.
In a reflection/amplification attack, each spoofed 50-byte request makes a server send a 2500-byte response to the victim. If the attacker sends 4 Mbps of requests, how much traffic reaches the victim?
Show answer
Amplification factor: .
Traffic going to the victim: Mbps.
Because the source IP is forged (spoofed), the responses go to the victim. Defense: filtering packets with forged sources at egress (egress filtering) and closing open reflector servers.
A botnet of 8000 compromised hosts each sends 1.5 Mbps toward a victim whose access link is 1 Gbps. What is the total attack rate, and how many times larger is it than the link capacity?
Show answer
Mbps Gbps.
. The link is exceeded 12 times over; legitimate traffic can't even get into the queue. Since each bot produces little traffic, source-based blocking is hard, and this is exactly what distinguishes DDoS from DoS.
A server keeps at most 512 half-open TCP connections, and each half-open entry times out after 20 s. What minimum SYN rate keeps the backlog permanently full during a SYN flood?
Show answer
Each half-open entry occupies a slot for 20 s. To keep the queue full, 512 new SYNs are needed every 20 seconds:
SYN/s.
So about 26 packets per second are enough; this is a very small amount of traffic. That is why SYN flood is a cheap attack. Defense: SYN cookies (the server keeps no state), enlarging the backlog, shortening the timeout.
Which type of malware spreads across a network by itself, without needing to attach to a host file or wait for a user to run it?
- Virus
- Trojan horse
- Worm
- Logic bomb
Show answer
A worm spreads on its own: it scans the network for vulnerabilities and copies itself to other machines. A virus attaches to a file and spreads when that file runs. A trojan looks useful but does not replicate itself. A logic bomb is triggered under a specific condition.
Passwords are 6 characters long, each chosen from 36 symbols (a-z, 0-9). An offline attacker tests 10^6 guesses per second. What is the worst-case time to try the whole space?
Show answer
Key space: .
Worst-case time: s minutes. On average it is found at half of that: about 1088 s.
Lesson: a short password falls within minutes on fast hardware, even if uppercase letters and symbols are added. Length is the strongest factor; slow hashes (bcrypt, Argon2) and salt are also used.
Which of the following is a passive attack?
- Replaying a captured login message
- Eavesdropping on unencrypted Wi-Fi traffic
- Flooding a server with SYN packets
- Modifying DNS replies in transit
Show answer
A passive attack does not modify the system, it only listens: eavesdropping and traffic analysis. This makes it hard to detect, and the way to protect against it is encryption. Replay, SYN flood and modifying DNS replies are active attacks: they change or disrupt something in the system.
Verification: Risk scores, SLE/ALE, amplification, botnet traffic, SYN backlog rate and brute-force times were computed with node (verify/SEN2008/10.mjs). The definition questions are conceptual and need no calculation.