18: Malware and its Network Behaviour
Course: Networking - Security Advanced · Updated: October 2026 Literature: NF chapter 12 (Malware Forensics), including the case study in 12.4. Focus on the techniques and functionality, not on the names of individual malware. Related lecture: Presentation: Network forensics
Learning objectives
After studying this article you can:
- explain why malware forensics matters for network security
- describe how malware spreads over the network (propagation)
- describe how malware is controlled (command and control, C2) and how it has evolved
- explain the techniques malware uses to evade detection (encryption, fast-flux, DGAs, use of legitimate services)
- explain how malware exfiltrates data, and the network behaviour of ransomware and botnets
- explain how network analysis is used to detect malware and build indicators of compromise
- use the MITRE ATT&CK framework to describe malware behaviour
1. Why malware forensics?
- Understanding malware and the vulnerabilities it uses makes it possible to create antivirus and IDS signatures.
- Determining the scope of an infection: which systems are infected, how did it get in, what did it do?
- Identifying the attacker and their goals (criminal, espionage, sabotage).
- Finding the C2 infrastructure so it can be blocked, and sometimes taken down by law enforcement.
Malware that runs on a host almost always communicates over the network: to spread, receive commands, download extra modules or send stolen data. That makes network analysis one of the best ways to detect malware, even when it is invisible on the host.
2. Types of malware (overview)
| Type | Main behaviour |
|---|---|
| Virus | Attaches itself to other files and needs user action to spread |
| Worm | Spreads itself over the network by exploiting vulnerabilities |
| Trojan | Pretends to be legitimate software |
| Backdoor / RAT (Remote Access Trojan) | Gives the attacker remote control |
| Bot / botnet | A network of infected devices under central control, used for DDoS, spam, fraud and proxies |
| Ransomware | Encrypts data and demands a ransom. Today it usually steals data first too (double extortion). |
| Infostealer | Steals passwords, session cookies and crypto wallets (e.g. RedLine, Lumma) |
| Loader / dropper | Installs other malware. Often the first stage. |
| Rootkit / bootkit / firmware implant | Hides itself deep in the system (including on network devices, e.g. COATHANGER, see article 14) |
| Wiper | Destroys data (e.g. NotPetya, the wipers used against Ukraine, see article 19) |
3. Propagation: how does malware spread?
| Method | Network behaviour | Examples |
|---|---|---|
| Attachments (Office documents, PDF, ZIP/ISO/LNK files), links to malicious sites | Emotet, Qakbot, most phishing campaigns | |
| Web links and content | Drive-by downloads, malicious ads (malvertising), fake updates ("your browser is out of date"), SEO poisoning, fake CAPTCHAs that ask the user to paste a command (ClickFix, 2024–2025) | SocGholish, Lumma Stealer |
| Network shares | Copying itself to accessible SMB shares (\\server\share) |
Conficker, many ransomware groups |
| Direct network-based exploitation | Scanning and exploiting vulnerable services without user action: wormable | WannaCry (2017, EternalBlue/SMBv1), Mirai (IoT, Telnet with default passwords) |
| Removable media | USB sticks | Stuxnet (see article 19), Raspberry Robin |
| Supply chain | Through trusted software updates or packages | SolarWinds (2020), NotPetya (via M.E.Doc, 2017), 3CX (2023), the XZ Utils backdoor (2024, discovered just in time), malicious npm/PyPI packages |
| Lateral movement | Inside a network: RDP, SMB/PsExec, WMI, WinRM, SSH, using stolen credentials | Almost all human-operated ransomware |
Network signatures of propagation
- Scanning: many connection attempts to the same port across many IP addresses (horizontal scan), or many ports on one IP address (vertical scan)
- Sudden increases in SMB, RDP or SSH traffic between workstations (which normally don't talk to each other)
- Exploit traffic that matches IDS signatures
4. Command and control (C2)
Once malware is installed, it needs instructions from the attacker. C2 has evolved:
| Generation | Technique | Detection |
|---|---|---|
| IRC | Bots join an IRC channel and receive commands | Easy: IRC traffic is unusual in companies |
| HTTP(S) | Malware polls a web server regularly ("beaconing"), and commands are hidden in normal-looking web traffic | Beaconing patterns (regular intervals), odd user agents, new domains |
| Peer-to-peer | No central server: bots talk to each other (e.g. GameOver Zeus, Storm) | Harder to take down, but P2P traffic stands out |
| DNS tunnelling | Commands and data in DNS queries and answers (a8f3k2.evil.com TXT) |
Long, random subdomains, high DNS volumes, many TXT queries |
| Legitimate cloud services | C2 via Telegram, Discord, GitHub, Google Drive, Dropbox, Microsoft Graph/OneDrive, Slack, Notion | Very hard: the traffic goes to trusted domains over TLS |
| C2 frameworks | Cobalt Strike, Sliver, Brute Ratel, Havoc, Mythic: originally red-team tools, also widely abused by criminals | Known JA3/JA4 fingerprints, default certificates and profiles. Europol and Microsoft took down many cracked Cobalt Strike servers (Operation Morpheus, 2024). |
Techniques to evade detection
- Encryption (TLS), so the content is invisible to the IDS
- Domain Generation Algorithms (DGA): the malware generates hundreds of new domain names a day (
xk2j9fhq.com). The attacker only needs to register one of them, so blocking individual domains is useless. - Fast-flux DNS: a domain name points to quickly changing IP addresses, often of infected systems that act as proxies
- Domain fronting and CDNs: hiding the real destination behind a large, trusted CDN
- Jitter: random variation in the beacon interval so that patterns are harder to see
- Living off the land: using built-in tools (PowerShell,
certutil,bitsadmin, RDP) and legitimate remote-management software (AnyDesk, ScreenConnect, TeamViewer) - Residential proxies and compromised routers (ORB networks, used by Chinese state actors) to hide the attacker's real origin
5. Data exfiltration
How does stolen data leave the network?
- Over the C2 channel itself (HTTPS, DNS)
- Cloud storage tools:
rcloneto MEGA, Dropbox or S3. This is very common in ransomware attacks (double extortion). - FTP/SFTP, e-mail, or exfiltration tools (e.g. StealBit, ExMatter)
- Hidden in allowed protocols: DNS, ICMP, even NTP
Network signs: large or unusual outgoing volumes (asymmetric flows), connections to cloud storage from servers that never use it, transfers outside working hours, and rare destination countries.
6. The network behaviour of ransomware (2026)
Modern ransomware attacks are human-operated, and they take days to weeks:
1 2 3 4 5 6 7 8 9 | |
Every step leaves network traces. The earlier they are detected, the smaller the damage. Well-known groups and services (2023–2026): LockBit (disrupted by Operation Cronos, 2024, with Dutch police involvement), BlackCat/ALPHV, Cl0p (MOVEit, 2023), Akira, Play, RansomHub, Qilin, Scattered Spider (social engineering).
7. Botnets
- IoT botnets (Mirai and its descendants) use cameras, routers and DVRs with default passwords or unpatched vulnerabilities. They carry out record DDoS attacks (several terabits per second in 2024–2025).
- Takedowns: international operations, often with Dutch involvement (NCSC, the Police / Team High Tech Crime, Europol in The Hague): Emotet (2021), Qakbot (2023, Duck Hunt), and Operation Endgame (2024–2025, the largest operation against droppers and loaders so far).
8. Detecting malware on the network
| Technique | Description |
|---|---|
| Signatures | IDS rules for known malware traffic (Suricata + ET rules, Snort + Talos) |
| Indicators of Compromise (IoCs) | Known malicious IPs, domains, URLs, file hashes, JA3/JA4 fingerprints (threat feeds: abuse.ch, MISP, AlienVault OTX) |
| DNS analysis | Newly registered domains, DGA-like names, DNS tunnelling, queries for known C2 domains. A protective DNS resolver blocks known bad domains. |
| Beaconing detection | Regular connections to the same destination (tools: RITA, AC-Hunter, Zeek scripts) |
| TLS metadata | Self-signed or unusual certificates, JA4 fingerprints of malware families, SNI mismatches |
| Behavioural / anomaly detection | Unusual internal connections, new protocols, large uploads (NDR) |
| Sandboxing | Run suspicious files in an isolated environment and record their network behaviour (ANY.RUN, Joe Sandbox, CAPE, Hybrid Analysis) |
Mapping to MITRE ATT&CK: describe the behaviour you observe using standard techniques, e.g. T1071.001 Application Layer Protocol: Web Protocols, T1071.004 DNS, T1568.002 Domain Generation Algorithms, T1048 Exfiltration Over Alternative Protocol, T1021.001 Remote Services: RDP. This makes it easier to compare attacks and check your detection coverage.
9. Summary
- Malware almost always communicates over the network, to spread, receive commands, and exfiltrate data.
- Propagation: e-mail, the web, network shares, direct exploitation (worms), supply chain, lateral movement.
- C2 has gone from IRC to HTTPS, DNS, P2P and legitimate cloud services, with evasion through encryption, DGA and fast-flux.
- Ransomware is now a multi-step, human-operated attack with data theft before encryption.
- Detection combines signatures, IoCs, DNS analysis, beaconing detection, TLS metadata and behavioural analysis. MITRE ATT&CK gives a common language.
References
Videos
- John Hammond: malware analysis and threat-hunting videos: https://www.youtube.com/@_JohnHammond
- OALabs: malware reverse engineering and analysis: https://www.youtube.com/@OALABS
- Black Hills Information Security / Active Countermeasures: webcasts on C2 detection and beaconing: https://www.youtube.com/@BlackHillsInformationSecurity
- Darknet Diaries (podcast with true stories about malware and hacks, e.g. NotPetya, Mirai): https://darknetdiaries.com/
- Computerphile: "WannaCry", "Botnets", "Mirai": https://www.youtube.com/@Computerphile
Articles and books
- Davidoff & Ham, Network Forensics, chapter 12 (Malware Forensics)
- Antonakakis et al., Understanding the Mirai Botnet (USENIX Security 2017): https://www.usenix.org/conference/usenixsecurity17/technical-sessions/presentation/antonakakis
- Andy Greenberg, Sandworm (Doubleday, 2019): the story of NotPetya and Russian cyberattacks
- The DFIR Report (detailed real-world intrusion reports with timelines): https://thedfirreport.com/
- Europol, Internet Organised Crime Threat Assessment (IOCTA): https://www.europol.europa.eu/publications-events/main-reports/iocta-report
- ENISA Threat Landscape (yearly): https://www.enisa.europa.eu/topics/cyber-threats/threat-landscape
- NCTV, Cybersecuritybeeld Nederland (CSBN) (the yearly Dutch threat assessment): https://www.nctv.nl/
Frameworks
- MITRE ATT&CK: https://attack.mitre.org/
- Cyber Kill Chain (Lockheed Martin): https://www.lockheedmartin.com/en-us/capabilities/cyber/cyber-kill-chain.html
Tools and data (analyse malware only in an isolated lab!)
- abuse.ch: URLhaus, MalwareBazaar, ThreatFox, Feodo Tracker (free threat intelligence): https://abuse.ch/
- VirusTotal: https://www.virustotal.com/
- ANY.RUN (interactive sandbox): https://any.run/
- Malware-Traffic-Analysis.net (PCAPs of real infections): https://www.malware-traffic-analysis.net/
- RITA (beacon detection on Zeek logs): https://github.com/activecm/rita
- REMnux (Linux toolkit for malware analysis): https://remnux.org/
Cyber Security
Why it matters
Malware is the weapon in almost every cyberattack, whether criminal, espionage or sabotage. The impact in recent years:
- Ransomware has hit hospitals, municipalities, universities and businesses. In the Netherlands, Maastricht University (2019) paid a ransom of about €200,000 (the bitcoins were later partly recovered and grew in value), the municipality of Lochem was hit, and so were many SMEs. Recovery costs are usually far higher than the ransom.
- Supply-chain attacks spread malware through trusted channels to thousands of organisations at once.
- Infostealers feed a criminal market in stolen credentials and session cookies, which leads to account takeovers and further attacks.
- IoT botnets carry out DDoS attacks that can take down almost any service.
- AI is making phishing and malware development cheaper and more convincing (e.g. LLM-generated phishing and deepfake voices).
- Detection is harder: encrypted C2, legitimate cloud services and living-off-the-land techniques mean classic antivirus and signature IDS are not enough.
How to make it safe
- Prevent initial access: patch quickly (especially edge devices, see the CISA KEV catalogue), MFA everywhere, e-mail filtering (block dangerous attachment types: ISO, LNK, macros from the Internet), and user awareness.
- Reduce the attack surface: disable SMBv1, don't expose RDP to the Internet, block macros, application allow-listing, and restrict PowerShell for normal users.
- Use EDR on all endpoints and servers, and keep it monitored (24/7 SOC or MDR service).
- Segment the network and restrict lateral movement: workstations don't need to talk to each other over SMB/RDP (see article 09).
- Filter egress traffic: default deny outbound, and use a proxy for web traffic, protective DNS (e.g. Quad9, or a commercial DNS firewall), and block known C2 IPs and domains with threat feeds.
- Monitor the network for beaconing, DNS anomalies, unusual uploads and new internal connections (Zeek, Suricata, NDR, SIEM).
- Keep backups following the 3-2-1-1-0 rule: 3 copies, 2 media, 1 off-site, 1 offline/immutable, 0 errors in restore tests. Practise restoring.
- Prepare incident response: an IR plan, contact details (NCSC, police, cyber insurer, IR company), ransomware playbooks, and decisions on paying a ransom (the Dutch government advises against paying).
- Secure the supply chain: check software sources, use SBOMs, monitor vendors, and restrict update channels.
- Share information: report incidents to NCSC/CSIRT, and join an ISAC (Information Sharing and Analysis Centre) for your sector.
Extra references
- No More Ransom (free decryptors, initiated by the Dutch police, Europol and others): https://www.nomoreransom.org/
- CISA, #StopRansomware Guide: https://www.cisa.gov/stopransomware
- NCSC-NL, Ransomware: wat te doen? and Factsheet: Back-ups: https://www.ncsc.nl/
- Digital Trust Center (NL, advice for small and medium businesses): https://www.digitaltrustcenter.nl/
- Maastricht University, Reflection on the cyber attack (2020, with the Fox-IT investigation report): https://www.maastrichtuniversity.nl/
- Microsoft Digital Defense Report (yearly): https://www.microsoft.com/en-us/security/security-insider/intelligence-reports