Guide Guides
Your server was exposed to an exploited vulnerability: how to check for compromise and what to do in the first hour
The vendor has just confirmed that a flaw in your VPN, web server or CMS is being exploited, and you know you were vulnerable. Patching is only half the job: if an attacker got in first, the patch won't throw them out. This guide for administrators covers what to preserve before you change anything, where to look for traces on Linux and Windows, and which mistakes to avoid according to joint guidance from CISA, the UK NCSC and their partners.
Key points
- Treat an internet-facing system that was vulnerable while a flaw was being exploited as possibly compromised until a check shows otherwise. A patch alone does not remove an attacker who is already inside.
- Preserve evidence first (logs, running processes, network connections, a disk or VM snapshot), then remediate. Rebooting or reinstalling without a copy destroys the evidence.
- Look for new accounts, SSH keys, scheduled tasks, web shells and outbound connections. Take specific indicators from the vendor's advisory.
- If you confirm a compromise, isolate the system, bring in incident response specialists and check your reporting obligations (data protection authority within 72 hours for personal data breaches, national CSIRT or regulator if you are a regulated entity).
Starting assumption: you were vulnerable, so you may be compromised
When a vendor or CISA announces that a flaw is being exploited, attackers usually scan the internet at scale and try every vulnerable system they find. If your server was reachable from the internet and unpatched while the flaw was being exploited, treat it as possibly compromised until a check shows otherwise. From our SOC experience, the most time is lost when a server is "just patched and rebooted" and a month later the web shell from day one turns out to still be there.
This guide covers the first hour – until you know whether you have an incident or just a patch to apply. It does not replace professional incident response in a larger organisation.
Step 1: Don't start by patching – preserve the evidence first
The joint advisory from the cyber security authorities of the United States, United Kingdom, Canada, Australia and New Zealand (AA20-245A) is clear: first collect and set aside artefacts, logs and data for analysis, and only then take mitigation steps – in a way that does not tip off the adversary. In practice:
- Snapshot the VM or disk if the server runs on a hypervisor or in the cloud. It is the fastest and most complete copy of the current state.
- Capture volatile state while the server is still running – it is gone after a reboot. On Linux, save the output to a file off the server (not onto the disk you are about to examine):
date -u; uname -a; uptime ps auxwwf ss -tupan last -Faiw; lastb -Faiw | head -50 who -a - Logs: all of
/var/logandjournalctl --since "<disclosure date minus 14 days>", web server and application logs, VPN and firewall logs. Check your retention – log rotation may delete them before you get to them. - On Windows, export the Security, System and PowerShell/Operational event logs plus process and connection lists. Our Windows Event ID lookup explains what individual event IDs mean.
Hash the files you collect (SHA-256) so you can later show they have not changed – our hash calculator or sha256sum will do.
Step 2: Where to look
Start with the indicators of compromise (IOCs) in the vendor's advisory and in research write-ups: file paths, process names, IP addresses, user agents, characteristic requests in logs. They are the most precise. Our IOC extractor turns an advisory into a clean list. Then go through the general places attackers persist. AA20-245A lists them: running processes and services, parent-child process trees, local and domain users, unusual authentications, listening ports, DNS settings and static routes, established connections, persistence mechanisms, scheduled tasks, event logs and antivirus detections. On Linux, that means:
| What to look for | Where and how | Suspicious signs |
|---|---|---|
| Web shell | files in the web root modified since the exploitation date: find /var/www -type f -newermt "YYYY-MM-DD" -ls |
scripts (.php, .jsp, .aspx) with random names, in upload directories, with functions that run commands |
| New accounts | /etc/passwd, /etc/group (sudo/wheel groups), /etc/sudoers.d/ |
an account nobody created, UID 0 on anything other than root |
| SSH keys | ~/.ssh/authorized_keys for every user, including root |
a key nobody recognises, a change during the exploitation window |
| Persistence | crontab -l for every account, /etc/cron*, systemctl list-unit-files --state=enabled, /etc/systemd/system/, /etc/ld.so.preload |
a new service or job that downloads a script from the internet, a non-empty ld.so.preload |
| Processes and connections | the ps and ss output from step 1 |
the web server process as the parent of a shell (bash, sh), outbound connections to unknown addresses, cryptomining with high CPU load |
| Web and application logs | access logs from the disclosure date (and a few days before) | requests to the vulnerable path named in the advisory, 200 responses where you expect errors, new files requested by only a handful of IPs |
Log timestamps come in different formats and time zones – our timestamp converter normalises them. On appliances such as VPNs, firewalls or NAS devices you often have no shell; follow the vendor's check tool or procedure (for example an integrity checker) and export logs from the management interface.
Don't trust tools on the compromised system. If the attacker gained root, they may have replaced commands such as ps or ls. Examining a disk snapshot mounted read-only on a separate, clean system is more reliable.
Step 3: Mistakes that help the attacker
AA20-245A lists common incident handling mistakes. Our SOC experience confirms every one of them:
- Remediating or rebuilding before the data is preserved – you lose the evidence and the chance to see where the attacker went next.
- Touching adversary infrastructure – pinging, running DNS lookups or browsing to attacker addresses from your network. The attacker may see it. Check suspicious links in reputation services, such as our Link checker, rather than connecting directly.
- Pre-emptively blocking attacker IPs and domains – they will switch infrastructure and you lose visibility.
- Pre-emptive credential resets – if the attacker holds other accounts or directory access, you only warn them.
- Failing to preserve logs that show how the attacker reached other systems.
- Communicating over the compromised network (corporate email, chat) when the attacker may have access to the mailbox. Use an out-of-band channel for incident response.
- Fixing the symptom, not the root cause – deleting the web shell but not closing the vulnerability or checking what happened next.
Step 4: If you find a compromise
- Isolate the system from the network while keeping it running (network isolation in the hypervisor or EDR, firewall rules), unless that causes greater harm. Powering off loses memory contents.
- Bring in incident response specialists. AA20-245A explicitly recommends considering a third-party team to help remove the attacker fully and avoid re-compromise.
- Establish the scope: which secrets the server could reach (database passwords, API keys, cloud credentials, certificates). Rotate them as part of the clean-up – all at once, not piecemeal.
- Rebuild from a known-good state. AA20-245A advises reimaging or removing compromised systems; deleting the files you found is not enough. Restore from a backup taken before the exploitation and patch straight away.
- Reporting: personal data breaches go to your data protection authority without undue delay and, where feasible, within 72 hours of becoming aware (GDPR and UK GDPR; the EDPB lists the authorities in each country). Regulated organisations also report to their national CSIRT or regulator. If a crime was committed, report it to the police as well.
Step 5: If you find nothing
Patch, verify the version afterwards and keep watching. Vendors and researchers often publish additional indicators days later – go through your logs again every time the advisory is updated. That is why our news articles on exploited flaws carry an Updates section. For how to prioritise patches so that exploited flaws never land you here, see our guides Patch Tuesday: what to patch first and prioritising patches under BOD 26-04.
Be ready next time
- Keep logs from internet-facing systems for at least 90 days and off the server itself (central logging, SIEM).
- Keep an inventory of internet-facing systems and their versions – otherwise disclosure day is spent working out what is affected.
- Keep your response plan and contacts (who decides on isolation, an external IR team, regulators) outside the corporate network. NIST SP 800-61 Rev. 3, published in April 2025, provides a framework for preparing.
- Test restoring from backup before you need it.
- Follow the CISA KEV catalogue and the advisories of the vendors you use, so exploited flaws get patched before attackers reach you.
Last checked 2 December 2026.
FAQ
Isn't it enough to patch and reboot?
Not if the system was vulnerable while the flaw was already being exploited. The patch closes the entry point but does not remove a web shell, new account, SSH key or scheduled task the attacker may have left behind. A reboot also wipes evidence from memory. Preserve data first, check whether a compromise happened, then remediate.
Should I block the attacker's IP addresses and reset every password right away?
Not prematurely. The five-nation joint advisory AA20-245A lists both pre-emptively blocking adversary infrastructure and pre-emptive credential resets as common mistakes: the attacker notices, changes tactics and you lose visibility. Reset credentials as part of a planned clean-up, not as a first reflex.
Can I open a suspicious IP or domain from the logs in my browser?
No. According to AA20-245A, pinging, running DNS lookups against or browsing adversary infrastructure from your network is a common mistake – the attacker may see those requests. Record the indicators and check them in reputation services or our Link checker instead of connecting directly.
When do I have to report the incident?
If personal data was breached, under the GDPR (and UK GDPR) the controller must notify the data protection authority without undue delay and, where feasible, within 72 hours of becoming aware of it. Organisations regulated under cyber security law (such as NIS2 in the EU) also have incident reporting duties to their national CSIRT or regulator; check the exact deadlines and scope with your authority.
Sources
- Canadian Centre for Cyber Security – Technical Approaches to Uncovering and Remediating Malicious Activity (AA20-245A, joint advisory by AU, CA, NZ, UK and US, 1 September 2020)
- NIST SP 800-61 Rev. 3 – Incident Response Recommendations and Considerations for Cybersecurity Risk Management (April 2025)
- EDPB – Notify a data breach (contacts for national data protection authorities)
Spotted a mistake? Let us know and we will correct it openly.