impera Open Impera

A levels Computer Science · Networks and databases

Network security

1Threats to networks

A network faces threats from outside attackers, from careless or dishonest insiders, and from software flaws.

ThreatWhat it does
phishingfake emails or websites trick people into giving passwords or bank details
brute-force attacksoftware tries huge numbers of passwords until one works
denial of service (DoS)floods a server with requests so real users cannot reach it; a distributed DoS (DDoS) uses thousands of infected computers
SQL injectionmalicious SQL typed into a web form runs on the database
interceptiondata is captured as it travels, for example on public Wi-Fi
insider threata trusted user misuses their access
Check yourself

What is a distributed denial-of-service attack?

  • Copying data onto a USB stick and taking it off site

  • A fake email asking for bank details from many people

  • Guessing a password many times until the right one is found

  • Many infected computers flood a server with requests so it cannot serve real users

Show the answer

Many infected computers flood a server with requests so it cannot serve real users

Many sources, one target.

2Malware

Malware is malicious software.

TypeHow it spreads or acts
virusattaches itself to a program or file; spreads when the infected file is run and copied
worma standalone program that copies itself across networks by itself, using security holes
Trojanpretends to be useful software, but carries a harmful payload; does not copy itself
ransomwareencrypts the victim's files and demands payment for the key
spywaresecretly records activity, such as key presses, and sends it to the attacker

Worms can spread far faster than viruses because they need no user action.

Check yourself

What is the key difference between a virus and a worm?

  • A worm spreads by itself across a network; a virus needs an infected file to be run

  • A worm only affects phones, while a virus only affects computers

  • A worm must be attached to a file, while a virus spreads by itself

  • A virus is always harmless, while a worm always deletes files

Show the answer

A worm spreads by itself across a network; a virus needs an infected file to be run

Self-replicating standalone.

3Firewalls and proxy servers

A firewall sits between a network and the outside world and checks traffic against rules.

A firewall between the internet and a private network. Packets that match an allow rule pass; the rest are dropped.

  • Packet filtering checks each packet's source and destination IP addresses, protocol and port number, and blocks those not allowed (for example, blocking port 23 used by insecure Telnet).
  • Stateful inspection also remembers open connections, so it only lets in replies to requests that came from inside.
  • A proxy server makes requests on behalf of the computers inside the network, so outside servers see only the proxy's IP address. It can also filter websites and cache popular pages.
Check yourself

How does packet filtering decide whether to block a packet?

  • By asking the user whether to allow each packet

  • By checking it against rules on IP addresses, protocols and port numbers

  • By reading the whole file that the packet belongs to

  • By encrypting it and checking whether it changes

Show the answer

By checking it against rules on IP addresses, protocols and port numbers

Header rules.

4Authentication and encryption

Authentication checks that users are who they claim to be:

  • passwords: should be long, not reused, and stored only as salted hashes;
  • two-factor authentication (2FA): something you know (password) plus something you have (a code on your phone) or are (fingerprint);
  • biometrics: fingerprints, face or iris recognition.

Access rights limit what each user can do: a student may read shared files but not change the system settings.

Encryption protects data in transit (HTTPS, WPA3 Wi-Fi, VPNs) and at rest (encrypted drives), so intercepted or stolen data cannot be read.

Check yourself

Why does two-factor authentication improve security?

  • It blocks all malware

  • A stolen password alone is not enough to log in

  • It removes the need for encryption

  • It makes passwords shorter

Show the answer

A stolen password alone is not enough to log in

Two different factors.

5Preventing attacks

MeasureProtects against
installing security patches promptlyattacks that use known software flaws (such as worms)
antivirus softwareknown malware, found by its signature or behaviour
input validation and parameterised queriesSQL injection
penetration testingfinding weaknesses before attackers do, by authorised simulated attacks
regular backups (kept off the network)ransomware and data loss
account lockout after failed attemptsbrute-force attacks
Worked example

SQL injection

  1. A login form builds the query: SELECT * FROM Users WHERE name = 'input'.
  2. An attacker types: ' OR '1'='1.
  3. The query becomes SELECT * FROM Users WHERE name = '' OR '1'='1', which is true for every row.
  4. Prevention: use parameterised queries, so the input is treated as data and never as SQL code.
Check yourself

What stops SQL injection most effectively?

  • A firewall that blocks traffic on all ports

  • Parameterised queries that treat input only as data

  • A faster server that can handle more queries

  • A longer password for the database administrator

Show the answer

Parameterised queries that treat input only as data

Never run input as code.

6People and policies

Many attacks target people rather than technology: this is social engineering. Examples include phishing, phone calls pretending to be IT support, and leaving infected USB sticks in a car park.

Organisations reduce the risk with:

  • staff training to spot phishing and report suspicious messages;
  • an acceptable use policy setting out what users may and may not do;
  • the principle of least privilege: each user gets only the access they need;
  • a disaster recovery plan: backups, and steps to restore systems after an attack.
Check yourself

What is the principle of least privilege?

  • Only managers are allowed to use computers

  • Passwords are changed every day by all users

  • Every user has administrator rights to save time

  • Each user is given only the access they need for their job

Show the answer

Each user is given only the access they need for their job

Limit the damage.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera