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.
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)
- 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.
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.
| Concept | Question | Example: a department server |
|---|---|---|
| Asset | What are we protecting? | The student grades database |
| Threat | Who or what can cause harm? | A password-guessing bot (brute-force) |
| Vulnerability | Through which “hole”? | SSH is open to the Internet, the password is “admin123”, attempts are not limited |
| Risk | How likely and how severe? | Likelihood 4/5 × impact 5/5 = 20 → critical |
| Countermeasure | What 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
| Threat | Layer | Essence (in brief) | Sign | Protection |
|---|---|---|---|---|
| Sniffing (eavesdropping) | 1–2 | Capturing and reading unencrypted traffic | Often goes unnoticed | Encryption (TLS, VPN, WPA3), switches |
| ARP spoofing | 2 | A fake ARP reply — the gateway’s MAC becomes the attacker’s | arp -a shows two IPs on one MAC | DAI + DHCP snooping, static ARP, segmentation |
| MAC flooding | 2 | Filling the switch table to turn it into a “hub” | The table fills up, traffic goes to all ports | Port security (limit on the number of MACs) |
| IP spoofing | 3 | A packet with a forged source address | An “external” source seen from the inside | Ingress/egress filtering (uRPF) |
| DoS / DDoS | 3–7 | Filling up the link, the connection table or an application | Traffic grows sharply, the service slows down | Rate limiting, SYN cookies, CDN/scrubbing center |
| Port scanning | 4 | Finding out which services are open (reconnaissance) | Attempts on many ports from one source | Firewall, shutting down unneeded services, IDS |
| DNS spoofing | 7 | A fake DNS reply — the user lands on a fake site | A familiar site on a different IP, a certificate error | DNSSEC, a trusted resolver, HTTPS |
| Brute-force | 7 | Guessing a password many times | Consecutive FAILs in the log | Blocking, delaying, MFA, a strong password |
| Phishing | 7 + human | Getting data through a fake message/site | Urgent wording, a look-alike domain | Training, MFA, mail filters |
| Malware (virus, trojan, ransomware) | 7 | Infecting a device, stealing data or encrypting it and demanding a ransom | Unknown processes, encrypted files | Updates, antivirus/EDR, backups |
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.
- List the assets
The grades server (confidentiality and integrity matter), Wi-Fi (availability), teachers’ accounts (confidentiality).
- 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.
- Assess
(a) 4 × 5 = 20 — critical; (b) 3 × 4 = 12 — high; (c) 4 × 4 = 16 — high.
- 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
arp -a)
| IP | MAC |
|---|
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
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
- Write the packet down
For example:
198.51.100.5 → 10.2.0.10, tcp 443. - Start from rule 1
Is the source inside 203.0.113.0/24? No → next.
- Stop at the first match
Rule 2: source any ✓, destination 10.2.0.10 ✓, tcp ✓, 443 ✓ → ALLOW (rule 2).
- 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:
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
- CIA: confidentiality, integrity, availability. Risk = likelihood × impact.
- ARP has no authentication → ARP spoofing → MITM. Defence: DAI + DHCP snooping.
- The type of DDoS determines the defence: SYN flood — SYN cookies; volumetric — provider/scrubbing center; HTTP flood — rate limiting, WAF.
- Firewall: from top to bottom, first match; default DENY at the end.
- 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
| Error | Consequence | Correct answer |
|---|---|---|
| “We have a firewall — so we are safe” | Phishing, weak passwords and insider threats get past the firewall | Defence in depth |
| A general rule above a narrow one | Needed traffic is blocked or unneeded traffic is opened | Narrow rules on top, default DENY at the end |
| Guests and staff in the same LAN | A convenient environment for ARP spoofing and sniffing | Segment with VLANs, isolate the guest network |
| Logs are off or nobody reads them | An attack goes unnoticed for weeks | Centralised logging (syslog/SIEM) and automatic alerts |
| Default passwords (admin/admin) left in place | Routers and cameras join a botnet | Change the password at first start-up |
| Clicking “proceed anyway” on a certificate warning | The door opens for MITM | Stop and find out the reason |
| No backups are made | Data does not come back after ransomware | The 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.
| Criterion | Points |
|---|---|
| A network diagram and a list of assets | 1 |
| A risk table (at least 5, rated correctly) | 1 |
| The defences are justified and tied to the CIA | 1 |
| The Python program works and has been tested with test data | 1 |
| The report is clean, with a conclusion and sources | 1 |
Summary
Your lesson results
Your results are saved in this browser. Read all the sections and complete the exercises and assignments.