CSEC - 4

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/98

encourage image

There's no tags or description

Looks like no tags are added yet.

99 Terms

1
New cards

Application layer

Top layer of the stack where user-facing software runs (browsers and servers and chat clients and games) using protocols like HTTP and DNS and FTP and SSH and TLS

2
New cards

Why do we need DNS?

Humans are good with names and words while computers are good with numbers so DNS maps domain names to IP addresses

3
New cards

Role of ARP in the stack

Maps logical IP addresses to physical hardware addresses (sits between the network layer and the link layer)

4
New cards

TCP vs UDP (transport layer)

Provide different quality of service - TCP is reliable and UDP is unreliable but lightweight

5
New cards

DNS

Domain Name System - an application-layer protocol and distributed database that maps domain names to IP addresses

6
New cards

FTP

File Transfer Protocol - old but still used protocol for uploading and downloading files

7
New cards

HTTP

Hypertext Transfer Protocol - the protocol of the web

8
New cards

Telnet

Early remote access protocol (insecure)

9
New cards

SSH

Secure Shell - more recent secure remote access protocol (the secure successor to Telnet)

10
New cards

SSL/TLS

Protocol for secure encrypted browsing (HTTPS)

11
New cards

IMAP / POP / SMTP

Internet email protocols

12
New cards

BitTorrent

Example of an application-layer file sharing protocol

13
New cards

URL

Uniform Resource Locator - standardised format describing the location and access method of a resource on the internet

14
New cards

URL structure

scheme://user:password@host:port/url-path?query-string

15
New cards

URL scheme

The protocol being used (e.g. https)

16
New cards

Why is putting user:password in a URL a bad idea?

It reveals your credentials to the browser (and its vendor) who may not be trustworthy - log in via the site's form instead

17
New cards

Default port for HTTPS

443 - usually omitted from the URL unless the server uses a non-standard port

18
New cards

URL url-path

The specific page or resource on the server (like a directory structure)

19
New cards

URL query-string

Comes after the ? - input for the server (e.g. a search) and its structure depends on the server

20
New cards

Structure of the host part of a URL

subdomain.domain.topdomain (e.g. profile.facebook.com)

21
New cards

In profile.facebook.com what are .com and facebook and profile?

.com is the top-level domain and facebook is the domain and profile is a subdomain

22
New cards

How can an attacker take a website offline using DNS?

Take out its DNS server so nobody can map the domain name to an IP address

23
New cards

Dyn attack (case study)

Distributed denial of service on DNS provider Dyn - flooded with requests so legitimate lookups got no reply and sites like Twitter became unreachable

24
New cards

Defences against DDoS

Redundancy and lots of bandwidth or hiding behind a provider like Cloudflare

25
New cards

DNS hijacking - New York Times (2013)

Attacker phished an IT admin's account at the DNS provider and changed the IP record for nytimes.com so visitors went to a different server

26
New cards

Two ways to attack DNS covered in lecture

1) DDoS the DNS server (e.g. Dyn) 2) Take over the admin's account (e.g. phishing in the NYT case) and change the records

27
New cards

Basic function of DNS

Map domain names to IP addresses

28
New cards

DNS mapping cardinality

Many to many - one name can have many IPs (google.com) and one IP can have many names (www.ed.ac.uk and edwc.is.ed.ac.uk)

29
New cards

Why is DNS distributed and not on one machine?

If one machine held all records an adversary would only need to take out that one machine to bring down global DNS

30
New cards

Resource record

An entry in the distributed DNS database (main types are A and MX and NS)

31
New cards

A record

Address record - the IP address associated with a host name

32
New cards

MX record

Mail exchange record - the mail server of a domain

33
New cards

NS record

Name server record - the authoritative server for a domain

34
New cards

Why do NS records exist?

They point a domain to its name server so resolvers know where to ask

35
New cards

Domain name

Two or more labels separated by dots (e.g. inf.ed.ac.uk has 4 labels)

36
New cards

TLD

Top-level domain - the rightmost label of a domain name

37
New cards

gTLD

Generic top-level domain (.com and .org and .net)

38
New cards

ccTLD

Country-code top-level domain (.ca and .it and .uk)

39
New cards

Examples of new TLDs

.scot and .tirol

40
New cards

ICANN

Non-profit Internet Corporation for Assigned Names and Numbers - allocates names and keeps the gTLD database and accredits registrars for gTLDs

41
New cards

Who manages gTLDs vs ccTLDs?

gTLDs are managed by ICANN and ccTLDs are managed by government organisations

42
New cards

Registrar (e.g. GoDaddy)

Accredited reseller of domain names - must register with ICANN and follow its rules or can be kicked out

43
New cards

UK domain quirk

You cannot register something.uk directly - it must sit under co.uk or ac.uk etc.

44
New cards

DNS tree

Hierarchy that starts at the root (an invisible dot at the far right) then TLDs then domains then subdomains

45
New cards

Which direction do you read a domain name for resolution?

Right to left - from the root down to the most specific label

46
New cards

Why is DNS a hierarchy?

It spreads load and responsibility and authority across many entities so no single global entity runs it all

47
New cards

Zone

Part of the DNS tree managed by one authority that holds the resource records for it (e.g. the brown.edu zone)

48
New cards

Visibility in the DNS tree

Servers know about names below them but not above them (top-down visibility)

49
New cards

Name server

Keeps a local database of DNS records and answers DNS queries and can ask other name servers if it does not have the record

50
New cards

Authoritative name server

Run by the domain's administrator and stores the reference (true) version of the DNS records for a zone

51
New cards

Examples of authoritative name servers

dns0.ed.ac.uk for ed.ac.uk and dns0.inf.ed.ac.uk for inf.ed.ac.uk

52
New cards

Root servers

Authoritative for the root zone (TLDs) and named [a-m].root-servers.net and supervised by ICANN

53
New cards

How does your computer find the root servers?

Their IP addresses are hardcoded into browsers and network applications

54
New cards

Resolver

Program that retrieves DNS records by querying a name server (default or root or given) and it caches the records it receives

55
New cards

dig and nslookup

Command-line DNS lookup tools - dig on Linux and nslookup on Windows

56
New cards

Iterative resolution

Name server refers the client to the next server (e.g. via an NS record) and the client repeats until it gets the answer

57
New cards

Recursive resolution

Name server queries other servers on the client's behalf and forwards the final answer (e.g. the A record) back to the client

58
New cards

Iterative walk for www.google.com

Local name server -> root (f.root-servers.net) -> .com (d.gtld-servers.net) -> google.com (ns2.google.com) -> A record

59
New cards

Iterative resolution - who can cache the answer?

Only the client's side (resolver and local name server) because the intermediate servers never learn the final answer

60
New cards

Recursive resolution - who can cache the answer?

Every name server along the path learns the answer and can cache it

61
New cards

Why can't your machine connect to a site before DNS finishes?

It needs the IP address first - without it nothing can be reached

62
New cards

Why does DNS use caching?

Traversing the DNS tree for every query would cause too much traffic and overload root and TLD servers (and web pages need many lookups so caching speeds things up)

63
New cards

TTL

Time-to-live - how long a cached record is kept before it expires (short for frequently changing IPs and longer for stable ones)

64
New cards

DNS lookup order with a cache

1) A record for the domain in cache? Answer immediately 2) NS record of the longest suffix in cache? Resume resolution from that name server

65
New cards

Longest suffix example

Looking up bananas.google.com - use the cached NS for google.com rather than the one for .com

66
New cards

What happens when the DNS cache is full?

Evict entries by some policy - e.g. oldest or very specific or least often read

67
New cards

Stale cached record

The IP has changed so the client fails to connect - the stale record is then dropped and refreshed

68
New cards

Why would root servers be overloaded without caching?

Every single lookup (.com and .org and .net etc.) would have to start at the root

69
New cards

Local DNS cache

Maintained by the OS and shared among all applications and all users of that machine

70
New cards

Windows command to view the DNS cache

ipconfig /displaydns

71
New cards

Windows command to clear the DNS cache

ipconfig /flushdns

72
New cards

Privacy issue with the local DNS cache

On a shared machine others can see the domains you visited - and incognito or private browsing does NOT clear it

73
New cards

Why flush the DNS cache before leaving a shared computer?

It hides the domain names you visited and the only cost is extra lookups for the next user

74
New cards

DNS cache poisoning - basic idea

Give a DNS server a false address record and get it cached so users are sent to the attacker's machine

75
New cards

DNS query transport

UDP on port 53 - reliability is not needed because you simply resend a query if no answer comes

76
New cards

16-bit request identifier

Unique ID in the query that matches answers to queries (a page load triggers many lookups) - not a real security feature

77
New cards

Authentication in DNS

None - DNS was designed in a high-trust era and queries are usually unencrypted (visible in Wireshark on UDP port 53)

78
New cards

When can a DNS cache be poisoned?

Predictable identifiers and return ports and/or attacker answers before the authoritative server and/or unsolicited records are accepted

79
New cards

BIND

Popular DNS server software - early versions were vulnerable to cache poisoning (since fixed)

80
New cards

Cache poisoning defence - query randomisation

Use a random 16-bit request identifier and a random 16-bit return port instead of predictable values

81
New cards

Probability of guessing a 16-bit request ID

1/2^16 = 0.0015%

82
New cards

Probability of guessing request ID and return port together

1/2^32 - less than one in four billion for a single guess

83
New cards

Weakness of query randomisation

It only helps against a single guess - an attacker who can make many guesses can still succeed (Kaminsky attack)

84
New cards

Kaminsky attack (subdomain DNS cache poisoning)

Victim is made to request many nonexistent subdomains (000.ed.ac.uk to 999.ed.ac.uk) giving the attacker many guesses at the ID and port

85
New cards

How does the attacker get the victim to send the requests?

Lure them to a web page (via phishing or social media) that loads many nonexistent subdomains of the target domain

86
New cards

Why use nonexistent subdomains in the Kaminsky attack?

They are not cached and the real server just says non-existent so each request gives the attacker a fresh chance to race with forged replies

87
New cards

NXDOMAIN

Response meaning the domain does not exist

88
New cards

Format of a forged response in the Kaminsky attack

Random ID + correct NS record + spoofed glue record pointing to the attacker's name server IP

89
New cards

Glue record

A record giving the IP address of a name server - spoofed in the attack to point at the attacker's server

90
New cards

Goal of the Kaminsky attack

Cache the correct NS name with the wrong IP (e.g. ns2.ed.ac.uk = 66.66.66.66) so all of ed.ac.uk goes to the attacker's name server

91
New cards

Main defence against cache poisoning

DNSSEC

92
New cards

DNSSEC

Secure DNS using public-key cryptography with signed replies at each step

93
New cards

Three goals of DNSSEC

Authenticity of the answer origin and integrity of the reply and authenticity of denial of existence

94
New cards

Authenticity of denial of existence

A signed 'this domain does not exist' answer so a forged earlier reply cannot trick you

95
New cards

How DNSSEC works in a lookup

Each server signs its replies and hands you the public key of the next zone down - you verify every step starting from a key you already know (e.g. .com)

96
New cards

Trust anchor

The one key you already know (burned into your software) - everything else chains from it like TLS root certificates in a browser

97
New cards

DNSSEC deployment status

Slow - root servers support it since 2010 but not every server enables it because key management is hard

98
New cards

DNSSEC vs random IDs and ports

DNSSEC gives real authenticity while randomisation only makes guessing harder

99
New cards

Lecture summary - key DNS topics

Distributed database and resolvers and name servers and iterative vs recursive resolution and caching and cache poisoning and DNSSEC