Finding and Removing Malware in Windows Pagefile or Swap Space
The Windows pagefile is a disk-backed extension of physical memory. It can contain fragments of programs, passwords, browser sessions, encryption keys, and other data that was once held in RAM. This makes it relevant to forensic investigations, but it is frequently misunderstood as a place where malware installs itself and survives independently.
In most cases, malicious code is not executing directly from pagefile.sys. A trojan, infostealer, or fileless attack usually runs through a legitimate process, scheduled task, service, registry entry, or script. The paging file may preserve traces of that activity after the process closes. Finding and removing malware that hides in the Windows page file or swap space therefore involves investigating the original infection, then safely handling residual memory data.
What pagefile evidence can and cannot prove
Windows uses pagefile.sys when RAM is under pressure or when memory pages have not been used recently. Its contents are binary and fragmented, so opening the file in Notepad or searching it with a normal antivirus interface rarely produces useful results. A suspicious string, domain, or PowerShell command found in the file can indicate past activity, but it does not prove that malware is still active.
Some threats described as “fileless” malware operate mainly in memory and leave little or no conventional executable on the drive. If Windows writes part of that memory to the pagefile, forensic tools may recover fragments of the payload or command history. That is evidence to analyse, rather than a standalone infection that can simply be deleted like an unwanted application.
Signs that memory-resident malware may be involved
Warning signs include unexplained CPU or network use, a browser redirect, disabled security controls, repeated PowerShell activity, or a process that returns after being terminated. A sudden increase in pagefile activity is not enough by itself: video editing, gaming, large spreadsheets, and low available RAM can all cause legitimate paging on a computer in Sydney or Perth.
Look for relationships between the suspicious behaviour and its source. Process Explorer or Task Manager can show unusual parent-child process chains, unsigned executables, unexpected command-line arguments, and connections to unfamiliar addresses. Browser advertising problems may also be a separate infection; for example, follow a search hijacker guide when the main symptom is an overridden search engine rather than a memory-resident threat.
Prepare a safe investigation
Disconnect the affected PC from Wi-Fi and Ethernet if it is showing active compromise, but avoid immediately shutting it down when memory evidence matters. Take photographs or notes of suspicious messages, process names, file paths, and connection times. If online banking, myGov, email, or work accounts were used on the machine, change passwords from a separate trusted device and enable multifactor authentication.
Create a backup of documents to a clean, write-protected destination, checking the files before opening them elsewhere. Do not copy unknown executables, scripts, cracks, or macros into the backup. Australian households commonly share devices between work, school, and streaming, while NBN-connected computers can remain online for long periods; those habits make account protection and network isolation especially important.
Scan the running system and memory
Start with Microsoft Defender, update its signatures, and run a full scan. Follow it with Microsoft Defender Offline, which restarts the computer into a trusted scanning environment before many third-party programs load. A reputable second-opinion scanner can identify adware, remote-access tools, and potentially unwanted programs that the first scanner missed. Persistent audio advertising may need a dedicated audio ad cleanup procedure rather than pagefile deletion.
For deeper analysis, a trained investigator can capture RAM and examine it with memory-forensics tools such as Volatility. This may reveal injected code, hidden processes, network sockets, loaded modules, and command history that are absent from ordinary file scans. Avoid downloading random “pagefile cleaners” or registry fixes advertised in pop-ups, as they can add another unwanted program and destroy useful evidence.
Clear residual paging data carefully
After the active infection has been removed, keep the pagefile under Windows management unless a forensic specialist gives different instructions. To reduce residual data at shutdown, an administrator can enable the Windows security policy that clears the virtual memory paging file, or configure the corresponding ClearPageFileAtShutdown setting. This usually affects shutdown time and does not remove malware that remains in startup locations.
Disabling virtual memory is generally a poor cleanup method. It can cause crashes, application failures, and data loss, particularly on systems with limited RAM. A safer sequence is to remove malicious persistence, reboot, rescan, install pending Windows and browser updates, and then allow Windows to recreate or manage the pagefile. BitLocker can also protect pagefile contents if the storage device is lost, while full-disk encryption does not clean an already infected system.
Prevent a repeat compromise
Review startup entries, scheduled tasks, services, browser extensions, and remote-management software after the scan. Remove only items that are clearly malicious or unnecessary, and record their paths before deletion. Keep Windows, browsers, JavaScript runtimes, PDF readers, and security software patched; many Australian infections begin with a fake parcel notice, invoice, tax message, or cracked application rather than an advanced memory attack.
If personal information may have been exposed, preserve scan reports and relevant dates. The Australian Privacy Act 1988 and Notifiable Data Breaches scheme can create obligations for organisations handling eligible personal information, while businesses may need advice from their managed security provider or the Australian Cyber Security Centre. Individuals can monitor bank accounts and report scams through Scamwatch. For current threat developments affecting Australian users, the site’s security news desk provides useful context.
A pagefile is usually a record of what malware did, not the place where it permanently lives. Removing the active source, verifying persistence has gone, and then managing residual paging data gives a more reliable result than deleting pagefile.sys in isolation.