Cyber Attacks
Prerequisite Knowledge
This lecture builds on the following concepts from earlier lectures. If any feel unfamiliar, review the linked notes before proceeding.
Previously Covered in This Subject
- Incident response lifecycle — covered in Lecture 9
- Ransomware — covered in Lecture 8
- Denial of service and distributed denial of service — covered in Lecture 8
- Man-in-the-middle attacks — covered in Lecture 8
- SQL injection — covered in Lecture 8
- Zero-day exploits — covered in Lecture 8
- DNS tunneling — covered in Lecture 8
- Malware types: viruses, trojans, and adware — covered in Lecture 8
11.1 Incident Response Lifecycle Recap
11.1.1 The Lifecycle and Its Core Message
Hook: Two organizations get hit by the same malware on the same day. The first detects it within minutes, isolates the machine, and the damage stays small. The second notices weeks later, after the malware has quietly spread through the network. Same attack, very different outcome. What made the difference? Not luck — detection speed. That single idea is the core message of the entire incident response lifecycle.
The session opened by recalling where the course stands and what the last session covered: how to identify, contain, and mitigate malware attacks, with a high-level look at how an incident response team should be organized. The key idea from that discussion is worth carrying into everything that follows: the quicker you can detect an incident, the less impact it will have on the organization. Detection speed is the lever that controls damage. The whole lifecycle is built around that one thought.
Why does detection speed matter so much? Because an attack is a race against time. The longer malware sits undetected inside a network, the more machines it can reach, the more data it can copy or encrypt, and the harder cleanup becomes. Think of a small fire in a kitchen: caught in the first minute, one extinguisher handles it; left for an hour, it takes the fire department and the building may be lost. Detection is the point where the organization stops reacting blindly and starts fighting back — every phase after detection (containment, eradication, recovery) only works as well as the time that detection bought.
11.1.2 Phases from Preparation to Post-Incident Activity
The incident response lifecycle has these phases:
The six phases of the incident response lifecycle:
- Preparation — this is mostly documentation. You write down your incident response procedure, decide who should be involved, and lay out the process, people, and technology that will be used when something goes wrong.
- Detection — using tools and analysis to find out that an attack is happening. The importance of detection is that it decides how much time the organization has to react.
- Containment — the moment something is detected, it moves into a containment zone so the infected virus or malware cannot spread to the rest of the organization. Containment is about limiting the blast radius.
- Eradication — removing whatever has been infected and cleaning up the malware itself.
- Recovery — bringing the data back, if possible, and restoring normal operations.
- Post-incident activity — looking back at what technical control was missed and improving it so that detection time gets shorter next time. This is the lessons-learned phase: what went wrong, and what should be improved from the incident response process perspective.
Picture the lifecycle as a loop, not a one-way street. Preparation (the documented plan, the trained people, the monitoring tools) feeds detection; detection triggers containment; containment limits what eradication must clean; eradication makes recovery possible; and recovery closes with post-incident activity, whose whole purpose is to feed an improved preparation for the next incident. The loop exists so the next pass through the cycle starts stronger than the last one. NIST's well-known four-step formulation (Preparation, Detection and Analysis, Containment Eradication and Recovery, Post-Incident Activity) compresses these same ideas — the professor's six-phase version simply splits the middle into finer steps, but the logic is identical: detect early, isolate fast, clean thoroughly, and learn.
This earlier material was really the base vocabulary: containment, detection, and response are the key terms, and the whole lifecycle is how they link together in an incident management process or a security incident response process.
Pitfalls to avoid:
- Treating preparation as optional paperwork. A plan written and never tested is a plan that fails on the day it is needed. Drills, runbooks, and contact lists must be exercised before an incident, because during an incident there is no time to design them.
- Slowing down after detection. Detecting an attack but hesitating on containment gives the malware extra hours to spread. Containment decisions often must be made with partial information — speed is part of the job.
- Skipping post-incident activity. If the team jumps straight to the next task after recovery, the missed control that allowed the incident will allow the next one too. The lessons-learned step is what makes detection time shrink over time.
- Confusing containment with eradication. Pulling the machine off the network stops the spread, but the malware is still on the machine. Containment is buying time; eradication is finishing the job.
The visual shape of the lifecycle is a circle with six numbered stations, one per phase. If you picture it as a clock face, the top-left station (preparation) is where planning happens; moving clockwise, detection sits where monitoring tools watch the network, containment is the narrow gate that isolates the infection, eradication is the deep-clean stop, recovery returns services to normal, and post-incident activity is the last station that curves back to preparation. The key landmark is the detection station: everything after it exists to shrink the damage that a detected incident can cause. The one-sentence takeaway: the loop's value depends almost entirely on how early the detection station fires.
Recap: Detection speed is the lever that controls damage — the quicker an incident is detected, the less impact it has. The six phases (preparation, detection, containment, eradication, recovery, post-incident activity) form a loop, and every concept in this lecture (ransomware, DoS, session hijacking, SQL injection, zero-day, DNS tunneling) will be examined through exactly these lenses: identify it, contain it, mitigate it.
11.2 Ransomware
11.2.1 Encryption Background
Hook: The very same mathematics that protects your bank password can be turned against you — instead of the owner hiding the data, the attacker encrypts the data and then demands money for the key. That reversal is the whole business model of ransomware.
Ransomware builds on encryption, so the background matters. Encryption is the process of converting plaintext — the original readable text — into ciphertext — the scrambled, unreadable form — using an encryption algorithm. Think of encryption as a lockable box for text: anyone can look at the box (the ciphertext), but only whoever has the key can open it and read the message inside. A key is the secret value that drives the transformation: you use one key for encrypting and one for decrypting. When the same key is used for both encryption and decryption, it is called private key encryption (also called symmetric encryption). The challenges of private key encryption — mainly, how to share that single key safely between sender and receiver — are what led to the development of public key encryption, where a public key encrypts and a separate private key decrypts.
Encryption sits inside the information security triad, the CIA triad, where it serves the confidentiality pillar: it makes sure only legitimate people can read the data, using the key that the sender shared with them. The description given in the session was: encrypting converts a plain text into a cipher text using an encryption algorithm, with a key for encrypting and a key for decryption. Reconstructed symbolically:
where is the plaintext, is the ciphertext, is the encryption operation using key , and is the decryption operation. When the same key does both jobs, that is private key encryption.
Notation check. Standard texts (e.g., the course toolbox on authentication and cryptography) write the same pair as and without naming the key, and then make the key explicit as with decryption . The professor's and forms are the same idea — the key is just written as a subscript on the operation instead of an argument. For symmetric encryption the same appears in both equations; for public-key encryption the decrypting key differs from the encrypting key , giving .
A quick sanity check with real numbers makes the pair of equations concrete. Take the plaintext message , the key , and the rule "shift each letter forward by positions in the alphabet" (a Caesar shift). Then , so . Decryption reverses the shift: , recovering the plaintext exactly. Notice the essential property: — decrypting an encryption gives back the original message. Every encryption scheme used in real products, from AES to RSA, must satisfy this round-trip property; it is what makes encrypted data usable by its owner.
The twist is that the same technology built to protect confidentiality can be used the other way around: the attacker is the one doing the encrypting, and the victim is the one who loses access. The victim holds (their own files, now scrambled) but not the attacker's , so the victim's cannot recover — and the attacker sells the key back for a ransom. This is exactly why the CIA triad's availability pillar (the "A" in CIA) is what ransomware attacks: the data still exists, and its confidentiality is not breached in the classic sense, but the legitimate owner cannot get at it.
Scope — where this background matters: The encryption equations apply to any cipher, symmetric or public-key, and they are the minimal model you need to understand ransomware. What they do not capture is key management: who holds the key, how it was generated, and how it is delivered. In ransomware, the attacker generates the key, holds it off-machine, and does not share it until payment — so no amount of local password guessing can recover the files. Also note that encryption alone guarantees only confidentiality; integrity and authentication (was the message changed? who sent it?) need separate tools such as hash functions and digital signatures.
11.2.2 How a Ransomware Attack Works
Ransomware is malware whose main objective is to encrypt all the data on the victim's laptop, desktop, or server. It is not spyware quietly collecting data, and not a wiper that destroys it — the files must remain intact but unusable, because intact-but-locked files are what the victim will pay to unlock. The attack follows a fixed pattern:
The three-step ransomware pattern:
- Gain access to the system. This can happen through a number of methods: phishing emails, malicious attachments sent along with emails, or existing vulnerabilities in the software being used.
- Encrypt the files so that they can no longer be reused by the owner.
- Display a ransom note on top, demanding some X amount of cryptocurrency in exchange for the key that can decrypt the files.
Worked walkthrough — a typical ransomware infection. Suppose an employee at a company receives an email that looks like an invoice, with an attached PDF. The attachment is actually a malicious dropper.
- Step 1 — Gain access: The employee opens the attachment (no input validation, no gateway filter stops it). The dropper runs, downloads the ransomware binary, and executes it with the user's privileges. In 2017 the WannaCry worm showed the access step can also be fully automated: it exploited a Windows SMB vulnerability (EternalBlue) and spread from machine to machine with no user action at all, infecting hundreds of thousands of systems worldwide in days.
- Step 2 — Encrypt the files: The ransomware walks the file system looking for documents, images, databases, and code — the file types people cannot afford to lose — and encrypts each one with the attacker's key. It also deletes or encrypts backup copies and shadow copies it can find on the same machine, so the victim cannot simply roll back.
- Step 3 — Demand payment: A ransom note appears on the screen (and often a text file in every folder): "Your files are encrypted. Pay 2 Bitcoin to [wallet address] within 72 hours to receive the decryption key." The payment is cryptocurrency (Bitcoin and its successors) because it lets the attacker receive money without revealing a bank identity.
Sense-check: At the end of step 3, the victim holds only ciphertext. Without the attacker's key (or a tested backup), the files are effectively lost — which is precisely why recovery plans and backups dominate the rest of this lecture.
Before an infection even lands, there are defenses that make access harder: check whether the email landing in the inbox is from a legitimate source; rely on the inbuilt tools most organizations have that scan attachments; when using open-source components, check that there are no vulnerabilities in them; and install patches whenever they are pushed to systems or software. A patch is a piece of code written by developers to overcome a loophole — a vulnerability — that has been identified in existing software. The patch and vulnerability pair is the classic race: vendors find flaws, ship patches, and attackers weaponize flaws faster than organizations install the patches. Every unpatched system is a standing invitation for the "gain access" step of ransomware.
Real-world: in 2023, the cyber reports detected an unprecedented surge in ransomware attacks — the statistics showed that the average monthly number of reported ransomware attacks in 2020 was 20, and between January 2020 and 2023 it reached 31. Because of existing vulnerabilities, ransomware became easy and common to perform both at the corporate level and at the individual level.
Worked example — reading the 2020–2023 ransomware statistics. The reported figures were: average monthly reported attacks of 20 in 2020, rising to 31 by the January 2020 – 2023 window.
- Growth factor: , i.e., a 55% rise in the average monthly attack count.
- Over 36 months (Jan 2020 – Jan 2023), a flat rate of 31 attacks/month implies roughly reported attacks in that window — a useful ballpark of scale, even though real monthly counts fluctuated.
Sense-check: the numbers move in one direction only — up — which matches the session's claim that ransomware "became easy and common" once attackers could lean on unpatched vulnerabilities at both corporate and individual level.
11.2.3 Identifying Ransomware
Some common ways to notice a ransomware attack early:
- Unusual system behavior — a sudden slowdown in system performance.
- Unfamiliar applications running — programs you never observed and that are not part of your day-to-day operations suddenly appear in the running list.
- Sudden access to system files — for example, in Windows, when somebody starts touching the system files under the C drive.
- The ransom note demanding payment appears on the screen.
The strategies for identification go deeper than these symptoms:
Three deeper identification strategies:
- Continuously monitor system behavior — this is where EDR, Endpoint Detection and Response systems, come in. In the traditional antivirus mechanism, signatures are pushed to the antivirus agent, and the agent scans the system to see whether any known virus has hit it. EDR goes beyond that: it monitors at the process-to-process communication level to see what is actually happening. Example: you open Internet Explorer, open a website, and that website tries to communicate with a system file that is not required — the EDR will block it. Another characteristic: if a process that never communicated with any program files suddenly tries to establish communication under a file saved with the name of a program file — the kind of disguise traditional systems would not detect — the EDR flags it. This level of monitoring is one of the identification methods for ransomware.
- Identify file inaccessibility — if critical files suddenly become inaccessible, that is a practical identification signal.
- Ransom notes displayed on the screen — the note itself is an identifier.
Why EDR catches what antivirus misses: antivirus compares file contents against a database of known signatures, so a brand-new ransomware strain with no signature sails through. EDR instead watches behavior — which process talks to which other process, which file is being touched, whether an executable is masquerading as a legitimate name. Ransomware must, by definition, do unusual things (mass-encrypt thousands of files, spawn unexpected processes, phone home to a command server), and those behaviors are what EDR detects even when no signature exists yet.
Pitfalls in identification:
- Waiting for the ransom note. The note is the last signal — by then the encryption is already done. Treat slowdowns, strange processes, and odd file-system access as alarms, not as noise.
- Trusting antivirus alone. Signature-based AV is the traditional control, but most companies have moved from AV to EDR because signatures cannot catch unknown malware. Relying only on AV means relying on a list of yesterday's attacks.
- Ignoring "one file suddenly inaccessible." Ransomware often encrypts in batches; the first inaccessible file may precede the note by minutes. A quick investigation at that point can still stop the spread.
11.2.4 Containing Ransomware
Containment means making sure whatever is infected does not spread to the rest of the organization's network. The goal is to restrict the impact to the system that has been affected. The practical strategies implement controls that minimize the scope of the event and contain the effects of this unauthorized use within the environment:
Five containment strategies for ransomware:
- Isolate the infected laptop or desktop — remove it from the LAN, the local area network. Physically unplugging or disabling the network interface stops lateral movement in one action.
- Power down the device and try to identify the initial point of infection, where the attack started. Powering down also freezes the encryption process so it cannot keep consuming the disk.
- Automate enforcement — kill unknown processes you are not aware of, and kill unauthorized network connections you can find in the task manager. Doing this automatically (via EDR policy) is faster than waiting for a human analyst.
- Confirm the backups — ensure the scheduled backups (daily, weekly, or monthly) are actually happening per the schedule. In ransomware scenarios, availability of data can still be achieved by pulling data from the backup systems.
- Monitor and respond to threats in real time — invest in and use monitoring tools.
The mental model for containment is the blast radius: the goal is not to fix the infected machine (that is eradication's job) but to make sure the damage is bounded to machines already touched. Every minute the infected laptop stays on the LAN, the ransomware has another minute to reach file servers, shared drives, and other desktops — which is why isolation and power-down are first-aid actions taken before anyone investigates the details.
Pitfalls in containment:
- Unplugging the network but leaving the machine on. Isolation from the LAN stops network spread, but a machine still running may keep encrypting local files and shadow copies. For a confirmed ransomware hit, power down as well.
- Assuming backups exist. A backup that is not confirmed is a backup that may not exist. The containment step "confirm the backups" exists because the recovery step later depends on it.
- Containing the visible machine but not the account. If the ransomware arrived through a compromised user account, that account may still be active elsewhere; credentials should be treated as compromised too.
11.2.5 Student Questions: Protecting Backup Systems
A question was posed about the interaction between backups and infection:
Q: Suppose a laptop is already impacted by ransomware — or even a malware that is so new that the latest EDR tools installed cannot detect it. Now you are taking backups of your systems as per your schedule, daily, weekly, or whatever you have configured. If your primary system is already infected, how do you stop that malware from spreading to the backup systems, or even to the backup servers where the backup is happening?
A: Take this as an assignment and research the answer. Think from the cybersecurity perspective: what technical controls do you need to implement so that even though the primary system is infected, the backup systems are never impacted? The instruction is not to answer right away from memory — Google it, and find out what current technology ensures that a malware is never taken as a backup into the backup systems. The reason this matters: in the main examinations, scenario questions are set in this style — a scenario where this happened, the backup systems also got infected, and you must say what went wrong or what would have been implemented so the virus, malware, or ransomware never spreads to the backup systems. The assignment is practice for exactly that. Just an example — the exam scenario will not be the same, but it can be similar in method.
A follow-up sharpened the question:
Q: Whatever it is — what technology needs to be in place to prevent ransomware spread to the backup systems?
A: One among the malware is ransomware, but it can be anything — a virus, a trojan. Saying "developing ransomware-resistant backup systems" is one line, but the real question is: what are the real-time technology and technical controls the industry is implementing? That is the focus. Do some research on the internet and come up with technical controls — it will be beneficial from the examination perspective also. Several students were responding immediately; the guidance was to resist hurrying and instead research the different ways this can be prevented.
The professor deliberately turned the question into a research assignment rather than answering from memory — and that shape (a scenario where the backup systems also got infected, and you must name what went wrong and what controls would have prevented it) is exactly the shape of the exam question. As starting points for the research, think about controls such as: immutable or write-once backup storage (backup data that even the backup software cannot overwrite), air-gapped or offline backups (a copy that is physically disconnected from the network during normal operation), separating backup server credentials from production credentials, requiring multi-factor authentication for backup administration, and scanning or sandboxing restored data before it returns to production. The key principle is that the backup channel must be one-way: production may push data into the backup store, but an infected production machine must never be able to reach back and modify the stored copies.
A student who had taken the makeup examination raised the recovery side of ransomware:
Q: Could you explain how the ransomware affects our devices and how affected devices are recovered or rebuilt? Also, at what level are the devices wiped before being introduced back into the network — is it simple reformatting, hard disk wiping, recovering, or replacement?
A: The recovery actions needed once the ransomware has affected a system will be covered in the next session. The point was noted down so that the next session can provide the strategies for how to recover after a ransomware incident.
This question was logged as an explicit agenda item: the level of device sanitization (simple reformat vs. full disk wipe vs. rebuild-from-image vs. hardware replacement) before reintroducing a machine to the network is precisely the recovery strategy content the next session will deliver.
11.2.6 Mitigation: Zero Trust and Risk Response
Mitigation of ransomware starts with having an incident response plan (IRP) in place, slowing the attack down, identifying the ransomware, and implementing a zero trust approach.
Professor's phrase to remember: zero trust means never trust, but verify — always verify, then grant access. The old model trusted a laptop because of where it came from; the new model trusts nothing until the device has proved itself.
The zero trust network, or ZTN (also called the zero trust security model), changes how trust is granted. Earlier, an organization's laptop was trusted based on MAC address binding, and the moment it tried to connect to the corporate network it was connected immediately. With the current technology, vendors such as JetScale and many others provide zero trust models where the device goes through its own set of sanity checks, and only when it has met all the requirements does it get access to the corporate network.
What does the verification actually check? The laptop's identity, and its device compliance — patch compliance and whatever checks the cybersecurity engineers have configured. Once those pass, the device is granted access to the shared drive, the corporate network, or whatever it is trying to access. Compare this with what used to happen with a VPN: provide credentials, or RSA token values, and the connection was made. In the ZTN architecture deployment model, organizations check the identity of the users and the integrity of the users and devices with respect to their locations; the checklist configured by the cybersecurity engineer must be met before the end user gets access.
| Dimension | Traditional VPN | Zero trust network (ZTN) |
|---|---|---|
| What is trusted | The user's credentials (and an RSA token) | Nothing by default — every device and session |
| Device check | None beyond the VPN client | Identity, patch compliance, integrity checklist per request |
| Access grant | Connect to the corporate network once authenticated | Verify, then grant access to the specific resource (shared drive, service) |
| Failure mode | A stolen credential = full network access | A stolen credential still fails the device/location checks |
When to pick which: a traditional VPN is a faster, cheaper fit for low-risk access; ZTN is the choice when the risk assessment says the cost of a compromised device is too high to leave trust implicit.
Whether an organization should go with zero trust or with a traditional VPN depends on the risk: you perform a risk assessment on the organization, project, or business process, and when the risk is identified as high, you do a cost-benefit analysis — will existing systems support this new technology, how much is the cost, how much effort is incurred, and do we have enough manpower with the technical skills to troubleshoot when something goes wrong. Installing a zero trust agent is not the end of the story; support capability matters, because security is just an enabler for the smooth running of business, and the day-to-day operations need confidentiality, integrity, and availability not to be impacted.
Real-world: the same reasoning explains why not every organization has moved to the cloud even though cloud technology has existed for close to five to ten years. The decision depends on regulatory requirements, the risk to the organization, and the cost. A financial organization doing payroll operations without technical people would compare the setup and maintenance cost of a traditional data center against the cloud options, and consider its global presence and availability needs before going with a public service provider — AWS, GCP, or Microsoft Azure — or with a private cloud service provider where requirements are highly regulated.
As part of risk response, remember there are four methods: accept the risk, transfer it (for example by insurance), or implement a control — that is the risk mitigation effort. Mitigation minimizes the risk from ransomware, but the risk will never be zero.
Risk response pitfall: implementing a control does not make the risk disappear — it reduces it. The professor's line "the risk will never be zero" is the reminder that residual risk remains after mitigation, which is why backups, insurance (risk transfer), and an incident response plan must exist alongside the technical controls. A zero trust rollout that ends at "agent installed" is also incomplete: without trained support staff, a broken agent becomes a business outage, and security fails its role as an enabler.
The mitigation approaches discussed were: quarantining the infected files, decrypting with antivirus (antivirus itself is now outdated — most companies have moved from AV to EDR, endpoint detection and response), patching and updating systems, implementing an EDR, and — last but not least — awareness and training.
11.2.7 Mitigation: EDR, Patching, and Awareness
The technical side of mitigation is EDR deployment, patching, and keeping software updated. The human side is equally important:
Professor's warning: even if 99 controls are implemented, the system is not secure unless the end users — the people dealing day-to-day with the systems and the network — have received enough awareness and training. Controls are operated by people; an untrained person clicks the phishing link that the 99 controls were designed to stop.
Most companies so make onboarding include all the cybersecurity modules and regulatory trainings: on a HIPAA-regulated account you are mandated to complete HIPAA training, and banking domains have their own mandated trainings.
This is the physical, administrative, and technical (PAT) control view. The session had discussed technological controls; from the administrative perspective, organizations must run awareness sessions, not only at onboarding but annually — in some organizations this is a mandated control in external audits such as SOC 1 or SOC 2, which require the training to happen at least once a year. Physical controls are the common physical security controls that were already implemented. Together, technical, administrative, and physical controls prevent the risk from ransomware.
| Control category | Examples for ransomware |
|---|---|
| Technical | EDR, patching, network isolation, zero trust checks, backup verification |
| Administrative | Awareness sessions at onboarding and annually, security policies, SOC 1 / SOC 2 mandated training, HIPAA training |
| Physical | Locked server rooms, access badges, protection of backup media |
The three categories work as a stack: a phishing email is stopped at the technical layer by the email gateway, at the administrative layer by a user who has been trained not to click, and if it still lands, physical controls protect the backup media that the recovery step needs.
11.2.8 Exam Notes
Exam note: this topic is in the syllabus. Expect the question set around what ransomware is, and what preventive and detective controls you can implement so that the impact can be minimized.
Exam note: the backup assignment is exam-relevant. Expect scenario questions in the main examination where a primary system and even the backup systems got infected — you should be able to say what went wrong and which controls would have prevented the spread. The assignment scenario is an example; the exam scenario will be similar in method, not identical.
Recap: Ransomware is the weaponized reversal of encryption: protects data when the owner holds , and becomes an attack when the attacker holds and demands payment. Identify it early (EDR behavior monitoring), contain it fast (isolate and power down), and mitigate it with zero trust, patching, verified backups, and awareness — remembering that mitigation never brings risk to zero.
11.3 Denial of Service and Distributed Denial of Service
11.3.1 What DoS and DDoS Are
Hook: A legitimate user tries to buy a ticket or check a balance, and the server simply does not answer — not because it crashed, but because it is drowning in fake requests. The attacker never broke in and never stole data; they just made the service impossible to use. That is a denial of service attack: the target of the attack is availability.
A denial of service (DoS) attack has one main objective: to make the legitimate users who are trying to access a server unable to reach it. The name says it — you are denying the service. Legitimate persons trying to access the system or network are made unavailable, the business gets disrupted, and the server cannot respond to requests because it is continuously busy with the number of hits arriving at it. The simplest mechanism is flooding the machine or making the system overload.
Professor's analogy — the overloaded processor. In the old days, when you opened too many applications on an old processor, the system hung — the processing capacity was less than the amount of processing being demanded, so the machine did not know what to do. A server works the same way: it has a limit on the number of requests it can accept. If the hacker floods the target machine or resource with a very high number of requests, the system overloads and can no longer accommodate the legitimate requests — so legitimate users are unable to access the server. That is a DoS. The analogy maps cleanly: "too many open apps" is the flood of requests, the "hang" is the server's inability to respond, and the fixed limit of the old CPU is the server's finite request capacity. The analogy breaks in scale: a modern server farm has enormous capacity, which is why a single attacker's machine is usually not enough — that is exactly the gap that motivates the distributed version below.
A distributed denial of service (DDoS) is the same idea executed with distributed computing power. Instead of the flooding traffic originating from one resource, it comes from multiple resources: not one machine attacking one server, but many machines flooding the traffic toward a single target. The main requirement is more computing power, which comes from enabling more systems to support the attack — typically using bots, also called zombie agents.
| Dimension | DoS | DDoS |
|---|---|---|
| Traffic source | One machine / one connection | Many machines (a botnet of zombies) spread across networks |
| Computing power | Limited to the attacker's machine | Sum of all compromised machines |
| Traceability | Easier — single source address | Harder — traffic arrives from many IPs, geographically scattered |
| Defensive implication | Block one source and it ends | Blocking individual sources is useless; need traffic-level defenses |
When to expect which: an attacker with modest resources and a small target may use DoS; anything facing a public cloud service, a large website, or a well-connected organization will almost certainly be DDoS.
The DoS attack exploits a vulnerability — a weakness in the system or network — and the objective is achieved by sending a large volume of traffic: it can be raw packets (back data) or connection requests. The TCP three-way handshake is a good example: the sender sends a SYN, gets a SYN-ACK back, and completes with an ACK. If an attacker continuously sends TCP half-way connections — a SYN flood, sending SYN, SYN, SYN — the server is kept continuously busy responding to SYN requests, and legitimate connections that are still waiting for the handshake to complete sit in the waiting queue. There are many such methods to make a denial of service happen.
Worked example — the SYN flood against the TCP handshake. Normal TCP connection setup (three-way handshake) with sequence numbers:
- Client → Server: SYN,
- Server → Client: SYN-ACK, — and the server allocates a table entry for the half-open connection
- Client → Server: ACK, — connection established, table entry finalized
Attack version: the attacker sends thousands of SYN packets with forged source addresses and never completes step 3. Each SYN forces the server to spend a table slot and a SYN-ACK reply on a connection that will never finish. The server's connection table has finite size, say slots. Once the attacker has filled all slots with half-open connections, every legitimate user's SYN — including yours — is rejected: the table is full, so the real handshake never even starts. The server stays "busy" answering attackers while legitimate requests wait forever in the queue. The textbook remedy is SYN cookies (the server stops allocating the slot until the handshake completes) — the point is that the flood attacks a finite resource: the connection table.
Sense-check: the attack succeeds because the server must spend a scarce resource (a table slot) on every incoming SYN, including fake ones; a legitimate user's request loses the race for the last free slot. Fewer resources, more requests, no room left — the math of the overload is exactly the old-processor analogy made concrete.
With a single machine, the target system or network becomes overloaded and cannot answer legitimate requests. But when many devices form a network together and bombard the system with huge traffic distributed geographically from different machines, that is where the biggest challenge sits. Today, DDoS attacks happen most commonly in cloud service environments, and their number is increasing day by day. DDoS can also happen at the application layer: the user interface of the end user — the functions and features of the website — are attacked and malfunction, so the whole application layer is disrupted.
Real-world: recall the advanced persistent threats (APTs) discussed earlier. The same persistence appears in denial of service as advanced persistent DoS (APDoS): the attack goes on for a longer period, sending terabytes or petabytes of malicious traffic — it can persist for more than a month. The attackers tactically switch between different targets to create diversions among the countermeasures you have implemented. If the attack comes from a single entry point, you can find it and implement mitigating controls; but when advanced persistent attacks arrive from several targets through different mechanisms, it becomes very tough for cybersecurity engineers to identify what is happening. This was noted as one of the latest trends — beyond DoS and DDoS there are N number of attacks in the current environment.
A simple example: a legitimate user sends a web request to a web server, while attackers bombard the server with a large number of requests, so the server becomes busy and may even return a busy response. With a bot master, a distributed computing environment formed from multiple sources acts as one network and attacks one server — that is the distributed case.
Real-world: this is one reason people hesitate to move to a public cloud provider. In a public cloud you get a tenant; in one server there are multiple tenants, each isolated, but the exposure is huge because of the cloud technology. The more exposure you provide and the more you align with the latest technology, the more attacks happen. That is where risk assessment comes in: check what existing controls can address the risks when exposing networks or servers to cloud-based technologies.
Scope — when DoS defenses work and when they fail: filtering and rate limiting assume you can tell attack traffic from legitimate traffic. This works for floods from a few spoofed sources or from known bad regions. It struggles when the attack is distributed across many innocent IPs (a large botnet), when it rides legitimate protocols (application-layer floods that look like normal HTTP), or when it persists for weeks (APDoS) — under those conditions, mitigation moves from "block the bad traffic" to "absorb and survive the flood," which is why DDoS-mitigation-as-a-service exists.
11.3.2 Flooding Techniques
Flooding can happen through a number of ways:
Four classic flooding techniques:
- Ping of death — continuously pinging the server. (Historically, a specific oversized ICMP packet that crashed vulnerable systems; the professor's usage emphasizes the flooding of a target with ping traffic.)
- ICMP flood — flooding with ICMP messages.
- Smurf attack — a misconfiguration at the network level allows packets to be sent to all the hosts via the broadcast network. Instead of sending to one machine, the network keeps broadcasting to all connected machines. The attacker sends a large number of IP packets — every IP packet has some size — with the source address faked to the address of the victim. All the networks that receive the broadcast respond to that spoofed source IP address because they received a request. If every machine in the network responds to this large number of packets, the targeted victim machine is flooded with traffic, the system becomes unavailable, and it is impacted by the attack.
- Ping flood — the ping utility exists to check whether a system is up and connected to the internet: you ping the IP address and see if it answers. If you continuously bombard the system with ping requests, the system becomes unavailable, and ultimately the bandwidth of the system gets impacted.
Worked example — the smurf attack, an amplification flood. The smurf attack is a reflection attack: the attacker sends a single request, but the network answers with many responses, all aimed at the victim. Setup: a network with hosts that accepts broadcast pings, and an attacker who forges the source IP of the victim.
- The attacker sends one ICMP echo request to the broadcast address of the target network — the source address is forged to be the victim's IP.
- Every one of the hosts on that network receives the broadcast ping and replies with an ICMP echo response to the (forged) source address — the victim.
- The victim receives responses for every 1 request the attacker sent. With hosts and 1,000 pings sent per second by the attacker, the victim absorbs response packets per second.
The amplification factor is — one request becomes responses. This is why a small attacker machine can take down a bigger victim: the misconfigured network does the heavy lifting. The defense is the configuration fix: block broadcast ping forwarding at the network edge so the broadcast cannot be abused as a multiplier.
Sense-check: the victim never sees the attacker's packets directly; it sees only the responses bouncing off the intermediary network — the flood is real (the victim is hit by the attacker's rate), which matches the definition of a DoS: legitimate use becomes impossible.
The ping flood variant works the same way at a smaller scale: the ping utility's legitimate job is checking connectivity — you ping the IP address and see if it answers — but used continuously, the same tool turns into a bandwidth exhaust. The system stays "up" but its network link is saturated, so legitimate traffic cannot get through.
11.3.3 Identifying DoS and DDoS Attacks
The identification strategies are common and fairly easy to spot:
- Unusual traffic patterns — a sudden surge in traffic volume. With continuous monitoring tools, you see the number of incoming and outgoing packets hitting the load balancers or gateways; a sudden surge is an indication of a DoS or DDoS attack.
- Unfamiliar source IP addresses — packets arriving from IP addresses from which there have been no requests in the last six months or a year. Modern XDR (extended detection and response) tools, similar to SIEM, use AI- or ML-based reasoning: within six months the XDR knows which geographical regions the frequent requests come from. If a request suddenly arrives from Nigeria, South Africa, or another location that never sent requests, the tool immediately triggers alerts to confirm whether the request is from a legitimate resource.
- Slow system performance — responses from the application get delayed. If the typical response was three seconds and now it is taking more than ten or fifteen seconds, or users who normally connect in one or two seconds cannot connect, these are all indications of a DoS or DDoS attack.
| Signal | What to watch | Likely meaning |
|---|---|---|
| Traffic surge | In/out packet count at load balancers and gateways | Flood in progress |
| Unfamiliar sources | Requests from regions/countries with no history | Botnet spread or spoofed sources |
| Latency climb | Response time jumps from ~3 s to 10–15 s; connection time from 1–2 s to failure | Resources saturated by the flood |
The common thread: everything points to the server being busier than it should be, with traffic coming from somewhere it should not be coming from. The "typical response was 3 seconds, now 10–15" threshold is the kind of concrete number the professor gave as a practical alarm level — baseline first, then deviations from baseline are the alarm.
11.3.4 Containing DoS and DDoS Attacks
Containment means the attack must not spread — you block it before it takes the service down:
Three containment strategies:
- Filtering — if you can filter the requests, you detect suspicious or anomalous traffic patterns and block them, including IP addresses coming from entirely different geographical locations.
- Rate limitation — limiting the number of incoming connections from a single source.
- DDoS mitigation as a service — many organizations that provide security services offer DDoS mitigation services that absorb and redirect the attack traffic elsewhere, so the production system is not impacted.
These are the recommended methods, not the only three — from the critical perspective there are more.
The logic behind each: filtering removes the traffic that should not be there (anomalous patterns, wrong geographies); rate limiting caps how much any single source can demand, so no one sender can monopolize the server; and mitigation-as-a-service moves the fight upstream — the service provider's giant network absorbs the flood and forwards only clean traffic to the production system. The last option is the practical answer to DDoS specifically: when the flood comes from thousands of machines, there is no "one source" to filter, so you need a bigger pipe that can swallow the whole attack.
11.3.5 Mitigating with XDR and API Controls
Mitigation measures include:
Four mitigation measures:
- Authentication measures — most communication today happens through APIs, with APIs talking to each other. Implementing the necessary security controls at the API level and authorizing API-based communications can limit these attacks.
- Keeping systems up to date with patches and maintaining backups of critical data, so that when systems go wrong, recovery from the backups is possible.
- Using the latest AI- or ML-based monitoring tools — artificial intelligence and machine learning capabilities in monitoring tools prevent or mitigate these attacks.
- Implementing XDR — extended detection and response. An XDR collects and ingests data from multiple sources: endpoints, cloud workloads, email traffic, network traffic, and VPC logs. All that data is fed into its process engine, which correlates the logs from endpoint level, network level, server level, load balancer level, and VPC logs level to find whether threats are happening because of abnormal activity at system, network, or endpoint level. With its AI and ML capabilities (or the rules configured in the XDR), it identifies whether an attack is trying to happen. The moment threats are identified, threat intelligence and the organization's threat hunters quickly analyze and troubleshoot what went wrong and what response is needed, so the impact on the organization is minimal. That is why it is called extended detection and response — not just detection, but response, so the attack cannot spread across the entire network.
The professor's XDR explanation is worth unpacking: correlation is the key word. A single log is nearly meaningless — one server log showing traffic, one load balancer log showing a spike, one VPC log showing a connection — but the same evidence viewed together tells the story. XDR's process engine is the correlation layer: it joins endpoint events with network events with email events, and when the joined picture shows abnormal activity, it alerts. And because it is detection and response, it does not stop at an alert — the tool can act, and threat hunters can be dispatched to confirm and contain, which is what keeps the impact minimal.
Real-world: most security service providers — MSPs, managed security service providers — offer XDR capabilities: CrowdStrike, SentinelOne, Trend Micro, and others. Microsoft's Microsoft Defender has XDR enabled; Cisco has its own; IBM's QRadar now comes with XDR capabilities. Any MNC company subscribing to services at a global level typically goes with XDR. With XDR in place, DDoS attacks, phishing, zero-day attacks, and APTs can all be defended more easily.
Recap: DoS denies service by overloading a server — the old-processor hang written large — and DDoS multiplies the flood with botnets. The SYN flood fills the connection table, the smurf attack amplifies one request into responses, identification watches traffic surge, unfamiliar sources, and latency, containment filters, rate-limits, or outsources to mitigation-as-a-service, and XDR ties the whole detection-and-response picture together with log correlation.
11.4 Session Hijacking and Man-in-the-Middle Attacks
11.4.1 How Session Hijacking Works
Hook: You log in to your internet banking, check your balance, and walk away from the laptop for a moment. When you come back, the attacker who captured your session cookie in the background is already inside the same session — browsing as you, authorized as you. Nothing was stolen at the door; the door itself (your live session) was taken over.
Session hijacking happens when a legitimate session established between a client and a server gets hijacked by an attacker. The scenario: a victim authenticates to the server, and the server returns a session cookie to the victim. The victim's browser executes a script and sends the session cookie to the attacker; the attacker injects a script; in this way the attacker hijacks the session that was active between the victim and the server.
The hijack can be done in a number of ways, starting with eavesdropping — capturing the user's traffic and stealing the cookies. Cookies are very important here: a cookie is how the server remembers a user, and it allows faster responses to the client's requests — but cookies carry a lot of security challenges, and that is what has resulted in many of these attacks. When an HTTP connection is established, an HTTP cookie is generated: a small piece of information that captures data about the user — the IP address and whatever information the developer has configured to be captured. Attackers take that information, use it to act on behalf of a legitimate user, and try to establish a session as if it were coming from a legitimate person: when a legitimate request comes from person A, the attacker hijacks the session with those cookie values and pretends the request is legitimate.
The professor's scenario contains the full attack chain in miniature. The victim completes authentication (proving identity once), and the server answers with a session cookie — a small token that says "this user already proved themselves, remember them." The browser then executes a script that leaks the cookie to the attacker, or the attacker simply captures it from the wire. From the server's point of view, the cookie is the identity: whoever presents the cookie is treated as the authenticated user. So the attacker does not need the victim's password at all — the cookie has replaced the password as the credential, and stealing it is enough to take over the session. This is why the professor's closing advice in this section emphasizes short-lived session IDs and encrypted connections: if the credential (cookie) is captured and stays valid for hours, the theft is catastrophic; if it expires in seconds, the theft becomes useless.
11.4.2 Cookies, Cookie Banners, and GDPR
Whenever you browse a website, the cookies capture some of your information, and that is why you see the pop-up asking whether you would like to accept or reject the cookies: the site is asking whether you are willing to share that information. There are different types of cookies — functional, mandatory, and optional cookies. Without user consent, outside organizations should not be able to capture cookie information — that is one of the GDPR requirements. To be in compliance, most organizations show a cookie banner that asks for consent. If you reject, the information is not captured; if you accept, another pop-up explains the categories: functional and mandatory cookies need to be stored on your machine for the website to work as intended, while optional cookies are up to you — allow them and they capture, or do not.
| Cookie type | Purpose | Can you refuse? |
|---|---|---|
| Mandatory / strictly necessary | Keep the site working (session handling, security, shopping cart) | No — without them the site breaks |
| Functional | Remember preferences, language, log-in state | Usually optional |
| Optional (marketing/analytics) | Track activity, profile the user, serve related ads | Yes — the banner's accept/reject choice mostly concerns these |
The consent banner is not a formality — it is GDPR compliance: the regulation requires that personal data (and cookie data is personal data) be collected only with the user's consent, and that the user be told what is being collected. The banner is the mechanism by which the site asks that consent, and the accept/reject choice is the user exercising control over whether the optional categories may capture their information.
Real-world: earlier sessions were established in plain text; people used to authenticate to websites and the information bearing the cookies would be captured by attackers, who then pretended to be legitimate users. The evolution that followed: cookies were replaced by tokens, and tokens by session IDs, whose lifetime is kept short — valid only until the connection is active, or for a few seconds, for example 5 to 10 or up to 50 seconds depending on the security requirement and regulatory needs. The moment the lifetime is over, the session is invalid even if somebody captured it.
11.4.3 Methods of Session Hijacking
The different methodologies for session hijacking include:
Three session hijacking methods:
- Eavesdropping / sniffing — capturing the network traffic that contains the cookie values.
- Side-jacking — using those captured values to ride an existing session.
- Session replay — taking a valid session token that was captured during transmission and replaying it later, whenever it is needed, to gain access.
The three methods form a natural sequence: first you must get the token (eavesdropping — a passive capture of traffic containing cookies or session tokens), then you use it in one of two ways — either immediately ride the victim's still-live session (side-jacking, "sidling up beside" the victim's connection) or store the captured token and present it later, when the attacker chooses (session replay). The distinction between side-jacking and replay is timing: side-jacking is same-time use of a live session; replay is delayed use of a captured token, which is exactly why short token lifetimes defeat replay — by the time the attacker replays it, the session ID has expired.
The OWASP project — the Open Web Application Security Project — documents application security vulnerabilities, including the different session hijacking methods, and a developer should write code to prevent them. That is also why session cookies moved to session IDs with short lifetimes: even if somebody captures the session, it becomes invalid once the lifetime expires.
11.4.4 Identifying Session Hijacking
Identification techniques:
Three identification techniques:
- Monitor the activity — unusual login attempts, particularly from unrecognized locations or from devices on which you have not previously logged into that system.
- See the account changes — unexpected modifications to account settings, such as a changed password or email address, which could indicate unauthorized access.
- Watch browsing performance — a sudden decline in browsing performance after a successful login attempt. Normally, after login succeeds there should be no activity at the browser level; if a third-party man in the middle takes over the active session, the performance symptoms appear.
The logic of each signal: an attacker using a hijacked session behaves differently from the real user — different IP/location/device (monitor the activity), attacker actions modify the account itself to lock out the owner (account changes), and the extra relay through the attacker degrades the connection (browsing performance). The third signal is subtle: after a successful login, the browser should be idle; if it suddenly slows, something extra — a man in the middle — may be sitting between the user and the server, adding latency to every request.
11.4.5 Preventing Session Hijacking
Recommendations:
Eight prevention measures:
- Terminate active sessions immediately and log out of all sessions on all accounts — one of the best methods.
- Change the compromised password when you find a password has been compromised.
- Use short-lived session IDs — restrict the lifetime to less time after the active connection; that minimizes the risk.
- Secure connections — HTTP is plain text communication between client and server; instead use HTTPS with SSL or TLS certificates for encrypted communication, so that even if somebody captures the traffic, it is encrypted and cannot be understood.
- Enable MFA — multi-factor authentication. This is why net banking, even after username and password, still requires an OTP to log in.
- Run antivirus or anti-malware as the regular control to protect devices.
- Never use public Wi-Fi networks — public Wi-Fi often has insecure configurations, and most of the data traveling through those access points (APs) travels in an insecure manner.
- Raise awareness through sessions — last but not least.
These eight map onto the attack chain: terminate sessions and change passwords (undo the damage), short-lived session IDs (make captured tokens expire), HTTPS (stop the eavesdropping step — encrypted traffic cannot be read for cookie values), MFA (add a second proof of identity so a stolen session is not enough), antivirus (stop the keylogger/script that harvests tokens), avoid public Wi-Fi (remove the easy capture point), and awareness (stop the user behavior that starts the chain). Each measure breaks one link; defense in depth means several at once.
Real-world: with the advancement from cookies to tokens to session IDs, and with encrypted communication by default, there are also regulatory drivers: it is an RBI requirement in the banking sector that all communications be over HTTPS with TLS certificates. Note that even TLS has had its own vulnerabilities — TLS 1.1 had vulnerabilities, so the move went to 1.2, which most companies use, and TLS 1.3 has also come into existence — so certificates must keep being updated. Certificates are digital certificates that validate the server, confirming that the request or response comes from a legitimate resource.
11.4.6 The Eight Man-in-the-Middle Attack Types
A man-in-the-middle (MITM) attack is one where the man acts in between the communicating parties. Eight common types were listed (there can be more — this is the high-level list):
The eight common MITM attack types:
- Email hijacking — hackers compromise the target's email account and gain access. That can happen through an attachment the user clicked, or through a keylogger installed on the machine that captures the passwords. Prevention: enabling MFA, and having proper security scanners in place.
- IP spoofing — changing the IP address; packets are sent with a faked source address.
- Session hijacking — stealing session IDs or session keys to gain unauthorized control over the victim's session.
- ARP cache poisoning — ARP is the Address Resolution Protocol. The entries of the ARP table are changed so that all devices in the network map the attacker's IP address as the default gateway; all requests then get redirected to the attacker's machine, and the attacker can see the traffic moving out of the network.
- Wi-Fi eavesdropping — exploiting an unsecured Wi-Fi network to intercept the communication happening between the connected devices and the network; the attacker listens to everything traveling to the Wi-Fi access point.
- DNS spoofing — the entries in the DNS table are changed so that all requests are redirected to malicious servers, where data can be stolen or malware delivered.
- SSL hijacking (SSL stripping) — downgrading an HTTPS connection to an insecure HTTP connection. HTTPS means the whole communication is encrypted; a plain HTTP connection is plain text, so the attacker can intercept the data.
- Stealing cookies — using cross-site scripting: an infected page (the phish) lures the user's device to execute a script that sends the cookie details to the attacker.
The eight types share one pattern: the attacker inserts themselves into the communication path. Sometimes the insertion is at the address layer (IP spoofing fakes the source; ARP cache poisoning rewrites the gateway mapping; DNS spoofing rewrites the name lookup), sometimes at the transport layer (session hijacking steals the token), sometimes at the application layer (email hijacking, cookie stealing, SSL stripping, Wi-Fi eavesdropping). In every case, one or both parties believe they are talking to the legitimate peer — the man in the middle is invisible precisely because he is the address they were told to use.
Worked example — email hijacking. An executive receives an email with a document attachment. Clicking it runs a malicious payload; separately (or in combination), a keylogger quietly installs on the machine and begins capturing keystrokes, including the passwords typed into the email login page.
- Step 1 — Compromise: the attachment's payload installs the keylogger (or the click itself gives the attacker a foothold on the account).
- Step 2 — Harvest: the keylogger records the email account password the next time the executive logs in, and the attacker now has the credentials.
- Step 3 — Take over: the attacker signs in from their own location, reads the mailbox, resets other accounts via the email's password-reset links, and sends messages as the executive.
The professor's prevention list is direct: MFA (even with the password, the attacker cannot pass the second factor such as an OTP) and proper security scanners (antivirus/EDR detects and removes the keylogger before it harvests anything).
Sense-check: the attack worked because one stolen secret (password) was enough to enter; MFA breaks the chain by requiring a second, separately-held proof — the classic reason banking logins insist on OTP even after the correct username and password.
Real-world: SSL itself is no longer in use — SSL versions suffered many attacks, including the POODLE attacks — so the world moved to TLS (transport layer security), versions 1.0, 1.1, 1.2, and 1.3. The suggestion was to study how exactly SSL stripping works — it is easy to say "downgrade HTTPS to HTTP," but understanding how the downgrade actually happens is the valuable part; the full SSL/TLS handshake process will get more meaningful insight once the syllabus is done.
Warning — the SSL to TLS story: SSL had its own fatal attacks — the POODLE attack exploited SSL's random padding in CBC-mode encryption, allowing a man in the middle to recover plaintext bytes one at a time, and there were others. That is why SSL is deprecated and why the industry moved to TLS, and within TLS the versions also advanced: TLS 1.1 had its own vulnerabilities, TLS 1.2 became the default most companies use, and TLS 1.3 is the current release. The lesson is continuous updating: a "secure protocol" is a moving target, and certificates must keep being updated along with it.
Identification of MITM attacks: monitor the browser, identify network issues, and — most important — check your site certificates: whether the security certificates are valid. That is why, when you browse a website with an expired certificate, you get a pop-up — the identity of the website is incorrect. Websites serving the public prove their identity by subscribing to a digital certificate, and whenever a user establishes a connection, the browser verifies the identity of the web server at the back end during the SSL handshake; the moment the certificate is confirmed expired or invalid, the connection is ended.
Containment methods: disconnect from untrusted networks, and close active sessions that you think have been compromised. Mitigation controls: software updates; avoid clicking unfamiliar links; use VPNs; always use websites that use HTTPS with valid TLS certificates — never go with a website that does not enable HTTPS.
Exam note: from the exam perspective, a scenario may be given — for example, an email hijack has happened, or IP spoofing — and the question will ask which attack this comes under and, as a cybersecurity expert, what your recommendations are to mitigate from this sort of attack. Expect to answer in that shape: what is the attack, why it happened, what are your recommendations. Also be ready to explain how the SSL stripping downgrade actually happens — the "downgrade HTTPS to HTTP" phrase is easy to say but the mechanism behind it is the valuable part.
11.4.7 Email Security: Phishing, Spear Phishing, SPF, DKIM, DMARC
Phishing means impersonating some person — typically by email — and creating a sense of urgency, so that the end user clicks links or attachments and viruses, worms, or other injections get in. Spear phishing is the same technique aimed at a specific group of individuals in the organization: for example the executive level — the CEO, the CFO, one level below the CFO — whose email addresses are available through social networking sites.
Why executives are the spear phishing target: Attackers target busy executives like the CEO and the CFO because they are more prone to clicking; executives are mostly from non-IT backgrounds, they are always busy, and they are more prone to these attacks. The ultimate job is to send an email that looks legitimate; when it is clicked, whatever they want to inject gets injected. The professor's point is a behavioral one: the target is chosen for probability of clicking, not for technical access — and the executives' email addresses are publicly available through social networking sites, making them easy to impersonate.
| Dimension | Phishing | Spear phishing |
|---|---|---|
| Target | Mass audience — thousands of random users | A specific person or group (e.g., CEO, CFO, finance team) |
| Crafting | Generic template, urgency, mass-sent | Researched: names, roles, context quoted to look real |
| Goal | Any clicks at scale | One successful click on a high-value target |
| Defensive edge | Spam filters and blacklists catch most | Harder to filter — the email looks individually plausible |
When to worry about which: spam filtering handles broad phishing; spear phishing is what threat intelligence, sender authentication (SPF/DKIM/DMARC), and user awareness exist to stop.
Mitigation of phishing and spear phishing:
- Scrutinize the sender's address — implement email gateway / email security gateway controls. The gateways continuously run their own spam rules; if a request comes from a domain that is blacklisted, it is blocked, and grammatical errors are also a sign of a phishing attempt.
- Administrative controls — do not be pressured into immediate action based on urgency; legitimate organizations typically do not threaten your account or demand immediate action. Avoid downloading attachments from unknown senders, especially when the attachment is unexpected. Before clicking a link, hover the mouse over it to see where it actually redirects — for example, in WhatsApp, an Amazon offer with a 30% discount that is not on an amazon URL is a phishing attack. Do not respond — report the phishing attempt to the IT department and delete the phishing email.
- Mitigation steps — education and awareness, enabling spam filters, and implementing email authentication: SPF, DKIM, and DMARC.
Worked example — spotting the WhatsApp "Amazon offer" phish. A message arrives on WhatsApp: "Amazon 30% discount today only — click here." The hover test (on both the WhatsApp message link and any email equivalent) shows the actual destination URL, e.g. http://amazon-offers-2023.ru/ instead of https://www.amazon.com/.
- The displayed text says Amazon; the actual URL points to a lookalike domain.
- The urgency ("today only," 30%) is the standard phishing pressure — act now, do not think.
- If clicked, the page may inject malware or capture the entered credentials.
Sense-check: the mismatch between what the link says and where it redirects is the giveaway; the professor's rule — hover before you click — converts a one-click infection into a visible discrepancy. The correct action is not to respond, but to report the attempt to the IT department and delete the message.
SPF — the Sender Policy Framework — is an email validation protocol. Domain owners publish SPF records: a list of the authorized email servers allowed to send email on their behalf, saying "these are my legitimate sender emails." When an email arrives, the receiver checks the record to see whether the sender's domain is an authorized source. If somebody uses spoofing tools to send email, the address the email was actually sent from differs from the domain name the email server is tagged with, and the spoof is caught — protecting one level of spoofing from the spam emails hitting the inbox. Example: for a domain like infosys.com, the SPF record lists the IP addresses authorized to send email for that domain; the SPF check should be cleared first, then further checks follow.
DKIM — DomainKeys Identified Mail — adds one more control: a digital signature binding the mail's identity. It is not only the domain name; the digital signature confirms that the email comes from a specific domain, and validates its authenticity and integrity. If somebody changes the message in between, there will be a DKIM failure — an indication that a spam email is being attempted. It works like the digital signature a sender uses as proof of a legitimate source: the DKIM signature authenticates that the mail came from a legitimate domain only, and it can detect emails sent from a fake domain created on behalf of a real one. These are multiple controls — defense in depth — against phishing and spear phishing.
DMARC — Domain-based Message Authentication, Reporting and Conformance — empowers domain owners to instruct email receivers on how to handle unauthenticated emails sent from their domain. It combines the capabilities of DKIM and SPF and adds reporting and a policy: when SPF has passed and DKIM has passed, the policy can approve the email and send it to the resource inbox; when things are not clear, the policy goes with either the reject option or the quarantine option, depending on how the email security expert has configured it.
Worked example — the admin@infosys.com fake. An attacker wants to send a phishing email that appears to come from Infosys. They forge the display name and address admin@infosys.com — but the email is actually transmitted from the attacker's mail server.
- SPF check: infosys.com has published its SPF record listing the IP addresses of its authorized email servers. The sending server's IP is not on that list, so the SPF check fails — the mail claims to come from infosys.com but was not sent by any server authorized by infosys.com.
- Result: because SPF failed, the email does not reach the inbox (with DMARC configured to reject or quarantine based on such failures).
Sense-check: the spoof is caught at the first gate — the address says infosys.com, but the sending server differs from the authorized list. This is exactly why SPF protects "one level of spoofing" — the domain layer — and why DKIM adds the message-level signature: defense in depth.
| Control | What it validates | Failure means |
|---|---|---|
| SPF | Sending server is authorized by the domain | Sender not in the domain's authorized list |
| DKIM | Digital signature on the message is valid | Message modified in transit or signed by a fake domain |
| DMARC | Domain policy on how to handle SPF/DKIM failures + reporting | Policy decides: deliver, quarantine, or reject |
Real-world: most email security tools work by enabling SPF, DKIM, and DMARC capabilities. The more controls you deploy, the fewer chances the organization has of being impacted by phishing attacks. A full discussion of SPF, DKIM, and DMARC would itself take one or two sessions; this was the high-level view.
Recap: Session hijacking steals the cookie (or token, or session ID) that stands in for the user's identity and takes over the live session; MITM attacks — from email hijacking and IP spoofing to ARP cache poisoning and SSL stripping — insert the attacker into the communication path; and email authentication (SPF → DKIM → DMARC) layers validation so that impersonated email is caught before it reaches the inbox.
11.5 SQL Injection
11.5.1 How SQL Injection Works
Hook: A login page asks for a username and password. Instead of typing a name, an attacker types a fragment of SQL — and the database treats it as code, not as data. A query meant to check one user's credentials suddenly says "let everyone in." The web application did exactly what it was programmed to do; it was the attacker's input that rewrote the meaning of the query.
SQL injection is an attack where the attacker identifies a vulnerable input field within an application — such as a login form or a search bar — and crafts a malicious SQL payload: a string of code designed to manipulate the database query. The attacker injects this payload into the vulnerable input field of the application. Wherever there is a login form without restrictions on input validation — where the user can provide input and enter SQL queries, with no validation checks — there are chances of SQL injection. The server executes the malicious code: the application unknowingly submits the user's input, including the attacker's payload, to the database server; the database server interprets and executes the code, potentially compromising the database.
To see why this works, recall what SQL (Structured Query Language) looks like. A relational database stores data in tables: each row is one entity (one user), each column is one attribute (username, password). A login check is a query that asks the database "is there a row whose username and password match what the user typed?" — written in SQL along the lines of:
The key detail is how the query is built: the application concatenates (glues) the user's typed input directly into the SQL string. Whatever the user types is treated as part of the query. If the user types jdoe and letmein, the query is exactly the innocent one above. But if the attacker types a payload instead of a normal value, the concatenated query changes meaning. The most famous payload for login forms is ' OR 1=1 -- :
The single quote closes the string the developer opened, OR 1=1 adds a condition that is always true, and -- starts a comment that swallows the rest of the query (the password check). The database now returns the first user row — or all rows — because the WHERE clause is satisfied for every row regardless of the password. The attacker is logged in without knowing any credentials. The reference text works the same attack with 'OR X=X' (X always equals X, so the condition is always true) — different letters, same tautology.
Worked example — login form injection with real input. The application's vulnerable query builder produces:
SELECT * FROM users WHERE username = '<input1>' AND password = '<input2>'
- Normal attempt: username
jdoe, passwordletmein→SELECT * FROM users WHERE username = 'jdoe' AND password = 'letmein'. The database finds the matching row; login succeeds only for the correct credentials. - Attack attempt: username
' OR 1=1 --and any password →SELECT * FROM users WHERE username = '' OR 1=1 --' AND password = 'x'. Because1=1is true for every row, the WHERE clause is a tautology — it evaluates to true for all users. The database returns the first (or every) row, and the application treats "a row came back" as "login succeeded."
Sense-check: the attacker changed only the data being sent to a field, but because that data was concatenated into the query as code, the database executed the payload as SQL. Input validation (rejecting quotes and SQL keywords) or parameterized queries (treating input as data, never as code) removes the vulnerability at the root.
The danger goes far beyond logging in. The same injection technique can be used to read other tables (dumping customer records or password hashes), modify data, delete rows, or even execute stored procedures — anything the database user account is allowed to do. In one well-known incident, a single SQL injection was responsible for 94,057 attack requests against a site in a single day, which shows how automated the scanning for this vulnerability has become.
11.5.2 Identifying SQL Injection
Identification approaches:
Three identification approaches:
- Be alert for unusual error messages displayed by the application after submitting user input. These errors might reveal details of the attacker's attempt on the database schema. Errors should always be generic in nature — they should not display more information about what database is in use, or its version.
- Analyze the behavior — the application exhibits unexpected behavior after processing such input, such as generating nonsensical output or failing to perform the expected output — that can also be a sign of SQL injection.
- Web traffic analysis — security professionals use advanced techniques on web traffic to identify suspicious database queries that could contain malicious payloads. In an IP packet you have the source IP address, the destination address, and the actual payload; if a malicious payload is being injected into the payload section, web traffic monitoring can identify these attacks.
Professor's warning — error messages must stay generic. A verbose error such as "You have an error in your SQL syntax... near '1=1' in MySQL version 8.0" tells the attacker exactly which database and version is in use, which makes the next, more precise payload easier to craft. Errors that reveal database details also teach the attacker about the schema — table names, column names — which is precisely the information an injection attacker needs to refine the attack. Generic errors ("Invalid credentials," "Unexpected input") give nothing away. The guideline: error messages should never display what database is in use, or its version.
The behavior signal covers cases where no error is visible: the page returns rows it should not (a search bar suddenly returns the entire table), or the application behaves nonsensically. Traffic analysis looks at the payload section of IP packets — the same place where a malicious SQL payload would be riding — so monitoring that section can catch injection attempts in transit.
11.5.3 Containing and Mitigating SQL Injection
Containment steps:
Containment steps:
- Input validation and sanitization checks — ensure users adhere to the expected formats, and remove harmful characters — such as the SQL queries that could bypass authentication and reach out to the database.
- Restrict the user input — limit the type and amount of data users can input into forms and search bars, so the attack surface for SQL injection attempts is minimal.
- Disable unnecessary features — features not needed for the back function to work as usual can be disabled to limit SQL injection attacks.
Mitigation controls:
Mitigation controls:
- Parameterized queries — the important mitigation: use queries with placeholders for the user input, instead of directly putting user input into the SQL statement. This prevents the database from interpreting the user input as code.
- Software updates — make sure SQL injection vulnerabilities in the software applications have been addressed.
- Web application security testing — continuously perform testing both internally and externally, so loopholes in the servers can be identified.
The parameterized query deserves the "important" label the professor gave it, because it is the only control that removes the root cause. Compare the two styles of query construction:
-- Unsafe: input is concatenated into the SQL string as code
SELECT * FROM users WHERE username = '<user input>' AND password = '<user input>'
-- Safe: placeholders (?) stand for the values, input is sent separately as data
SELECT * FROM users WHERE username = ? AND password = ?
With the safe form, the database server knows the query structure in advance — username = ? AND password = ? — and the user's input is bound to the placeholders purely as data. Even a payload like ' OR 1=1 -- is treated as a literal value to compare against the username column, not as SQL to execute; the query returns no rows and the attack fails. This is the definitive fix; input validation (removing quotes, percent signs, equals signs) reduces the risk but is bypassable, which is why the professor's ordering — parameterized queries first — matches industry practice.
| Control | What it prevents | Strength |
|---|---|---|
| Parameterized queries | The injection mechanism itself (input never becomes code) | Strongest — fixes the root cause |
| Input validation / sanitization | Most common payloads (quotes, SQL keywords) | Good — bypassable by clever payloads |
| Restricting input length/type | Long, complex payloads | Supportive — shrinks the attack surface |
| Disabling unused features | Injection via unused query entry points | Supportive |
| Security testing | Deployment of new/remaining vulnerabilities | Detective — finds loopholes before attackers do |
Recap: SQL injection rewrites a database query by feeding SQL payloads through unvalidated input fields — the classic ' OR 1=1 -- bypass turns a login check into an always-true condition. Identify it through non-generic errors, odd behavior, and payload inspection; contain it with validation, input restriction, and disabled features; and mitigate it first and foremost with parameterized queries, patching, and continuous security testing.
11.6 Zero-Day Attacks
11.6.1 What a Zero-Day Exploit Is
Hook: Software is released believing it is secure — yet some flaws survive in the code for years before anyone notices. A zero-day attack uses a vulnerability that even the vendor does not know about: there have been zero days of warning to prepare, which is exactly why the name says "zero-day."
A zero-day attack uses a vulnerability in software that is unknown to the vendor. Because the vulnerability has not yet been fixed — and may not even be known — the attacker exploits the code, takes advantage of the vulnerability, and launches an attack against the systems that are vulnerable to the exploit, potentially compromising those systems. Once the zero-day exploit is known, most vendors develop a patch and distribute it to their users.
Why is a zero-day so dangerous? Compare the defenses available against a known vulnerability with those available against a zero-day. For a known vulnerability, the vendor ships a patch, antivirus and IDS signatures can be written, and security teams can hunt for the attack pattern. Against a zero-day, none of those signatures or patches exist yet: the vulnerability is unknown to the vendor, so there is no patch; it is unknown to the security community, so there are no detection signatures; and the attacker has had unlimited time to build a reliable exploit. The victim's only protections are the general-purpose controls that do not depend on knowing the specific flaw — monitoring for unusual behavior, restricting what software can run, and containing any anomaly quickly.
A useful way to see the concept is to track a vulnerability's life cycle:
- Discovery by the attacker — the attacker finds the flaw first. From this moment until disclosure, they hold a monopoly on exploiting it: the "zero-day window."
- Exploitation — the attacker uses the flaw against vulnerable systems (weeks, months, or years can pass while the vendor remains unaware).
- Disclosure — the exploit becomes known, often because the attack was observed or the flaw was independently discovered.
- Patch and distribution — the vendor develops a patch and distributes it to users, closing the window.
The "zero" in zero-day counts the days between disclosure and the vendor's fix: an exploit used on the same day the flaw is disclosed is a zero-day exploit. The practical message: because you cannot know which software will be hit next, the defense cannot wait for the patch — it must be ready for the unknown.
11.6.2 Identifying, Containing, and Mitigating Zero-Day Attacks
The identify–contain–mitigate playbook for zero-day attacks:
- Identification: monitor the system behavior, analyze network traffic, and review security software alerts.
- Containment: isolate the affected systems, disable unnecessary services, and change user credentials.
- Mitigation: use IDS and IPS (intrusion detection and prevention systems), application allowlisting, patch management, threat intelligence, and deploy web application firewalls — WAFs are one of the latest techniques used against zero-day exploit attacks.
Since there are no signatures to match, identification leans on behavioral observation: systems acting unusually, traffic flows that do not fit the baseline, alerts from security software that watches what programs do rather than what they are named. Containment then bounds the damage — isolated systems cannot carry the attack onward, disabled services remove unneeded entry points, and changed credentials cut off anything the attacker may have learned. Mitigation layers general-purpose defenses:
- IDS/IPS — intrusion detection and prevention systems watch network traffic and host activity; an IPS can drop suspicious traffic automatically, even for attack patterns it has never seen, if the traffic violates expected behavior.
- Application allowlisting — only pre-approved programs are allowed to run; even a novel exploit that drops a new executable cannot execute it. (Contrast with blocklisting, which only stops known-bad programs.)
- Patch management — the discipline of applying vendor patches quickly once they exist; for zero-days, the value is in speed — the shorter the gap between patch release and installation, the smaller the window the exploit can use.
- Threat intelligence — information about emerging exploits and attacker tooling that lets a team prepare before an attack reaches them.
- WAF — web application firewalls sit in front of web applications, filtering malicious requests; the professor noted WAFs are one of the latest techniques used against zero-day exploit attacks, because a WAF enforcing application-layer rules can stop a novel exploit's traffic even without a signature for that specific flaw.
Pitfalls in zero-day defense:
- Waiting for the signature. By the time a signature exists, the flaw is no longer zero-day — and your systems were exposed during the whole gap. Behavioral monitoring, allowlisting, and WAFs are the controls that work before signatures exist.
- Relying on a single control. A WAF stops web-layer exploits but does nothing for a client-side zero-day; allowlisting stops new executables but not exploits that run inside allowed software. The professor's list is a stack, not a menu — use several layers together.
- Neglecting containment speed. A zero-day exploit can be crafted with no warning; the identification must be fast, but the containment (isolate, disable, change credentials) must be faster — the blast radius depends on it.
Recap: A zero-day exploit targets a vulnerability unknown to the vendor — zero days of warning, no patch, no signature. Identify it behaviorally, contain it fast, and mitigate with IDS/IPS, allowlisting, patch management, threat intelligence, and WAFs; once the vendor ships a patch, apply it quickly because the window between disclosure and patching is the exploit's remaining window.
11.7 DNS Tunneling
11.7.1 How DNS Tunneling Works
Hook: Every computer on a corporate network is allowed to ask the DNS server "what is the IP address of google.com?" — that is how the internet works. Now imagine the attacker hiding a secret data channel inside those innocent-looking questions. Firewalls let DNS traffic pass in and out freely, and the attacker uses that freedom to build an invisible tunnel.
DNS is the Domain Name System — the service that resolves a name like google.com or facebook.com into its corresponding IP address, after which the request goes to the corresponding server and the response comes back. Tunneling means establishing a dedicated link. In DNS tunneling, the attacker crafts DNS requests that contain malicious data encoded within, seemingly coming from legitimate domain names or subdomains. Compromised, attacker-controlled DNS servers receive the tunnel data with the DNS request; the malicious DNS server extracts the hidden data and forwards it to the attacker. This allows the attacker to establish a covert command channel for malicious purposes.
The mechanism in detail: the attacker routes the DNS requests to the attacker's server. When you browse google.com, the request should go to the DNS server, which finds the IP address, and the request should continue to the actual Google server and get a response. In the attack, the DNS requests are routed to the attacker's servers instead, and a covert tunnel is established: the requests travel through the tunnel to the attacker, and whatever the attacker wants to change gets changed — malware can be added, or anything else. DNS traffic is allowed through the firewalls, so the tunnel is not directed by them; once established, the attacker passes a payload from the victim machine inside the corporate network to an internal hosted server controlled by the attacker. The result is a covert, invisible, secret communication channel for malicious purposes.
The full attack flow:
Worked example — the complete DNS tunneling attack flow. Walk through the attack with a concrete domain: the attacker registers badsec-data.com and points its nameserver at a server they control, where the tunneling server program runs.
- Register the domain. The attacker registers
badsec-data.com; the domain name server for it points to the attacker's server, where the malware and the tunneling program are installed. - Infect a computer behind the firewall. A machine inside the corporate network is infected with malware (via phishing, an attachment, or another exploit).
- Send the DNS query. Because DNS requests move in and out of the firewall freely, the infected computer sends a query to its DNS resolver — the server that relays the request and finds the IP address. The query asks for something like
exfil-data.badsec-data.com, where the stolen data is packed into the subdomain label of the name itself. - Route to the attacker's server. The resolver relays the query to the attacker's command server (since that is where
badsec-data.compoints), where the tunneling program is installed. The query is answered, and the attacker reads the hidden data out of the label. - Use the tunnel. A connection is now established between the victim and the attacker through the DNS resolver. Using that tunnel, the attacker exfiltrates data (credentials, files, documents) and can push commands or malware back through DNS responses for other malicious purposes.
Sense-check: at no point is there a direct connection between the attacker and the victim — the traffic simply looks like ordinary DNS lookups, which is exactly why it slips through firewalls and is so difficult to trace.
Why tracing fails: there is no direct connection between the attacker and the victim, which is exactly why it is so difficult to trace the attacker's computer. A normal connection shows two endpoints; here, the visible endpoint pairs are victim→resolver and resolver→attacker-controlled DNS server, and the two segments look like two unrelated, legitimate DNS conversations. The attacker's machine never appears as a peer of the victim's, so the forensic trail dead-ends at the DNS service.
The covert channel works because DNS is an allowed, ubiquitous protocol: every device must resolve names, so the firewall cannot simply block DNS without breaking internet access. The attacker exploits that trust by encoding data into the parts of DNS messages that are normally variable — most often the subdomain label of the queried name (data hides in the text before the registered domain) and the response records. To a monitoring tool that only checks "is this a valid DNS query?", each packet looks routine; to the attacker, the labels are a data pipe.
11.7.2 Identifying DNS Tunneling
Identification signals:
Three identification signals:
- Unusual DNS traffic patterns — a sudden increase in DNS traffic volume, especially toward unfamiliar or unexpected domains; a sudden increase in the number of requests for one domain can indicate that a tunneling link to the attacker's DNS server has been established.
- Analyze the domains — trace the domain names involved in the DNS requests; suspicious domain names with nonsensical characters or an excessive use of underscores are a sign of DNS tunneling.
- Query latency — an increase in query latency — the amount of time a request takes to get a response from the DNS server — may indicate that the attacker is slowing or overloading the servers to mask the true nature of the traffic.
Each signal exploits a telltale of tunneling: real users resolve many different domains a few times each, so a flood of queries to one domain is abnormal; real domains have readable names, so names full of random characters or underscores (which are legal in DNS labels but rare in normal use) stand out; and a resolver handling thousands of tunnel queries is slower and more loaded than one handling ordinary traffic. The professor's first signal also notes the traffic volume side: exfiltrating meaningful amounts of data through DNS requires many queries, so the volume itself gives the attacker away.
11.7.3 Mitigating DNS Tunneling
Mitigation controls:
Mitigation controls:
- Isolate the systems and block the domains — configure the DNS server or the firewall to block access to the unknown malicious domains associated with the DNS tunneling attacks.
- Use DNSSEC — the DNS security extensions. Enabling DNSSEC enhances the authentication and integrity of DNS responses, making it more difficult for attackers to exploit DNS vulnerabilities for tunneling. If the infrastructure supports DNSSEC, consider enabling it.
- Change the servers as a temporary measure — switching to an alternative DNS server can potentially disrupt the attempts; the moment you know the DNS server has been impacted, go with the backup server. This approach should be combined with other mitigation.
- Implement DNS filtering — DNS filtering solutions analyze DNS traffic for malicious patterns and block suspicious domains associated with the attacks.
- Monitor user behavior and keep systems up to date.
Best practices to prevent DNS tunneling: block domains based on their reputation; create stringent rules restricting the size and type of inbound and outbound queries; and harden the client OS.
| Control | What it breaks in the attack |
|---|---|
| Block malicious domains | Severs the tunnel destination — queries to the attacker's domain never leave the network |
| DNSSEC | Validates DNS responses (authentication + integrity), so tampered or spoofed answers are rejected |
| Switch to backup DNS servers | Disrupts an active tunnel while the impacted server is replaced |
| DNS filtering | Catches the malicious patterns and blocks suspicious domains automatically |
| Restrict query size/type | A tunnel needs large, unusual labels — size and type limits choke the data pipe |
| Harden the client OS | Stops the malware itself from running and sending the queries |
Pitfalls in DNS tunneling defense:
- Blocking all DNS. The tunnel rides DNS because DNS must be allowed — blocking it outright breaks legitimate internet use. Controls must filter specific domains and patterns, not the protocol.
- Treating server switching as a fix. Changing to a backup DNS server disrupts an active tunnel temporarily, but the malware on the victim machine will simply query through the new server — the professor's guidance is explicit that this must be combined with other mitigation.
- Ignoring the outbound direction. Tunnels both exfiltrate data out and push commands in; monitoring only inbound traffic misses the exfiltration half of the channel.
Recap: DNS tunneling hides a covert channel inside ordinary DNS queries — data packed into domain labels, routed to attacker-controlled DNS servers through the firewalls that must let DNS pass. Spot it by abnormal per-domain volume, nonsensical names, and latency; stop it by blocking the domains, DNSSEC, DNS filtering, query restrictions, and hardened clients — remembering the tunnel always runs two ways.
11.8 Additional Malware Types (Knowledge Background)
11.8.1 Fileless Malware
Hook: Antivirus software scans for files — so what does malware do when it wants to avoid being a file? It stops installing files and instead edits the operating system's own trusted tools. The scanner keeps looking for a suspicious file and finds nothing, because there is nothing new to find.
Fileless malware does not install anything initially. Instead, it makes changes to files that are native to the operating system — such as PowerShell or WMI. Because the OS recognizes the editing of its own files as legitimate, a fileless attack is not caught by antivirus software. Because these attacks are stealthy, they are up to 10 times more successful than traditional malware attacks. There is no new file getting installed — that is why it is called fileless — but the malware edits OS-level files and PowerShell files and stays undetected by antivirus.
The mechanism: instead of dropping a malicious .exe, the attacker abuses tools the operating system already trusts and ships with. PowerShell is a scripting and automation environment built into Windows; WMI (Windows Management Instrumentation) is the Windows management framework. When malware executes commands through PowerShell or alters WMI objects, the operating system sees its own legitimate components running — which is exactly what antivirus expects to see. The malicious activity lives in memory and inside trusted tooling, not in a new file, so the scanner's "look for new suspicious files" model finds nothing. The professor's statistic — up to 10 times more successful than traditional malware — reflects this advantage: traditional malware gets caught by signatures once its file is known; fileless malware leaves little for a signature to match.
Real-world example — the Asteroid campaign (the name as used in the session):
Worked example — the Asteroid fileless campaign. The professor described a fileless campaign that worked in stages:
- The lure. Users were spammed with links to a
.lnkshortcut file. (A.lnkfile is a Windows shortcut — a small file that points to something else to run, a classic disguise because users and scanners treat shortcuts as harmless.) - The launch. When the user downloaded and opened it, a tool was launched along with a number of Windows tools. These downloaded more code that was executed only in memory — leaving no evidence for the scanners to detect. Nothing was written to disk as a suspicious program; the code ran in RAM and vanished when the process ended.
- The payoff. Then the attacker downloaded and ran a trojan that stole the entire credentials and uploaded them to a remote server.
Sense-check: each stage hid inside trusted Windows behavior — a shortcut, Windows tools, memory-only execution — so file-scanning antivirus saw no new file to flag. The credential theft that followed is the actual objective; the fileless steps were the stealth transport.
Why fileless malware defeats traditional defenses: the OS recognizes the editing of its own files as legitimate, and antivirus is built around scanning files. The defense must therefore mirror the attack: monitor behavior (what PowerShell actually runs, what WMI is changed, which processes spawn which others) rather than scanning for new files — which is precisely the EDR capability discussed in the ransomware section.
11.8.2 Spyware, Adware, Trojans, Viruses, and Worms
- Spyware — spyware is about collecting information about the user's activity without their knowledge or consent. It is not limited to the desktop; it can also operate in a critical app or on a mobile phone. Where cookies are passive files with limited reach, spyware is active code that can read the registry, capture keystrokes, and watch browsing — anything a program can do.
- Adware — its main activity is to see what you are doing and, based on that, populate related ads. The danger is mainly from the privacy perspective: the data captured by adware is correlated with the data captured — overtly or covertly — about user activity on the internet, and the tool profiles the person — interests, friends, and so on — to show only related ads. Adware is often bundled with another program, quietly installed as part of a free download.
- Trojan — a trojan is a program that masquerades as something desirable; once downloaded, whatever information is happening in the machine — all the credentials — is passed on to the receiver. Trojans gain access in several ways: through backdoors, through built-in software, through unintentional software, or through flash drives. Once in place, trojans can be used by malicious actors to launch attacks or conduct ransomware attacks.
- Virus — the overall job of a virus is to damage software or system files.
- Worm — a worm self-propagates over the network, spreading on its own.
| Malware | What it does | How it spreads |
|---|---|---|
| Spyware | Collects activity data without consent | Bundling, drive-by downloads, fake tools |
| Adware | Profiles the user to show related ads | Bundled with free software |
| Trojan | Masquerades as desirable, then exfiltrates credentials | Clicked downloads, backdoors, flash drives |
| Virus | Damages software or system files | Requires a host file / user action to run |
| Worm | Self-propagates over the network | Network alone — no user action needed |
The Trojan takes its name from the wooden horse of Troy: it looks like a gift and carries an army inside. The professor's spread list (backdoors, built-in software, unintentional software, flash drives) shows the trojan's defining trait — the victim invites it in by running something that seemed useful. The worm is the opposite extreme: it needs no invitation at all, which is why the WannaCry ransomware of 2017, which combined worm-like self-propagation with encryption, spread so fast.
11.8.3 Rootkits, Keyloggers, Botnets, and Wiper Malware
- Rootkit — a rootkit gives the malicious actor remote control of the victim's computer with full administrative privileges. It is injected at the kernel level or hypervisor level, and spreads through attachments, malicious downloads, and shared drives. Because it operates at the deepest levels of the system, it can hide its own files and processes from ordinary inspection — the classic rootkit modifies the very tools an administrator would use to find it.
- Keylogger — a keylogger can be software or hardware. It logs the keys you type, and those keystrokes are sent remotely — so it is exactly what it sounds like: logging the keys. A software keylogger runs on the machine; a hardware keylogger sits between the keyboard and the computer (e.g., a small device on the USB port) and captures every keystroke regardless of what software is installed. The professor's point about remote delivery is the danger: the log of typed passwords, account numbers, and messages is transmitted to the attacker, not stored locally where the victim could find it.
- Botnet — bots are applications that perform tasks and commands; they are used for legitimate purposes such as indexing search engines. When used for malicious purposes, they take the form of self-propagating malware that connects back to a centralized server — those are the bots or botnets discussed in the DoS context as zombie agents. A compromised machine (the bot, or zombie) connects to a command-and-control server; thousands of bots together form a botnet whose combined power the controller can direct — flooding a target in a DDoS attack, sending spam, or spreading new malware.
- Wiper malware — wipe means to erase the data and ensure it cannot be recovered — that is the main functionality of this malware. Wipers are used to take down the networks in publicly operated companies across various sectors, and they are used to wipe away the traces left after an intrusion — covering up the traces weakens the organization's ability to respond, and the traces stay undetected.
| Malware | Primary objective | Defining trait |
|---|---|---|
| Rootkit | Hidden remote control with admin privileges | Lives at kernel/hypervisor level, hides itself |
| Keylogger | Capture keystrokes, send them remotely | Software or hardware; logs keys as they are typed |
| Botnet | Coordinated remote control of many machines | Many zombies connecting to one command server |
| Wiper | Erase data permanently | Data cannot be recovered; also erases forensic traces |
One student asked to see the list:
Q: Could you please share the list of the different types of malware you are talking about?
A: This list is out of the syllabus, but it was shared for knowledge. The different types covered — fileless malware, spyware, adware, trojans, viruses, worms, rootkits, keyloggers, botnets, and wiper malware — are background understanding, not exam material. The quiz covers chapters 4, 5, and 7.
Wrapping up: the attacks covered in this chapter were session hijacking, phishing and spear phishing, zero-day, DNS tunneling, SQL injection, denial of service and distributed denial of service — with the identification, containment, and mitigation strategies for each, plus email security through SPF, DKIM, and DMARC. The next session continues with strategic defense methods and defense in depth controls. Chapters 6 and 8 remain to be covered, and they are mostly critical reading; chapter 5 and chapter 7 are the more technical ones.
Recap: This section is knowledge background, not exam material — fileless malware hides inside PowerShell and WMI (up to 10× more successful than traditional malware), spyware and adware collect and profile user data, trojans masquerade as desirable programs, viruses damage files, worms self-propagate, rootkits hide at kernel level, keyloggers capture keystrokes, botnets coordinate zombie agents, and wipers erase data beyond recovery.
Exam Guidance Summary
- Quiz two syllabus: chapters 4, 5, and 7. (Quiz one covered chapters 1 to 3.) Chapter 5 and chapter 7 are the technically important chapters; chapters 6 and 8 are mostly critical reading, with nothing specific to explain, and can be covered quickly.
- Ransomware (exam note): this is in the syllabus. Expect the question on what ransomware is, and what preventive and detective controls you can implement so that the impact can be minimized.
- Backup scenario questions (exam note): expect scenario-based questions in the main examination — a scenario where the primary system was infected and even the backup systems got infected. Be ready to answer what went wrong, and which technical controls would have been implemented so the virus, malware, or ransomware never spreads to the backup systems. The assignment scenario is an example; the exam scenario will be similar in method, not the same.
- Man-in-the-middle scenario questions (exam note): a scenario may be given — for example, an email hijack has happened, or IP spoofing — and you will be asked which attack this comes under, and, as a cybersecurity expert, what your recommendations are to mitigate this sort of attack. Answer in that shape: what the attack is, why it happened, and the recommendations.
- SSL stripping (study advice): it is easy to say "downgrade HTTPS to HTTP," but try to understand how exactly the SSL stripping downgrade happens — it is one of the most important things to grasp. Deeper insight into the SSL/TLS handshake will come after the syllabus is done; browse to see how SSL stripping occurs when time permits.
- Email authentication (study advice): SPF, DKIM, and DMARC were covered at a high level; a full discussion of SPF and DKIM would itself take one or two sessions.
- More malware types: fileless malware, spyware, adware, trojans, viruses, worms, rootkits, keyloggers, botnets, and wiper malware were covered for knowledge perspective only — not from the exam perspective.
Key Industry Applications
- EDR and XDR in practice: endpoint detection and response and extended detection and response have replaced traditional antivirus in most companies. Managed security service providers (MSPs) offering XDR capabilities include CrowdStrike, SentinelOne, Trend Micro, and others; Microsoft Defender has XDR enabled, Cisco has its own, and IBM QRadar now comes with XDR capabilities. XDR correlates logs from endpoints, network, servers, load balancers, and VPC logs, and defends against DDoS, phishing, zero-day attacks, and APTs.
- Zero trust networking: vendors such as JetScale provide zero trust network models — never trust, but verify — where identity, device compliance, and location are checked before access is granted to the corporate network or shared drives.
- Cloud services and risk: organizations weigh regulatory requirements, risk, and cost before adopting AWS, GCP, or Microsoft Azure, or a private cloud provider for highly regulated environments; public cloud exposure is one reason DDoS risk assessment matters.
- DDoS mitigation as a service: security service providers absorb and redirect attack traffic so production systems stay available.
- Email security stack: SPF, DKIM, and DMARC are enabled by most email security tools to authenticate senders and block phishing and spear phishing; email security gateways run spam rules and blacklist checks.
- Regulatory drivers: GDPR drives cookie banners and consent; the RBI mandates HTTPS with TLS certificates for banking communications; HIPAA mandates security training; SOC 1 and SOC 2 audits mandate annual awareness training.
- Web application defenses: parameterized queries, web application firewalls (WAFs), IDS/IPS, and continuous web application security testing are the industry techniques for SQL injection and zero-day attacks.
- DNS security: DNSSEC and DNS filtering solutions analyze DNS traffic, block suspicious domains, and protect DNS response authenticity and integrity.
- Real-world phishing example: the WhatsApp "Amazon offer" message promising a 30% discount is a phishing lure — hovering over the link shows the URL is not an amazon URL.
CS Lecture 11 notes · Cyber Attacks
Sections Breakdown
The six-phase incident response lifecycle - preparation, detection, containment, eradication, recovery, post-incident activity - and why detection speed is the lever that controls damage.
Ransomware weaponizes encryption: the attacker encrypts the victim's files and demands cryptocurrency for the key. Defense spans EDR behavior monitoring, containment, zero trust, patching, and awareness.
DoS attacks overload a server so legitimate users cannot reach it; DDoS multiplies the flood with botnets. Covers SYN floods, smurf amplification, identification signals, containment, and XDR mitigation.
Session hijacking steals the cookie, token, or short-lived session ID that stands in for the user; the eight MITM types insert the attacker into the communication path, and SPF, DKIM, and DMARC authenticate email.
SQL injection rewrites database queries by feeding SQL payloads through unvalidated input fields; the definitive mitigation is parameterized queries, with generic error messages and security testing as support.
A zero-day exploit uses a vulnerability unknown to the vendor - no patch and no signature exist; defense is behavioral identification, fast containment, and layered mitigation with IDS/IPS, allowlisting, and WAFs.
DNS tunneling hides a covert channel inside ordinary DNS queries, packing data into domain labels routed to attacker-controlled servers; identify by volume and latency, mitigate with DNSSEC and DNS filtering.
Knowledge-background malware types: fileless malware hides inside PowerShell and WMI, plus spyware, adware, trojans, viruses, worms, rootkits, keyloggers, botnets, and wipers - shared for knowledge, not exam material.
Quiz two covers chapters 4, 5, and 7; ransomware and backup-scenario questions, man-in-the-middle scenario questions, and SSL stripping are the stated exam priorities.
EDR and XDR replace antivirus in industry, zero trust networking, DDoS mitigation as a service, the SPF/DKIM/DMARC email stack, WAFs, DNSSEC, and regulatory drivers such as GDPR, RBI, HIPAA, and SOC audits.
Exam Revision Notes
Below is the distilled, exam-ready core. Every entry comes from the full explanation above. Use this section for rapid review; return to the main notes when a point needs more context.
Incident Response Lifecycle Recap
Must-know: Detection speed is the lever that controls damage; the six lifecycle phases form a loop: preparation, detection, containment, eradication, recovery, post-incident activity.
⚠️ Top pitfall: Treating preparation as optional paperwork, slowing down after detection, skipping post-incident activity, and confusing containment with eradication.
Self-check: Which phase decides how much time the organization has to react?
Connects to: Ransomware
Ransomware
Must-know: Ransomware follows a three-step pattern (gain access, encrypt files, display ransom note demanding cryptocurrency); preventive and detective controls include patching, EDR behavior monitoring, zero trust (never trust, but verify), verified backups, and awareness training.
⚠️ Top pitfall: Waiting for the ransom note (the last signal), trusting antivirus signatures alone, and believing unverified backups will save you.
Self-check: What is the professor's phrase to remember about zero trust?
Connects to: Incident Response Lifecycle Recap, Denial of Service and Distributed Denial of Service
Denial of Service and Distributed Denial of Service
Must-know: DoS denies service by overload; DDoS distributes the flood across botnets. The SYN flood fills the server's finite connection table; the smurf attack amplifies one request into N responses via broadcast networks. Identify via traffic surge, unfamiliar source IPs, and latency; contain via filtering, rate limiting, and mitigation-as-a-service.
⚠️ Top pitfall: Filtering individual sources against a DDoS (blocking one IP is useless when the flood comes from thousands), and believing blocking one protocol ends an APDoS.
Self-check: Why does a smurf attack amplify: one request becomes how many responses, and what is the amplification factor?
Connects to: Incident Response Lifecycle Recap, Ransomware
Session Hijacking and Man-in-the-Middle Attacks
Must-know: Session hijacking steals the session credential (cookie to token to short-lived session ID); the eight MITM types insert the attacker between communicating parties; prevention uses short-lived session IDs, HTTPS/TLS, MFA, and session termination; SPF validates the sending server, DKIM adds a digital signature, DMARC sets the delivery policy.
⚠️ Top pitfall: Assuming a stolen credential alone is enough (MFA blocks it); forgetting that public Wi-Fi and plain HTTP expose cookies; treating 'downgrade HTTPS to HTTP' as a complete explanation of SSL stripping.
Self-check: Why does the fake email from admin@infosys.com fail the SPF check?
Connects to: Ransomware, Additional Malware Types (Knowledge Background)
SQL Injection
Must-know: SQL injection rewrites a query by injecting payloads like ' OR 1=1 -- into input fields; the definitive mitigation is parameterized queries (placeholders bind input as data, never code); error messages must stay generic and never reveal the database or version.
⚠️ Top pitfall: Verbose error messages revealing the database and version; treating input validation (which is bypassable) as a substitute for parameterized queries.
Self-check: Why does the payload ' OR 1=1 -- log an attacker in without credentials?
Connects to: Zero-Day Attacks
Zero-Day Attacks
Must-know: A zero-day exploit targets a vulnerability the vendor does not know about; identification must be behavioral (no signatures exist), containment isolates affected systems and changes credentials, and mitigation layers IDS/IPS, allowlisting, patch management, threat intelligence, and WAFs.
⚠️ Top pitfall: Waiting for the signature (by then the flaw is no longer zero-day), relying on a single control, and neglecting containment speed.
Self-check: Why do antivirus signatures fail against a zero-day exploit?
Connects to: Ransomware, SQL Injection
DNS Tunneling
Must-know: DNS tunneling encodes malicious data within DNS requests to build a covert command channel: register a domain, infect a computer behind the firewall, route queries to the attacker's DNS server, exfiltrate data through the tunnel. Because there is no direct attacker-victim connection, tracing is very difficult.
⚠️ Top pitfall: Blocking all DNS (breaks legitimate internet use), treating backup-server switching as a fix, and ignoring the outbound exfiltration direction of the tunnel.
Self-check: Why is it difficult to trace the attacker's computer in a DNS tunneling attack?
Connects to: Ransomware, Denial of Service and Distributed Denial of Service
Additional Malware Types (Knowledge Background)
Must-know: Fileless malware edits OS-native files (PowerShell, WMI) so antivirus misses it and is up to 10 times more successful than traditional malware; the other types (spyware, adware, trojans, viruses, worms, rootkits, keyloggers, botnets, wipers) are background knowledge, not exam material.
⚠️ Top pitfall: Treating the malware list as exam material - the professor stated it is out of the syllabus; and relying on file-scanning antivirus against fileless attacks.
Self-check: Why is fileless malware not caught by antivirus software?
Connects to: Ransomware, Denial of Service and Distributed Denial of Service
Was this lecture useful?
BitsNotes AI Assistant
Subject Notes AssistantConfigure AI Chat
Choose how to access the chatbotSigned in as
Powered by BitsNotes — 20 messages per day. No API key needed. Want unlimited access? Use "Bring Your Own Key" mode.
Sign in to use AI Chat
Get 20 free AI messages per day to ask questions about your lecture notes. Sign in with Google or GitHub — it takes 5 seconds.
Sign In to BitsNotesSwitch to "Bring Your Own Key" tab above for unlimited access with any OpenAI-compatible provider.