Computer Networks / Practical class / Practical class 20
Practical class · Computer Networks

Fundamentals of Network Security and Types of Threats

A “Payme bonus” link in Telegram, a fake gateway on the dormitory Wi-Fi, an army of bots that took down a game server — all of these are network threats. Today we study them through the eyes of a defender: you will see in safe simulators how a threat works, then check firewall rules in Python, find brute-force and scanning in logs, and write a small IDS.

:ik-kitob: Practical class 20 ⏱ 2 academic hours (80 minutes) 🚇 Packet simulators ⚡ Think like the defender, not the attacker
20

Lesson goals and plan

By the end of the lesson you will…

  • you can explain the principles of confidentiality, integrity and availability (CIA) with examples
  • you can tell threat, vulnerability and risk apart and assess risk as likelihood × impact
  • you can classify the main threat types (phishing, DoS/DDoS, MITM, ARP spoofing, brute-force, scanning, malware) by OSI layer
  • you can read and check firewall rules using the “first match” principle
  • you can write Python programs that automatically detect signs of attacks in log entries
  • you can choose suitable defences for each threat (DAI, rate limiting, IDS/IPS, MFA, segmentation)

Plan (according to the syllabus)

  1. Fundamentals of Network Security and Types of Threats

All attack scenarios in this lesson are simulations. Scanning, guessing passwords or intercepting traffic on a real network without permission is against the law. A defender understands the attack, but tests it only in a lab where they have been given permission.

Why did the link in the “You won an iPhone!” message turn out to be payme-uz.com?

A message arrives in the group chat: “500 000 soum bonus from Payme for university students! Link your card.” The link looks almost like the real address, and the page has exactly the same colours. Within minutes, the card details and SMS codes of dozens of students end up in a stranger’s hands. This is phishing, the most widespread of network threats. It breaks neither the router nor the encryption — it deceives a person. Today we look at both technical threats and the human factor and, most importantly, learn how to spot and stop them.

Key terms

Theory reminder

Security is not a single device but a process: knowing your assets, assessing risks, putting protection in place, monitoring, and responding to incidents. The goal of every measure is to protect one of the pillars of the CIA triad.

C I A Confidentiality encryption (TLS, VPN), access control threats: sniffing, MITM, phishing Integrity hash, HMAC, digital signature threats: packet modification, DNS spoofing Availability backup, redundant link, anti-DDoS; threat: DoS CIA + authentication and accountability
Fig. 20.1. The CIA triad: every threat hits at least one pillar, every defence strengthens at least one.
Table 20.1. Threat, vulnerability, risk — in one example
ConceptQuestionExample: a department server
AssetWhat are we protecting?The student grades database
ThreatWho or what can cause harm?A password-guessing bot (brute-force)
VulnerabilityThrough which “hole”?SSH is open to the Internet, the password is “admin123”, attempts are not limited
RiskHow likely and how severe?Likelihood 4/5 × impact 5/5 = 20 → critical
CountermeasureWhat do we do?SSH only through a VPN, key-based login, fail2ban (blocking), MFA

Law and ethics. In Uzbekistan the Law “On Cybersecurity” was adopted in 2022, and the Criminal Code sets liability for unauthorised access to computer information and for creating and distributing malware. The knowledge in this lesson is for defence. To test any network you need the owner’s written permission.

Fundamentals of Network Security and Types of Threats

First a “map” of threats — what happens at which layer. Then two simulators (ARP spoofing / MITM and DDoS) and three sample tasks: assessing risk, reading firewall rules and finding brute-force in a log.

The threat map: by OSI layer

Table 20.2. The main network threats and countermeasures
ThreatLayerEssence (in brief)SignProtection
Sniffing (eavesdropping)1–2Capturing and reading unencrypted trafficOften goes unnoticedEncryption (TLS, VPN, WPA3), switches
ARP spoofing2A fake ARP reply — the gateway’s MAC becomes the attacker’sarp -a shows two IPs on one MACDAI + DHCP snooping, static ARP, segmentation
MAC flooding2Filling the switch table to turn it into a “hub”The table fills up, traffic goes to all portsPort security (limit on the number of MACs)
IP spoofing3A packet with a forged source addressAn “external” source seen from the insideIngress/egress filtering (uRPF)
DoS / DDoS3–7Filling up the link, the connection table or an applicationTraffic grows sharply, the service slows downRate limiting, SYN cookies, CDN/scrubbing center
Port scanning4Finding out which services are open (reconnaissance)Attempts on many ports from one sourceFirewall, shutting down unneeded services, IDS
DNS spoofing7A fake DNS reply — the user lands on a fake siteA familiar site on a different IP, a certificate errorDNSSEC, a trusted resolver, HTTPS
Brute-force7Guessing a password many timesConsecutive FAILs in the logBlocking, delaying, MFA, a strong password
Phishing7 + humanGetting data through a fake message/siteUrgent wording, a look-alike domainTraining, MFA, mail filters
Malware (virus, trojan, ransomware)7Infecting a device, stealing data or encrypting it and demanding a ransomUnknown processes, encrypted filesUpdates, antivirus/EDR, backups
:ik-chat:Telegram phishing“Vote for me” and “get a bonus” links ask for your SMS code in order to steal your account.
:ik-oyin:Game serversRival clans may stage a DDoS during a tournament — that is why servers sit behind anti-DDoS protection.
:ik-wifi:Open Wi-FiA fake access point with the same name (“Evil Twin”) connects users to itself.
:ik-qulf:RansomwareThere are many cases worldwide where the files of hospitals and factories were encrypted and work stopped — a backup copy saves the day.

Sample task 1. Assessing the risks of a department network

Condition: the department has Wi-Fi, teachers’ computers, a grades server and lab computers. Identify the three main risks, rate them on a 1–5 scale and set priorities.

  1. List the assets

    The grades server (confidentiality and integrity matter), Wi-Fi (availability), teachers’ accounts (confidentiality).

  2. Find the threat + vulnerability pairs

    (a) The server’s SSH is open to the Internet and the password is simple → brute-force. (b) The Wi-Fi password is known to everyone, guests and staff are on one network → ARP spoofing / sniffing. (c) Phishing emails to teachers → account theft.

  3. Assess

    (a) 4 × 5 = 20 — critical; (b) 3 × 4 = 12 — high; (c) 4 × 4 = 16 — high.

  4. Countermeasures and priority

    First (a): SSH only through a VPN, with keys. Then (c): MFA and short training. Then (b): move the guest Wi-Fi to a separate VLAN, DAI on the switch.

Simulator 1: ARP spoofing and MITM — through the eyes of a defender

In a LAN, before sending a packet to the gateway a computer asks for its MAC address via ARP and writes the reply into a table. ARP has no authentication: whoever answers first (or last) is “right”. Below, watch how this weakness is exploited and how Dynamic ARP Inspection (DAI) stops it. Press the steps in order.

:ik-tarmoq: Three devices behind a switch

Student PC192.168.1.10aa:aa:aa:00:00:10 Gateway (router)192.168.1.1aa:aa:aa:00:00:01 Switch Foreign device192.168.1.66ee:ee:ee:00:00:66
The PC’s ARP table (arp -a)
IPMAC
Press the steps one after another. Then turn on a protection and repeat steps 2–3.

Simulator 2: DDoS and layers of defence

The university’s test platform can serve 1000 requests per second. During an exam 300 students are working. Change the strength and type of the botnet attack, turn on defences and watch what percentage of the real students’ requests is still served. The effectiveness coefficients are conditional values for teaching purposes.

:ik-server: Test platform: capacity 1000 requests/s

Attack type:
Bot traffic: 3000 requests/s
Students
Bots (after filtering)
Total / capacity

Mini-research +15 XP: for each attack type, find the smallest set of measures that brings the service back to 100% (bot traffic 10 000). Why does rate limiting give no benefit at all against UDP amplification?

Sample task 2. Reading firewall rules: “first match”

Condition: the firewall in front of the head-office servers has the rules below. When a packet arrives, the rules are checked from top to bottom; the first matching rule applies and the rest are not looked at. If none matches — the default policy (DENY).

firewall rules (simplified notation) #  action source            destination      proto  port
 1  DENY   203.0.113.0/24    any              any    any    # blacklisted network
 2  ALLOW  any               10.2.0.10/32     tcp    443    # web portal (HTTPS)
 3  ALLOW  10.1.0.0/16       10.2.0.0/16      tcp    22     # SSH only from the branch
 4  ALLOW  any               10.2.0.53/32     udp    53     # DNS
 5  DENY   any               any              tcp    23     # Telnet is forbidden
    default policy: DENY
  1. Write the packet down

    For example: 198.51.100.5 → 10.2.0.10, tcp 443.

  2. Start from rule 1

    Is the source inside 203.0.113.0/24? No → next.

  3. Stop at the first match

    Rule 2: source any ✓, destination 10.2.0.10 ✓, tcp ✓, 443 ✓ → ALLOW (rule 2).

  4. The order matters!

    If rule 5 (DENY tcp 23) were first, the result would not change; but if “DENY any any any any” is put at the top, everything gets closed. Specific (narrow) rules go at the top, general ones at the bottom.

Sample task 3. Finding brute-force in a log by hand

On a Linux server SSH attempts are stored in the /var/log/auth.log file (Debian/Ubuntu). An administrator finds the most “active” IPs with a chain of commands:

$ grep "Failed password" /var/log/auth.log | grep -oE "from [0-9.]+" | sort | uniq -c | sort -rn | head -3 412 from 198.51.100.23 37 from 192.0.2.140 2 from 10.1.5.23 $ sudo fail2ban-client status sshd Status for the jail: sshd |- Currently banned: 2 `- Banned IP list: 198.51.100.23 192.0.2.140

412 failures from one IP — clearly an attack; 2 failures from 10.1.5.23 — probably a teacher mistyping a password. In the independent tasks below you will automate this analysis in Python: with a time window, a threshold and a report.

// REMEMBER IN 1 MINUTE

  1. CIA: confidentiality, integrity, availability. Risk = likelihood × impact.
  2. ARP has no authentication → ARP spoofing → MITM. Defence: DAI + DHCP snooping.
  3. The type of DDoS determines the defence: SYN flood — SYN cookies; volumetric — provider/scrubbing center; HTTP flood — rate limiting, WAF.
  4. Firewall: from top to bottom, first match; default DENY at the end.
  5. A log is the defender’s “black box”: brute-force, scanning and anomalies are visible there.

Independent tasks

7 tasks: from assessing risk to IDS rules. All data are training logs (the addresses come from the ranges reserved for documentation: 192.0.2.x, 198.51.100.x, 203.0.113.x). Use input() without a prompt text.

Common mistakes

ErrorConsequenceCorrect answer
“We have a firewall — so we are safe”Phishing, weak passwords and insider threats get past the firewallDefence in depth
A general rule above a narrow oneNeeded traffic is blocked or unneeded traffic is openedNarrow rules on top, default DENY at the end
Guests and staff in the same LANA convenient environment for ARP spoofing and sniffingSegment with VLANs, isolate the guest network
Logs are off or nobody reads themAn attack goes unnoticed for weeksCentralised logging (syslog/SIEM) and automatic alerts
Default passwords (admin/admin) left in placeRouters and cameras join a botnetChange the password at first start-up
Clicking “proceed anyway” on a certificate warningThe door opens for MITMStop and find out the reason
No backups are madeData does not come back after ransomwareThe 3-2-1 rule: 3 copies, 2 different media, 1 stored off-site

Boss level

Boss level: a mini-IDS for the department

A mixed log with three kinds of entries comes from the department server. Prepare a security report with one program +70 XP.

Input: n, then n lines, each one of three kinds:
AUTH HH:MM:SS ip login OK|FAIL · CONN ip port · ARP ip mac

Rules: brute-force — as in task 3 (≥ 5 FAILs within 60 s); scanner — ≥ 10 different ports; ARP — several MACs for one IP.
Output (sections in this order, IPs in alphabetical order within them, and if a section is empty print yo‘q):

== Brute-force ==
198.51.100.23 (5 ta xato)
  ! keyin muvaffaqiyatli kirish: admin     ← if there is an OK from this IP after its last FAIL (the login of the first OK)
== Skanerlash ==
yo‘q
== ARP ==
192.168.1.1 -> aa:aa:aa:00:00:01, ee:ee:ee:00:00:66
== Xulosa ==
Xavf darajasi: YUQORI

Risk level: YUQORI (high) — if there is a successful login after brute-force or an ARP conflict; O‘RTA (medium) — if there is any other finding; PAST (low) — if nothing is found. Print these words exactly as written.

Reinforcement

Review questions

Give one example of a threat and of a defence for each pillar of the CIA triad.

Confidentiality: sniffing — encryption (TLS, VPN). Integrity: packet modification, DNS spoofing — HMAC, digital signature, DNSSEC. Availability: DDoS — rate limiting, a scrubbing center, a redundant link.

How do a threat, a vulnerability and a risk differ?

A threat is a source of harm (an attacker, a virus). A vulnerability is the weakness it exploits (a default password). A risk is the combination of the likelihood of harm and its consequences; if the vulnerability is closed or the impact is reduced, the risk goes down.

How does ARP spoofing work and how do you protect against it?

ARP replies are accepted without authentication; a foreign device sends a fake reply saying “the gateway IP is mine” and the traffic passes through it. Defence: DHCP snooping + Dynamic ARP Inspection on the switch, static entries for critical devices, VLAN segmentation, encrypted protocols.

What is the difference between DoS and DDoS? Name three kinds of DDoS.

DoS comes from one source, DDoS from many sources (a botnet). Kinds: volumetric (UDP amplification — fills the link), protocol (SYN flood — fills the connection table), application-layer (HTTP flood — exhausts the server’s resources).

What do “first match” and “default DENY” mean in firewall rules?

The rules are checked from top to bottom and the first matching rule determines the result. If none matches, the packet is rejected — “everything not explicitly allowed is forbidden”.

What signs of a brute-force attack appear in a log?

Many FAILs from one IP in a short time, different login names (root, admin, test), an even interval between attempts, often at night; most dangerous is a successful login after the FAILs.

How can you recognise a phishing link?

It looks like the official one but with a different domain (payme-uz.com), punycode or an IP address, an “@” in the URL, urgent wording, a request for an SMS code or card details.

Where are an IDS and an IPS placed, and what do they do?

An IDS analyses a copy of the traffic (port mirroring) and raises alerts. An IPS sits in the traffic path (inline) and stops attack packets that match a rule.

What is “defence in depth”?

Not relying on a single measure: firewall + segmentation + updates + strong authentication + encryption + logging and monitoring + backups + user training. If one layer falls, the next one holds.

Independent work

The independent-study topic in the course syllabus: “Network security: authentication, encryption, SSL/TLS and the main cyberattacks.” (6 hours). This practical class relies on the cyberattacks part of the topic (authentication comes in the next lesson). According to your variant: (1) draw the diagram of the site’s network, (2) assess at least 5 risks in a table (likelihood × impact), (3) justify the defences for the 3 highest risks, (4) carry out the variant’s analysis task with a Python program and attach the result.

Assessment criteria (individual assignment)
CriterionPoints
A network diagram and a list of assets1
A risk table (at least 5, rated correctly)1
The defences are justified and tied to the CIA1
The Python program works and has been tested with test data1
The report is clean, with a conclusion and sources1

Summary

CIA — a compassAssess every threat and defence by confidentiality, integrity and availability.
Risk = likelihood × impactResources are limited — close the critical risks first.
Every layer has threatsARP spoofing (2), IP spoofing (3), scanning and SYN flood (4), phishing and brute-force (7).
ARP is trustingA protocol without authentication is a door for MITM; DAI and segmentation close it.
Know the type of DDoSAgainst a volumetric attack — the provider; against SYN flood — SYN cookies; against HTTP flood — rate limiting and a WAF.
Firewall orderTop to bottom, first match, default DENY at the end.
The log is a witnessEven a simple program can find brute-force, scanning and anomalies — what matters is collecting and reading the logs.
Next stopMany attacks depend on the question “who is getting in?”. In the final practical class we study authentication and authorization — AAA, RADIUS, 802.1X and MFA.

Your lesson results

Your results are saved in this browser. Read all the sections and complete the exercises and assignments.

My personal notes