What Is a Network and How Do You Prevent Hacker Attacks on It?

Security is often overlooked on connected devices. When working with networks, it's critical to understand how network traffic flows and what types of threats may try to infiltrate your system. The first step to securing any network is understanding its architecture. In order to protect your organization's infrastructure, you need to know where data enters your network and where it exits. Once you have determined this information, you'll have a good idea of where to monitor for potential attacks and vulnerabilities.

Aug 29, 2022 - 01:35
Updated: 13 days ago
101.9k
What Is a Network and How Do You Prevent Hacker Attacks on It?

Quick answer: A network is a group of connected devices that share data using agreed rules called protocols. Hackers attack networks through denial of service, man-in-the-middle and sniffing, phishing, malware, password guessing and unpatched flaws. You prevent most of it with patching, firewalls, encryption, strong authentication, network segmentation, monitoring with an IDS or IPS, tested backups and trained users.

Key takeaways

  • A network is devices plus links plus protocols. Models such as OSI and TCP/IP describe how those protocols are layered; they are not protocols you "choose between".
  • TCP is reliable and connection-based. UDP is connectionless and does not retransmit lost packets. Both run over IP.
  • An IDS is a defence that detects suspicious activity. It is not an attack. An IPS goes further and blocks it.
  • Common attacks are DoS and DDoS, man-in-the-middle, sniffing, spoofing, phishing, malware and password attacks.
  • Defence works in layers: patching, firewalls, encryption, MFA, segmentation, monitoring, backups and training.

What is a network?

A network is two or more devices connected so they can exchange data. The devices can be computers, phones, printers, servers or sensors. They connect by cables or wireless links through switches, routers and access points. A small network in one building is a LAN. A network that spans cities or countries is a WAN, and the internet is the largest WAN, made from many networks joined together.

For devices to understand each other they need shared rules, and those rules are protocols. A protocol defines the format and order of messages, for example how a browser asks for a page (HTTP) or how a name is turned into an address (DNS).

Protocols and models: a quick, correct overview

OSI and TCP/IP are reference models, and UDP is one protocol within TCP/IP, so they are not three types of protocol. Here is the right picture.

  • The OSI model is a seven-layer reference model from ISO: Physical, Data Link, Network, Transport, Session, Presentation, Application. It is a way to think and talk about where a function belongs, and is used mostly for teaching and troubleshooting.
  • The TCP/IP model is the practical four- or five-layer model the internet is built on: link, internet (IP), transport (TCP or UDP) and application.
  • TCP (Transmission Control Protocol) sets up a connection, numbers the data, acknowledges it and retransmits anything lost. It is reliable and used for web, email and file transfer.
  • UDP (User Datagram Protocol) sends independent packets with no connection and no retransmission. It is lighter and faster to start, and suits DNS queries, voice and video, where a late packet is useless. If reliability is needed on top of UDP, the application must provide it.

Our guides to the TCP/IP model and common network protocols go further.

Common network attacks, how they work and how to stop them

Understanding an attack is how defenders learn what to block and what to log. The table gives the essentials, and the sections after it explain the main ones.

AttackWhat it doesMain defences
Denial of service (DoS) and distributed DoS (DDoS)Overwhelms a service with requests so legitimate users cannot reach it. A DDoS uses many compromised machines at once.Rate limiting, upstream DDoS protection or a CDN, redundancy, capacity planning
Man-in-the-middle (MITM)An attacker positions themselves between two parties to read or alter their trafficTLS everywhere, certificate checks, secure Wi-Fi, ARP inspection on switches
SniffingCapturing traffic on a network to read cleartext data such as passwordsEncrypt traffic, use switched networks, avoid cleartext protocols
Spoofing (ARP, DNS, IP)Forging addresses or replies so traffic goes somewhere it should notDynamic ARP inspection, DNSSEC, ingress filtering, secure DNS resolvers
Phishing and social engineeringTricks a person into giving credentials or running malwareUser training, email filtering, MFA, reporting channels
Malware and ransomwareSoftware that steals, damages or encrypts dataPatching, endpoint protection, least privilege, offline backups
Password attacksGuessing or reusing credentials, including brute force and credential stuffingStrong unique passwords, MFA, account lockout, rate limits
Exploiting unpatched vulnerabilitiesUsing a known flaw in software or a devicePatch management, vulnerability scanning, removing unused services
Rogue access point or evil twinA fake Wi-Fi network that lures users to connect802.1X, wireless intrusion detection, user awareness

Denial of service and DDoS

DoS is not the "oldest" or the only attack; it is simply one that attacks availability instead of secrecy. A single machine flooding a server is DoS. When thousands of infected machines, a botnet, do it together, it is DDoS and far harder to block by address alone. Mitigation usually happens upstream, at the ISP or a DDoS protection service, because by the time the flood reaches your firewall your link may already be full.

Man-in-the-middle and sniffing

These are separate. Sniffing is passive: the attacker only listens, which works when traffic is unencrypted and the attacker can see it, for example on an open Wi-Fi network or through a compromised switch port. MITM is active: the attacker intercepts and may change messages, often by ARP spoofing on a LAN or by running a fake access point. Using HTTPS, SSH and VPNs makes both far less useful to an attacker, because intercepted data is encrypted. A browser warning about a certificate is often the first sign of a MITM attempt, so never click through it.

Spoofing

Network protocols were designed in a more trusting era. ARP has no authentication, so a device can claim an address that is not its own. On managed switches, features such as dynamic ARP inspection and DHCP snooping block this. Attackers also forge DNS answers to send users to fake sites, which DNSSEC and trusted resolvers help prevent.

Phishing, malware and passwords

These attack people and endpoints, not network protocols, but they are how most real intrusions begin. A user opens an attachment, malware runs and the attacker is inside. That is why network security cannot be separated from endpoint security and user training.

What is an IDS and an IPS?

An Intrusion Detection System (IDS) monitors traffic or hosts for suspicious behaviour and raises alerts. An Intrusion Prevention System (IPS) sits in line with traffic and can also block what it detects. Earlier text on this page called IDS an attack, which is the opposite of the truth: it is a defence.

  • Network-based (NIDS/NIPS): watches traffic on a network segment, usually at a boundary or a mirrored switch port. It looks at packets at the network, transport and application layers.
  • Host-based (HIDS/HIPS): runs on a single server or workstation, watching logs, files, processes and system calls.
  • Signature-based detection matches known attack patterns. Anomaly-based detection flags traffic that differs from a normal baseline. Signatures are precise but miss new attacks; anomaly detection can find new ones but raises more false alarms.

How to prevent network attacks: a layered approach

  1. Patch regularly. Keep operating systems, network devices and applications updated. Track known flaws in the National Vulnerability Database for the software you run.
  2. Use firewalls and default-deny rules. Allow only the traffic a system needs, and close unused ports.
  3. Segment the network. Put servers, staff, guests and IoT devices in separate VLANs or zones, so one compromised device cannot reach everything.
  4. Encrypt in transit. Use TLS, SSH and VPNs, and WPA2 or WPA3 for Wi-Fi. Retire Telnet, FTP and plain HTTP.
  5. Use strong authentication. Multi-factor authentication and unique passwords stop most credential attacks.
  6. Apply least privilege. Users and services get only the access they need.
  7. Monitor and log. Send logs from firewalls, servers and devices to a central place, deploy an IDS or IPS, and have someone review alerts.
  8. Back up and test restores. Keep an offline copy, so ransomware cannot encrypt your only backup.
  9. Train people. Phishing awareness and a simple way to report something suspicious are among the highest-value defences.
  10. Scan and assess regularly. Vulnerability assessments find weaknesses before attackers do.

Frameworks help organise this. The NIST Cybersecurity Framework groups security work into functions such as identify, protect, detect, respond and recover, and MITRE ATT&CK catalogues the techniques real attackers use, which is valuable when you design detections.

A note on testing and the law

Security professionals test networks to find weaknesses, but only with written authorisation from the owner. In India, accessing or disrupting a computer system without permission is an offence under the Information Technology Act, 2000, even if you meant no harm. Practise in your own lab on virtual machines you control, and report real incidents to the organisation concerned and to CERT-In.

Next steps

Build a small lab with two virtual machines and a virtual switch, capture traffic, and see TCP and UDP for yourself. To learn network defence and testing properly, see the Certified Ethical Hacking CEH v13 AI course, which is built around the current CEH v13 version, or start with the computer networking course. For further reading, see networking protocols for beginners.

Related reading

Frequently Asked Questions

A computer network is a set of connected devices that exchange data using shared rules called protocols. It can be a LAN in one building, a WAN across cities, or the internet, which joins many networks together.

TCP sets up a connection, numbers and acknowledges data and retransmits lost packets, so it is reliable. UDP sends independent packets with no connection or retransmission, so it is faster and lighter, which suits DNS, voice and video.

Common ones are denial of service and DDoS, man-in-the-middle, sniffing, spoofing, phishing, malware and ransomware, password attacks, and exploitation of unpatched vulnerabilities. Most real intrusions start with phishing or a known flaw.

An IDS monitors traffic or hosts and alerts on suspicious activity. An IPS sits in line and can also block that activity. Both are defensive tools, and both can be network-based or host-based.

Patch systems, use firewalls with default-deny rules, segment the network, encrypt traffic, enforce multi-factor authentication, apply least privilege, monitor logs and alerts, keep tested offline backups and train users to spot phishing.

A DoS attack floods a target from one source to make it unavailable. A DDoS attack uses many compromised machines at once, so it is harder to block by address and usually needs upstream protection from an ISP or a DDoS service.

Only with written authorisation from the owner. In India, unauthorised access to a computer system is an offence under the Information Technology Act, 2000, regardless of intent. Practise in your own virtual lab instead.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Aayushi Sinha

With a passion for staying on the cutting edge of technology trends, I am dedicated to delivering content that not only informs but also inspires. Whether you need in-depth analysis pieces, informative guides, or thought-provoking opinion pieces, I craft content that resonates with tech enthusiasts and professionals alike.