Step-by-step guide to removing fileless malware from memory
Fileless malware operates differently from conventional viruses. Instead of relying on a suspicious executable saved on disk, it may use PowerShell, Windows Management Instrumentation (WMI), scheduled tasks, registry entries, malicious scripts, or trusted system utilities to run code in memory. This can make ordinary file scans appear clean while harmful activity continues.
A memory-resident infection may steal browser sessions, capture credentials, download additional payloads, disable security tools, or provide remote access. The safest response combines containment, volatile evidence collection, process investigation, persistence removal, and verification after reboot.
The procedure below is intended for personal computers and small environments. If the device belongs to a business, contains regulated data, or shows signs of credential theft, disconnect it and involve an incident-response professional before making extensive changes.
Recognize the signs of a memory-based attack
Warning signs include unexplained PowerShell or Command Prompt activity, recurring outbound connections, unusual CPU or memory usage, disabled security features, and browser redirects. Windows may also show WMI Provider Host, rundll32.exe, mshta.exe, regsvr32.exe, or other legitimate processes behaving unexpectedly. These tools are not malware by themselves; their parent process, command line, timing, and network activity provide the important context.
A clean-looking hard drive does not prove the system is safe. Fileless threats often leave only scripts, registry values, scheduled tasks, event subscriptions, or small launchers behind. Sudden account alerts, unknown sign-ins, and altered browser settings should be treated as possible compromise indicators rather than isolated software problems.
Isolate the computer before investigating
Disconnect the computer from Wi-Fi or unplug its Ethernet cable. Do not simply close the browser or restart immediately, because a running attacker may still be active and a reboot can erase valuable memory evidence. If the device is managed by an organization, notify the security team and avoid connecting external storage.
From a separate, trusted device, change important passwords, beginning with email, password managers, banking accounts, and administrator accounts. Enable multifactor authentication where available. If ransomware behavior or encrypted files are present, preserve the affected system and consult the ransomware recovery guidance before deleting artifacts or attempting restoration.
Capture volatile evidence carefully
Memory contents disappear when the computer powers off. If a forensic investigation may be necessary, document the screen, current time, logged-in users, visible alerts, and active network state. A trained responder can use a trusted memory-acquisition tool from verified media to create a RAM image, record its hash, and examine processes, injected code, network sockets, and loaded modules.
For a home user whose priority is immediate containment, open Task Manager with administrative privileges and record suspicious process names, process IDs, parent processes, command lines, user accounts, and network-related details. Avoid ending every unfamiliar process. Some entries are essential Windows components, and indiscriminate termination can cause data loss or destroy evidence without removing persistence.
Inspect processes and persistence points
After documenting the system, use a reputable endpoint security scanner and an autorun inspection utility obtained from the vendor’s official source. Review PowerShell, WMI, scheduled tasks, services, startup folders, browser extensions, registry Run keys, and Office macro settings. Pay attention to entries with random names, unusual locations, encoded commands, hidden triggers, or recently created timestamps.
PowerShell logging, Microsoft Defender history, Windows event logs, and firewall records can reveal how the threat started and where it connected. Look for a suspicious process launched by a document, script host, browser, or scheduled task. A trusted executable running an abnormal command is often more informative than the executable’s name alone.
Remove the execution mechanism
Once a suspicious persistence entry is identified, record its full path and configuration before disabling it. Disconnect the computer from the network, terminate the associated process when safe, and disable the scheduled task, service, WMI subscription, registry entry, or startup item that relaunches it. Quarantine related scripts and launchers through the security product rather than manually opening them.
Run an offline or boot-time scan afterward. This allows security software to inspect files before Windows loads typical malware components. If the infection returns after reboot, the persistence mechanism was missed or the system is too compromised to trust. In that case, back up only essential personal documents after scanning them, then consider a clean operating-system reinstall.
| Investigation stage |
Useful evidence |
Safe action |
| Live response |
Processes, parent-child relationships, open connections |
Isolate the device and document activity |
| Persistence review |
Tasks, services, WMI, registry, startup items |
Disable confirmed malicious launch points |
| Malware scanning |
Defender history, offline scan results, security reports |
Quarantine detected components |
| Account protection |
Sign-in alerts, token activity, password changes |
Reset credentials from a clean device |
| Verification |
Reboot behavior, logs, network traffic, system performance |
Reconnect only after repeated clean checks |
Verify the system after cleanup
Restart the computer only after evidence collection and initial containment are complete. Run a full scan, then perform an offline scan if the security tool supports it. Check that security services, updates, firewall settings, browser protections, and system policies have returned to normal. Review Task Manager and network activity again after the reboot.
Use a clean device to review email forwarding rules, browser sessions, saved passwords, cloud storage sessions, and account recovery details. A memory-only infection can still have copied credentials or authentication cookies before removal. For Mac users, related unwanted profiles, extensions, login items, and adware may require a separate cleanup process; the Mac adware removal guide explains those checks in greater detail.
Reduce the chance of reinfection
Fileless threats frequently arrive through malicious attachments, cracked software, fake updates, unsafe browser extensions, and social-engineering messages. Keep Windows, browsers, Office, security software, and firmware updated. Use a standard account for everyday work, restrict PowerShell where appropriate, and allow scripts only from trusted sources.
Mac owners can review the site’s Mac security tips for platform-specific advice. Across both operating systems, maintain offline or versioned backups, protect administrator credentials, and monitor unusual sign-ins and outbound connections.
Practical safeguards include:
- Enable multifactor authentication on email, financial, cloud, and administrator accounts.
- Keep reputable endpoint protection active and allow tamper protection and automatic updates.
- Treat unexpected documents, browser pop-ups, scripts, and software-update prompts as untrusted.
- Test backups regularly and keep at least one copy disconnected from the computer.
- Record suspicious process names, timestamps, alerts, and account activity for later review.
If suspicious activity persists after offline scanning, password changes, and a clean reboot, stop using the computer for sensitive tasks. Preserve relevant logs and contact a qualified incident-response specialist or trusted technical professional for a deeper memory and system examination.