Wiki DE Start in the browser

Wiki › Basics

IT security: attacks and defence

Sort threats with STRIDE and recognise and fend off typical attacks in the simulation: ARP spoofing, rogue DHCP server, SYN flood, port scan, guessing passwords; proof with syslog.

Layer
2 bis 7
Standard
RFC 826, RFC 4987, RFC 7513 …

The three protection goals

Information security protects three things, CIA for short (confidentiality, integrity, availability):

GoalMeaningExample of an attackCountermeasure
Confidentialityonly authorised people can readMAC flooding, eavesdropping on Wi-Fiencryption (VPN, WPA, SSH), port security
Integritydata is not changed unnoticedrogue DHCP server, ARP spoofingDHCP snooping, ARP guard, checksums and signatures
Availabilityservices are reachable when neededSYN flood, fire in the server roomSYN cookies, redundancy (VRRP (redundant gateway)), backup

Often authenticity (is the sender genuine?) and accountability (who did what? see syslog below) are added. STRIDE maps attacks to exactly these goals.

Sorting threats: STRIDE

LetterThreatQuestion
SSpoofingDoes someone pretend to be someone else?
TTamperingDoes someone change data?
RRepudiationCan someone deny having done something?
IInformation DisclosureDoes someone see what they must not see?
DDenial of ServiceDoes someone disable a service?
EElevation of PrivilegeDoes someone obtain more rights?

Six attacks in leyoNET

Everything runs only in the simulation, no real packet is ever sent.

AttackSTRIDEWhat happensDefence
ARP spoofingSARP knows no authenticity (RFC 826): the attacker claims to be the gatewayARP guard on the end devices
Rogue DHCP serverTWith made-up MAC addresses it uses up all addresses of the real server (“DHCP starvation”) and then hands out addresses itself, naming itself as gateway and DNSDHCP snooping (RFC 7513) and port security on the switch
SYN floodDMany half-open connections fill the queue (RFC 4987)SYN cookies, firewall rule
Port scanIopen ports are searchedpublish only necessary services
MAC floodingIMade-up senders fill the switch's MAC table; it sends other people's traffic to all ports and the attacker reads alongport security on the switch
Guess SSH passwordEcommon passwords are triedstrong password, block SSH from outside

Proof instead of denial: syslog

Against repudiation, a log in a place the attacker cannot reach helps. With syslog (format following RFC 5424, transport over UDP 514 following RFC 5426), routers, switches, firewalls and the computers' guard report their events to a syslog server: SSH logins, violations of port security and DHCP snooping, ARP spoofing, SYN floods and port scans. Each message has a severity (0 emergency to 7 debug), the device name and an identifier such as SSHFAIL. The demo “Syslog: Who did that?” shows it.

Physical incidents and backup

Not every threat comes over the network. A fire or a power surge destroys devices (availability, STRIDE: denial of service), a theft takes devices along with their data (information disclosure), a Bad USB stick pretends to be a keyboard and resets computers (tampering). Physical protection helps (locked rooms, smoke detectors, surge protection, UPS), and above all a backup: in leyoNET that is a snapshot. After an incident you first find out which devices are affected, then restore the backup or set the devices up again by hand: same name, same addresses, same cables. Without a backup you now notice how much work is in it.

Try it yourself

The Attacker is in the shop under end devices (feature “Security scenarios”, from profile 3). Cable it, give it an address, choose the attack on the right. On PCs, notebooks and servers Desktop → Security shows the guard and the protection switches. The network scanner finds open ports (Ports and services).

Incident response training (Tools): an attack hits your own network, and a card with a timer guides you through detect, contain and report. Practise a physical incident … makes a device fail (fire, power surge, theft, Bad USB): the card guides you through detect (which devices?), restore (restore a backup or by hand) and report. A snapshot taken earlier is the backup. The exercise “After the fire: restore the backup” comes with one.

In the web version the teacher starts an attack or a physical incident for the whole class (Web version: sessions, classes and watching).

How to do it in leyoNET

The same text as in the app’s help (F1 key).

Security scenarios

Attacks to watch and to fend off. Everything runs only in the simulation, no real packet is ever sent.

Attacker as a device: Drag the Attacker from the shop (end devices) onto the canvas, cable it, give it an address and choose the attack on the right. It starts shortly after the simulation.

  • ARP spoofing (Spoofing): pretends to be the gateway. Defence: ARP guard on the end devices
  • SYN flood (Denial of Service): fills the web server's queue. Defence: SYN cookies or a rule in the Firewall
  • Port scan (Information Disclosure): looks for open ports. Defence: remove superfluous services and Port forwarding
  • Guess SSH password (Elevation of Privilege): tries common passwords. Defence: strong password, block SSH from outside
  • Rogue DHCP server (Tampering): uses up the real server's pool with made-up MAC addresses and then hands out itself as gateway and DNS. Defence: DHCP snooping, port security and IP Source Guard (DHCP snooping and port security)
  • MAC flooding (Information Disclosure): fills the switch's MAC table with made-up senders; the switch then sends other people's traffic to all ports and the attacker reads along. Defence: port security (DHCP snooping, port security and IP Source Guard)

Proof (Repudiation): With Syslog, guards, switches and routers report their events to a syslog server. This shows later what happened when and from where.

Guard and protection: Desktop of PC, notebook or server → Security. It shows what is suspicious, and there you switch on the protection.

In class: The teacher can start an attack on one or all sessions (Class in the lesson).

Physical incidents (class): The teacher can also trigger a fire, a power surge (lightning strike), a theft or Bad USB, for everyone, per seat or at the top of a seat's view, and chooses how many devices it hits at most. While editing a session, the result shows at once. Unlike the attacks above, this takes real effect: fire, surge and theft remove randomly chosen devices including their cables (with fire, devices standing next to each other), Bad USB resets a PC, notebook or server to factory settings. A notice at the top says what happened and what protects against it. Replacements are in the shop; a Snapshots backup makes it quicker. The incident cannot be undone.

STRIDE sorts threats: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege.

Incident response

An attack hits your network and you react like an incident response team. The card at the top right measures the time and guides you through three steps.\n\n1. Detect: the card shows evidence from the simulation: what people report and what the devices write to their consoles. The attacker runs along in the simulation, so you can also look for yourself (console, ARP table, packet list). Identify the attack and whether it comes from your own LAN or from the internet.\n2. Contain: choose a measure. leyoNET checks it in the simulation and only applies it if it works. Dead ends cost points and explain why they do not help. You can also set up the protection yourself: as soon as the attack no longer works, the card notices (bonus).\n3. Report: STRIDE category, timeline and points.\n\nPhysical incident (fire, power surge, theft, Bad USB): to detect, you choose the affected devices; to restore, you restore a backup (the newest snapshot from before the incident with these devices) or set the devices up again yourself: same name, same addresses, same cables (bonus). Without a backup, setting up by hand is the only way. STRIDE: fire and power surge are Denial of Service (availability), theft Information Disclosure, Bad USB Tampering.\n\nPoints: 1000 at the start, 2 less per second, detection mistakes 100, ineffective measure 75, wrong STRIDE category 50, protection set up yourself 200 more.\n\nPractise alone: Tools → Incident response training looks for an attack that works in your network (ARP spoofing, SYN flood, port scan, SSH password guessing, rogue DHCP server, MAC flooding). Tools → Practise a physical incident makes a device fail (fire, power surge, theft, Bad USB) and opens the card to restore it.\n\nIn class: when the teacher starts an attack or a physical incident, the card opens by itself (with the feature «Incident response»). Points and duration go to the teacher and appear in the class overview. Your teacher sees a class ranking (points, then time). If the attack finds no target in your network yet, the card waits until it has an effect. See also Security scenarios and DHCP snooping, port security and IP Source Guard.

DHCP snooping, port security and IP Source Guard

Three protective functions on the switch, in the device window under Protection or on the command line.

DHCP snooping (following RFC 7513): Only on trusted ports may a DHCP server answer (Offer, Ack, Nak). Trusted is the port to the real DHCP server or the uplink towards it. Client requests only pass if the client MAC in the DHCP packet is the sender MAC. This way a rogue DHCP server in the network cannot give anyone an address with a wrong gateway.

Port security: at most this many MAC addresses on a port (e.g. 2). The switch drops further senders and reports it (“restrict”). This prevents a device with made-up MAC addresses from using up the DHCP server's address pool (DHCP starvation) or flooding the switch's MAC table (MAC flooding: once it is full, the switch sends frames to all ports and the attacker reads along).

IP Source Guard (needs DHCP snooping): the switch remembers which address the DHCP server gave which device (binding with MAC, port and VLAN). On a protected port it only lets through IPv4 packets with exactly this sender address. Spoofed senders and manually set addresses are dropped. It does not check ARP.

Command line:

  • ip dhcp snooping
  • on the port: ip dhcp snooping trust
  • on the port: switchport port-security maximum 2
  • on the port: ip verify source
  • show ip dhcp snooping, show ip dhcp snooping binding, show ip verify source, show port-security

Violations appear in the switch console and, with a management address, on the Syslog server. To try it: attack “Rogue DHCP server” under Security scenarios.

Syslog

Syslog collects the messages of many devices in one place. The format is defined in RFC 5424, the transport over UDP 514 in RFC 5426.

  • A computer becomes the collector with the Syslog server service (device window → Services).
  • Routers, firewalls, switches (with a management address) and computers enter the syslog server under Protection or Services. On the command line: logging host 192.168.1.10.

Security-relevant events are reported: SSH logins (successful and refused), port security, DHCP snooping and the guard's warnings (ARP spoofing, SYN flood, port scan). Each message has a severity (0 = emergency to 7 = debug), the device name and an identifier (MSGID, e.g. SSHFAIL).

In STRIDE the R stands for Repudiation: Without a log it cannot be shown later who did what and when. The packets appear in the packet list, the bytes in the hex view.

Practise

  • ★★★☆☆ Attack: Who pretends to be the gateway? · 4 goals · Worksheet (German)
  • ★★★☆☆ Attack: The website no longer responds · 3 goals · Worksheet (German)
  • ★★★☆☆ Attack: A password that is too simple · 2 goals · Worksheet (German)
  • ★★★★☆ Attack: Who is handing out addresses here? · 4 goals · Worksheet (German)
  • ★★★★☆ Who did that? Logging with syslog · 3 goals · Worksheet (German)
  • ★★★★☆ Build a network, then the attacker comes · 5 goals · Worksheet (German)
  • ★★★★☆ Site under fire · 4 goals · class network · Worksheet (German)

In leyoNET under Tools → Exercise catalogue. Every exercise checks itself.

Standards

  • RFC 826 – An Ethernet Address Resolution Protocol
  • RFC 4987 – TCP SYN Flooding Attacks and Common Mitigations
  • RFC 7513 – Source Address Validation Solution for DHCP (SAVI-DHCP)
  • RFC 5424 – The Syslog Protocol
  • RFC 5426 – Transmission of Syslog Messages over UDP

Read on

Found a mistake or have an idea? Source of this page on GitHub.