Socket Security Flashcards

(60 cards)

1
Q

What are sockets?

A

Endpoints for communication over TCP/IP networks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How will IPv6 improve socket security?

A

Mitigates some TCP/IP vulnerabilities.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is server hijacking?

A

A local user intercepts/manipulates data meant for a server they didn’t start.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does a server use a socket?

A

Creates and binds it to a port for communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a port in socket programming?

A

A 16-bit unsigned integer (0-65535) for network communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the bind function’s purpose?

A

Associates a socket with a specific address and port.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the sockaddr_in structure used for?

A

Specifies IPv4 socket address details.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does sin_addr in sockaddr_in do?

A

Defines the IP address to bind the socket to.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is INADDR_ANY?

A

Binds a socket to all network interfaces (IP 0).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What issue arises with INADDR_ANY?

A

Multiple sockets can bind to the same port, causing conflicts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do socket libraries resolve binding conflicts?

A

Prioritize the most specific IP binding.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an example of specific binding?

A

Binding to 172.100.92.45 over INADDR_ANY.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a solution to binding conflicts?

A

Bind to every available IP on the server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is SO_EXCLUSIVEADDRUSE?

A

A Windows NT SP4 option to prevent port reuse.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How does Windows 2003 handle socket security?

A

Uses DACLs on sockets, reducing need for SO_EXCLUSIVEADDRUSE.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why is Linux immune to this binding issue?

A

Port reuse requires SO_REUSEADDR, otherwise blocked.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is DCCP?

A

Datagram Congestion Control Protocol, UDP with congestion control.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Why is managing multiple streams suboptimal?

A

Congestion control applied per stream, not across a group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a problem with apps using one stream per object?

A

Inefficient congestion control for related streams.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What protocols support groups of streams?

A

SCTP and SST (Structured Stream Transport).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is SCTP?

A

Stream Control Transmission Protocol, defined in RFC 4960.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a feature of SCTP?

A

Supports groups of related streams and multiple network paths.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is SCTP’s security feature?

A

Uses a 4-way handshake to protect against SYN flooding.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What platforms support SCTP?

A

FreeBSD, Mac OSX, Windows, Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What was SCTP designed for?
Telephony over IP, also used for reliable server pooling.
26
What is SST?
Structured Stream Transport, supports related stream groups.
27
How does TCP establish a connection?
Via a three-way handshake: SYN, SYN-ACK, ACK.
28
What is a passive open in TCP?
Server binds and listens on a port for connections.
29
What is an active open in TCP?
Client initiates connection with a SYN packet.
30
What is the TCP window attack?
Client sets a small or zero window size, slowing server data transfer.
31
How does the TCP window attack work?
Forces server to send small data chunks with high overhead.
32
What is the impact of a TCP window attack?
Blocks app, consumes worker threads due to slow data sending.
33
How can apps detect TCP window attacks?
Check send call returns for slow client processing.
34
What should apps do with slow clients?
Close and shutdown the socket.
35
What is silly window syndrome?
A TCP issue where small window sizes cause inefficient data transfer.
36
Why are TCP/IP stacks vulnerable?
Handle window size negotiation, exploitable by malicious clients.
37
What is a firewall-friendly app design tip?
Use one connection for efficiency and simpler firewall rules.
38
Why avoid multiple connections?
Increases firewall rule complexity and misconfiguration risks.
39
Why avoid server-to-client connections?
Poses security risks, like FTP’s connect-back mechanism.
40
What is FTP’s security issue?
Server connects back to client on a high port, risking attacks.
41
What ports are vulnerable in FTP-like setups?
High ports (>1024), like MS SQL (1433) or Terminal Services (3389).
42
How does SCTP improve over TCP?
4-way handshake reduces SYN flood risks.
43
What is reliable server pooling?
A protocol using SCTP for accessing multiple pooled servers.
44
Why check send call returns?
Detects slow or malicious clients exploiting window attacks.
45
What is the benefit of fewer firewall rules?
Reduces misconfiguration and attack opportunities.
46
Why is SO_REUSEADDR significant in Linux?
Must be explicitly set to allow port reuse, enhancing security.
47
What is a DACL on a socket?
Discretionary Access Control List, controlling socket access.
48
How does SST differ from TCP?
Supports structured groups of streams, unlike TCP’s single stream.
49
What is the role of SYN in TCP?
Initiates connection from client to server.
50
What is SYN-ACK in TCP?
Server’s response to client’s SYN, acknowledging connection.
51
What is ACK in TCP?
Client’s final confirmation to establish the connection.
52
Why is a 4-way handshake safer?
Adds an extra step, reducing SYN flood vulnerabilities.
53
What is a high port in networking?
Ports above 1024, often used for client connections.
54
Why is FTP’s connect-back risky?
Allows attacks on any server using high ports if firewall permits.
55
What is the overhead in TCP window attacks?
40 bytes of TCP/IP headers for small data chunks.
56
How can apps manage related streams better?
Use protocols like SCTP or SST for group-level control.
57
Why is binding to specific IPs safer?
Prevents unintended data routing to less specific bindings.
58
What is the default sin_addr value?
INADDR_ANY, listening on all interfaces.
59
Why is server hijacking a threat?
Allows local users to intercept sensitive server data.
60
What is the range of a port number?
0 to 65535, represented as a 16-bit unsigned integer.