Networking
Networking
What are TCP and UDP, and what are the main differences
between them?
Answer:
A subnet mask divides the IP address into the network and host portions.
It helps in determining which part of the address represents the network and which part
represents the host.
Example: IP 192.168.1.10 with subnet mask 255.255.255.0 has a network address of
192.168.1.0.
A MAC address is a unique identifier assigned to a network interface card (NIC) for
communications at the data link layer.
It is essential for local network communication and helps in identifying devices on the
network.
What are the common ports and protocols used for network
services (e.g., HTTP, HTTPS, FTP, SSH)?
Answer:
A firewall is a network security device that monitors and controls incoming and outgoing
network traffic based on predetermined security rules.
It helps protect networks from unauthorized access and attacks by filtering traffic.
NAT translates private IP addresses to a public IP address and vice versa, allowing
multiple devices on a local network to share a single public IP address for accessing the
internet.
It helps conserve the number of public IP addresses used and adds a layer of security.
What are VLANs (Virtual LANs), and why are they used?
Answer:
Switch: Operates at the data link layer, connects devices within the same network, uses
MAC addresses to forward data.
Router: Operates at the network layer, connects different networks, uses IP addresses to
route data.
A VPN creates a secure, encrypted connection over a less secure network, such as the
internet.
It allows remote users to access private networks securely, masking their IP addresses
and encrypting data.
Nmap: Identifies live hosts, open ports, services, and operating systems.
Netcat: Reads and writes data across network connections.
Wireshark: Captures and analyzes network packets.
An attacker intercepts and potentially alters communication between two parties without
their knowledge.
It can be executed using techniques like ARP spoofing, DNS spoofing, or SSL stripping.
Port forwarding redirects communication requests from one address and port number
combination to another.
It allows external devices to access services on a private network.
Packet Sniffers: Tools like Wireshark capture and analyze network packets.
Traffic Analysis: Monitoring network traffic patterns to detect anomalies or malicious
activity.
1. Capture Traffic: Start Wireshark and select the network interface to capture traffic.
2. Filter Traffic: Use display filters to focus on specific types of traffic (e.g., http , tcp.port
== 80 ).
3. Analyze Packets: Inspect packet details, follow TCP streams, and look for anomalies.
Knowledge Application
1. Inspect Packets: Look for unusual patterns, suspicious IP addresses, and anomalies in
packet details.
2. Follow Streams: Follow TCP/UDP streams to see the full conversation and identify
malicious payloads.
3. Use Filters: Apply filters to isolate specific traffic types or known indicators of compromise
(IoCs).
How would you secure a network against DDoS (Distributed
Denial-of-Service) attacks?
Answer:
Stateful Firewall: Tracks the state of active connections and makes decisions based on
the context of traffic. It can monitor and filter traffic based on the state of the connection
(e.g., SYN/ACK packets in a TCP connection).
Stateless Firewall: Filters traffic based on fixed criteria such as IP addresses and port
numbers, without considering the state of the connection. It treats each packet in isolation.
Proxy ARP: Allows a router to answer ARP requests on behalf of another device. This
means that the router responds to ARP requests intended for devices on a different
network segment, making them appear as if they are on the local network.
DNS Spoofing: An attack where corrupt DNS data is inserted into the DNS resolver's
cache, redirecting traffic to malicious sites.
Mitigation:
Use DNSSEC (DNS Security Extensions) to authenticate DNS data.
Implement secure network configurations and firewalls.
Regularly monitor and audit DNS servers.
SSL/TLS: Protocols for establishing encrypted links between web servers and browsers,
ensuring secure data transmission.
How It Works: Uses asymmetric cryptography for key exchange, symmetric encryption for
data transfer, and message integrity checks.
Importance: Protects sensitive data from eavesdropping, tampering, and forgery during
transmission over the internet.
Explain the purpose of DMZ (Demilitarized Zone) in network
security.
Answer:
DMZ: A physical or logical subnet that separates an internal local area network (LAN) from
untrusted external networks (e.g., the internet).
Purpose: Hosts external-facing services (e.g., web servers, email servers) while keeping
the internal network secure from potential attacks.
Symmetric Encryption: Uses the same key for both encryption and decryption. Faster
but requires secure key exchange.
Asymmetric Encryption: Uses a pair of keys (public and private). The public key encrypts
the data, and the private key decrypts it. More secure for key exchange but slower.
What are GRE tunnels, and when would you use them?
Answer:
802.1X: A network access control protocol for securing wired and wireless networks.
How It Works: Uses EAP (Extensible Authentication Protocol) for authenticating devices
before granting network access.
Importance: Prevents unauthorized devices from connecting to the network, enhancing
security.
Network Segmentation: Divides a network into smaller segments, each isolated from
others.
Benefits:
Security: Limits the spread of malware and unauthorized access.
Performance: Reduces congestion and improves performance by limiting broadcast
traffic.
Management: Simplifies network management and compliance.
SIEM: Aggregates and analyzes security events and logs from multiple sources.
Benefits:
Centralized Monitoring: Provides a unified view of security events.
Threat Detection: Identifies and alerts on suspicious activities.
Incident Response: Facilitates faster and more effective response to security
incidents.
MPLS: Directs data from one network node to the next based on short path labels rather
than long network addresses.
Improvements:
Efficiency: Reduces the need for complex lookups in a routing table.
Performance: Provides predictable and consistent network performance.
Scalability: Supports a large number of VPNs and traffic engineering.
Zero Trust: A security model that assumes no implicit trust for any user, device, or system,
whether inside or outside the network perimeter.
Principles:
Verify Explicitly: Always authenticate and authorize based on all available data
points.
Least Privilege Access: Limit user access to only what is necessary.
Assume Breach: Continuously monitor and validate security posture.
WEP (Wired Equivalent Privacy): An older, insecure protocol. Uses RC4 encryption.
WPA (Wi-Fi Protected Access): Improved security over WEP, uses TKIP (Temporal Key
Integrity Protocol).
WPA2: Further improved security, uses AES (Advanced Encryption Standard).
WPA3: Latest standard, offers enhanced security features like SAE (Simultaneous
Authentication of Equals) for better key management.
BGP Hijacking: An attacker maliciously reroutes internet traffic by corrupting the Border
Gateway Protocol (BGP) routing tables, either by announcing unauthorized prefixes or by
impersonating a legitimate AS (Autonomous System).
Implications: Can lead to man-in-the-middle attacks, traffic interception, and disruption of
internet services, affecting the reliability and security of global internet routing.
NDP:The IPv6 Neighbor Discovery Protocol (NDP) is a protocol used to discover and
configure neighboring devices on an IPv6 network. It operates at the internet layer and
provides functionality similar to Address Resolution Protocol (ARP) and Internet Control
Message Protocol (ICMP) Router Discovery and Router Redirect protocols in IPv4
NDP Attack: Exploits vulnerabilities in the IPv6 Neighbor Discovery Protocol, such as
spoofing Neighbor Advertisement messages to intercept or disrupt traffic.
Prevention:
Use Secure Neighbor Discovery (SEND) to cryptographically protect NDP messages.
Implement RA (Router Advertisement) Guard to filter malicious RA messages.
Use Network Protection Devices that can detect and mitigate NDP spoofing.
MPLS-TE: Uses MPLS labels(a 32-bit identifier assigned to each data packet in an MPLS
network) to route traffic along pre-determined, optimized paths, based on network
performance metrics rather than shortest path algorithms.
Improvements:
Balances network load by avoiding congested paths.
Provides predictable and efficient use of network resources.
Enhances QoS (Quality of Service) by guaranteeing bandwidth for critical
applications.
SYN Flood Attack: A type of DDoS attack that exploits the TCP three-way handshake by
sending numerous SYN requests to a target server without completing the handshake,
exhausting server resources.
Mitigation:
Use SYN cookies to handle half-open connections without consuming resources.
Implement rate limiting to restrict the number of SYN requests.
Deploy DDoS protection services to filter malicious traffic.
Anycast Routing: Uses the same IP address for multiple geographically dispersed
servers, routing client requests to the nearest server.
Enhancements:
Reduces latency by serving clients from the nearest location.
Improves reliability by providing multiple points of failure; if one server goes down,
traffic is rerouted to the next closest server.
Distributes load more evenly across servers, preventing bottlenecks.
Challenges:
Centralized Control: The SDN controller becomes a single point of failure and an
attractive target for attacks.
API Security: The northbound and southbound APIs can be vulnerable to attacks if
not properly secured.
Network Visibility: Lack of visibility into the virtualized infrastructure can hinder
security monitoring.
Addressing Challenges:
Implement redundancy and high availability for the SDN controller.
Secure APIs with strong authentication, authorization, and encryption.
Use advanced monitoring and logging tools to maintain visibility and detect anomalies
in the SDN environment.
DPI: A technique that examines the data part (and possibly the header) of a packet as it
passes an inspection point, searching for protocol non-compliance, viruses, spam,
intrusions, or other defined criteria.
Role in Security:
Identifies and blocks malicious traffic in real-time.
Enhances intrusion detection and prevention by analyzing the content of network
packets.
Enforces security policies based on content rather than just headers.
How does network function virtualization (NFV) transform
traditional network architecture?
Answer:
NFV: Uses virtualization technologies to decouple network functions (e.g., firewalls, load
balancers, routers) from proprietary hardware appliances, allowing them to run on virtual
machines.
Transformations:
Reduces capital and operational expenses by using commodity hardware.
Increases agility and scalability by enabling rapid deployment and reconfiguration of
network services.
Enhances network management through centralized orchestration and automation.
CASB: A security policy enforcement point placed between cloud service users and cloud
applications to apply security policies as users access cloud resources.
Functions:
Provides visibility into cloud application usage.
Enforces security policies for data loss prevention (DLP), access control, and
compliance.
Detects and mitigates threats by monitoring user behavior and cloud activity.
Benefits:
Enhances security by extending on-premises security policies to cloud applications.
Ensures compliance with regulatory requirements.
Protects against data breaches and unauthorized access to cloud resources.
SASE: A security framework that converges networking and security functions into a single
cloud-delivered service model.
Revolutionary Aspects:
Integrates SD-WAN, CASB, FWaaS (Firewall as a Service), and zero-trust network
access (ZTNA) into one solution.
Provides consistent security policies across all users and devices, regardless of
location.
Simplifies network management by reducing the need for multiple security appliances
and services.
IP Fragmentation: The process of breaking down large IP packets into smaller fragments
to accommodate the maximum transmission unit (MTU) of the underlying network.
Security Risks:
Fragmentation attacks (e.g., fragmentation overlap attacks) can evade detection by
IDS/IPS systems.
Reassembly attacks can exploit vulnerabilities in the reassembly process of the target
system.
Overlapping fragments can lead to buffer overflow vulnerabilities.
Detection Techniques:
Implement User and Entity Behavior Analytics (UEBA) to identify abnormal behavior
patterns.
Monitor for privileged account misuse and unusual access to sensitive data.
Use data loss prevention (DLP) tools to detect unauthorized data transfers.
Mitigation Techniques:
Enforce the principle of least privilege and regularly review access controls.
Conduct regular security awareness training for employees.
Implement robust logging and monitoring to track user activities and detect
suspicious actions.
Network Slicing: The ability to create multiple virtual networks on a shared physical
infrastructure, each tailored to meet specific service requirements.
Security Implications:
Ensures isolation between different network slices to prevent cross-slice attacks.
Requires robust slice-specific security policies and mechanisms.
Enhances security by allowing dedicated slices for critical applications, reducing the
attack surface.
Threat: Quantum computers can efficiently solve problems that are infeasible for classical
computers, potentially breaking widely used cryptographic algorithms like RSA and ECC.
Countermeasures:
Develop and deploy quantum-resistant algorithms (post-quantum cryptography).
Use quantum key distribution (QKD) for secure key exchange.
Transition to cryptographic schemes that rely on hard problems for both classical and
quantum computers.