Week 4: Hijacking and poisoning

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/56

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

57 Terms

1
New cards

What is hijacking?

An active attack to take over something that belongs to someone else, particularly at runtime

2
New cards

What is spoofing?

Masquerading or impersonation - pretending to be somebody you are not

3
New cards

What is the difference between hijacking and spoofing?

Hijacking takes over an existing connection, whereas spoofing initiates a new connection

4
New cards

What are the motivations for hijacking

Disrupting or jamming communications

Inserting false or malicious data

5
New cards

What is an on path adversary?

The compromised router that is involved in the path of an ongoing connection

6
New cards

What is an off path adversary?

The compromised router that is not involved in the path of an ongoing connection

7
New cards

On path adversaries vs off path adversaries

On path adversaries are more powerful because they use the connection state to predict sequence numbers in TCP hijacking, but are more difficult to scale up due to extra analysis

Inserting false data is very difficult for off path adversaries

8
New cards

What is poisoning?

Contamination of a trusted source of information

9
New cards

What are TCP connections identified by?

Their source and destination IP and port number, which links to applications running on hosts

10
New cards

What is the TCP three-way handshake?

The process by which a TCP connection is established

11
New cards

What are the steps of the TCP three-way handshake?

For client = c suffix, server = s suffix

SYN: SeqNo_c = x

SYN+ACK: SeqNo_s = y, AckNo_c = x+1

ACK: AckNo_s = y+1, SeqNo_c = x+1

12
New cards

What are the key header fields in a TCP three-way handshake?

port numbers (16 bits each)

SYN flag (1 bit)

ACK flag (1 bit)

Sequence number (32 bits)

Acknowledgement number (32 bits)

13
New cards

What is TCP session hijacking?

When an attacker injects data into an end to end TCP connection between two hosts

14
New cards

What are the steps for on-path TCP session hijacking?

1. Sniff packets to observe the ongoing TCP communication

2. Predict the sequence numbers being used by the client and server

3. Inject data by constructing a valid TCP segment with the correct source and destination IP and port, and a predicted sequence number acceptable to the recipient

15
New cards

How does the attacker predict the TCP sequence number in an on path attack?

An on-path attacker can observe the TCP communication between the client and the server by sniffing network packets

16
New cards

Why must the injected packet match the receiver's expected sequence number?

Because TCP will only accept data that matches the next expected sequence number; otherwise, it is buffered or discarded.

17
New cards

What happens if a spoofed packet uses a sequence number of x + δ instead of the expected x + 1?

It is considered out-of-order, and the receiver buffers it at position x + δ, leaving a gap of δ bytes.

<p>It is considered out-of-order, and the receiver buffers it at position x + δ, leaving a gap of δ bytes.</p>
18
New cards

What is the consequence if δ is large when injecting data with an incorrect sequence number?

The data may fall out of the receiving buffer boundary, making it ineffective and discarded.

19
New cards

What mechanism allows TCP to handle out-of-order packets like the one at x + δ?

TCP buffers out-of-order packets in its receive window and waits for the missing earlier segments to fill the gap.

20
New cards

What are the challenges of off path TCP hijacking?

Off-path attackers cannot directly observe the sequence numbers. If an off-path attacker blindly spoofs a SYN packet, the real client may send a RST (reset) packet, terminating the connection

21
New cards

What is a TCP initial sequence number attack?

An off-path attack where the attacker tries to spoof the client by guessing the initial sequence number

22
New cards

How were initial sequence numbers historically generated?

Some TCP/IP stacks (like BSD Unix) used predictable ISN generation, increasing by a fixed amount per second and per new connection, making guessing easier

23
New cards

What are the steps of the TCP initial sequence number attack?

1. ICMP flooding the real client to prevent responses

2. Creating a real connection to the target server to record the server's sequence number

3. Closing the connection with the server

4. Sending a spoofed SYN packet as the client to the server, guessing the initial sequence number

5. The server sends SYN+ACK to the flooded client (ignored)

6. Sending a spoofed ACK packet to the server with the acknowledgement number based on the previously recorded server sequence number

24
New cards

What is Border Gateway Protocol (BGP)?

An inter-Autonomous System (AS) routing protocol that connects thousands of ISPs in the Internet

25
New cards

What is an autonomous system (AS)?

A single network or a group of networks controlled by a common network administrator (or group of administrators) on behalf of a single administrative entity

<p>A single network or a group of networks controlled by a common network administrator (or group of administrators) on behalf of a single administrative entity</p>
26
New cards

What are all ASs assigned?

A globally unique Autonomous System Number (ASN)

27
New cards

What is the CIDR prefix?

A notation used in BGP to represent subnets or collections of subnets.

It indicates the number of '1' bits in the subnet mask

BGP routes traffic based on CIDR prefixes

28
New cards

What does intra-AS routing mean?

Routing within the same AS

29
New cards

What is a classless IP address?

An address with any number of bits for its network portion

<p>An address with any number of bits for its network portion</p>
30
New cards

What is a BGP routing table?

Composed of entries in the form of (x, I), where x is a CIDR prefix and I is an interface number for one of the router's interfaces

<p>Composed of entries in the form of (x, I), where x is a CIDR prefix and I is an interface number for one of the router's interfaces</p>
31
New cards

What is BGP longest prefix matching?

When a router needs to forward a packet, it selects the route with the longest matching CIDR prefix, as this is considered the most specific route. This is why sub-prefix hijacking can be effective

32
New cards

How does BGP route advertisement work?

ASs advertise network prefix reachability information, including the advertised prefix and the AS path (sequence of ASs) that lead to that prefix, to neighboring ASs.

This information is exchanged over TCP connections using port 179

33
New cards

How are route advertisements expressed as for an AS?

A sequence of ASNs (descending order of most recently visited) and the subnet prefix

34
New cards

eBGP (external BGP)

BGP connections that span two different ASs and use TCP

35
New cards

iBGP (internal BGP)

BGP connections between routers within the same AS and use TCP

36
New cards

What is BGP prefix hijacking?

Occurs when an AS announces routes to network prefixes that it does not actually control. This false information can be added to BGP routing tables across the Internet

<p>Occurs when an AS announces routes to network prefixes that it does not actually control. This false information can be added to BGP routing tables across the Internet</p>
37
New cards

What is BGP sub-prefix hijacking?

The attacker lies about a subset of a prefix rather than the whole prefix belonging to another AS. This works because BGP prefers longest prefix matching

<p>The attacker lies about a subset of a prefix rather than the whole prefix belonging to another AS. This works because BGP prefers longest prefix matching</p>
38
New cards

What is a BGP routing blackhole?

Created when an AS advertises routes it cannot actually offer, causing packets to be sent into a network blackhole and will be dropped after the TTL expires. The AS7007 incident in 1997 is an example.

39
New cards

What is the Domain Name System (DNS)?

A distributed database system that translates human-readable hostnames to IP addresses

40
New cards

What is the structure of DNS servers?

It is tree-like, with nodes containing the information associated with it

The root server is the root node, followed by the level top level domain and then authoritative servers

<p>It is tree-like, with nodes containing the information associated with it</p><p>The root server is the root node, followed by the level top level domain and then authoritative servers</p>
41
New cards

How is a domain name read in DNS?

As a path from the leaf to the root

42
New cards

What is DNS name resolution?

The process used to map names to IP addresses and IP addresses to names.

43
New cards

What is a DNS resolver?

A DNS client that requests information from DNS name servers.

44
New cards

How does an iterative DNS query work?

The DNS resolver directly queries each name server in the hierarchy, starting from the root server, and each server refers the resolver to the next level

<p>The DNS resolver directly queries each name server in the hierarchy, starting from the root server, and each server refers the resolver to the next level</p>
45
New cards

How does a recursive DNS query work?

The DNS resolver asks a name server to fully resolve the query. If the contacted server doesn't know the answer, it recursively queries other servers on behalf of the resolver.

46
New cards

Iterative vs recursive DNS queries

Recursive DNS queries are conceptually simpler, but does not scale and is not used in practice

47
New cards

What is a DNS cache?

DNS servers store resolved IP addresses for a certain TTL to answer subsequent queries faster, improving performance

48
New cards

Why do we need a DNS cache?

DNS queries require many repeated steps across lookups, which is not efficient

49
New cards

How do DNS queries work with caching?

Before performing the lookup, the local DNS server checks whether the lookup was done before - if it wasn't, then the lookup is performed and the server remembers the lookup in its cache

50
New cards

How does a DNS cache poisoning attack work?

  1. attacker passively observes the client server activity

  2. before the local DNS server expects a reply from the authoritative DNS server, the attacker sends a spoofed IP address to insert in its cache

  3. If successful, clients querying the resolver for the poisoned domain will receive the incorrect IP address

<ol><li><p>attacker passively observes the client server activity</p></li><li><p>before the local DNS server expects a reply from the authoritative DNS server, the attacker sends a spoofed IP address to insert in its cache</p></li><li><p>If successful, clients querying the resolver for the poisoned domain will receive the incorrect IP address</p></li></ol><p></p>
51
New cards

What is the query ID (QID) of a DNS query?

A unique identifier in the query packet which is left intact by the server sending the reply, a way for the server to associate the answer of a lookup with its question

52
New cards

How can the QID be used in a DNS cache poisoning attack?

Attackers try to guess the QID of a legitimate query and send a forged response with the correct QID before the legitimate server, hoping their poisoned record will be cached

This works because DNS uses UDP which is connectionless, so the attacker does not need to establish a connection with the server

53
New cards

What is a Resource Record Set (RRSet)?

A group of DNS records with the same name and type

54
New cards

What is an RRSet attack?

Attackers can include a forged record for a different domain in the "additional" section of their malicious DNS response. If not properly checked, this can poison the cache with incorrect information for unrelated domains

55
New cards

What is a way to prevent RRSet attacks?

Bailiwick checking

56
New cards

What is Bailiwick checking?

A security mechanism to prevent RRSet attacks.

It involves checking if the names in the Authority and Additional sections of a DNS response are within the same domain (or a subdomain) as the query. Responses violating the Bailiwick rule should be rejected

57
New cards

How is a spoofed DNS response accepted by a local DNS server?

needs to have a matching source UDP port, the correct Question section, and the correct Query ID (TXID)