Trojan:Win32/AgentTesla

AgentTesla Trojan stuck on Windows – manual removal fix

Cybersecurity & Malware Intermediate 👁 2 views 📅 Jul 19, 2026

Windows Defender flags AgentTesla but can't remove it. Here's the manual fix that works every time.

You're sitting at a user's desk, or maybe your own machine. Windows Security pops up a red warning: Trojan:Win32/AgentTesla. You click 'Remove' or 'Quarantine'. Nothing happens. It keeps coming back. This usually happens after someone opened a phishing email attachment — a PDF, a Word doc, or a ZIP file. The payload installs itself deep, often hiding in startup folders or scheduled tasks.

Why Windows Defender can't remove it

AgentTesla is a keylogger and info-stealer. It's not just one file. It drops multiple copies, modifies registry entries, and sets up persistence via scheduled tasks. Defender flags the main executable but can't delete it because it's running, or because it re-writes itself from another location. The culprit here is almost always a scheduled task that re-drops the malware every few minutes. Defender kills the process, the task spawns a new one.

How to remove AgentTesla manually

Don't bother with a quick scan. It rarely helps. You need to do this step by step. Boot into Safe Mode with Networking — this stops most scheduled tasks from running.

  1. Boot into Safe Mode with Networking. Hold Shift while clicking Restart. Go to Troubleshoot > Advanced Options > Startup Settings > Restart. Press 5 for Safe Mode with Networking.
  2. Kill malicious processes. Open Task Manager (Ctrl+Shift+Esc). Look for suspicious processes with random names like svch0st.exe, winlog0n.exe, or expl0rer.exe. Right-click and End Task.
  3. Delete scheduled tasks. Open Task Scheduler (taskschd.msc). Look for tasks with weird names — something like SystemUpdateTask, GoogleUpdateTask, AdobeUpdateTask. Check the Triggers tab. If it runs every 5-10 minutes, that's your culprit. Disable and delete it.
  4. Clean the registry. Open Regedit. Navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. Look for entries pointing to random EXE files in AppData or Temp folders. Delete those entries.
  5. Remove the files. Open File Explorer. Go to %AppData%, %LocalAppData%\Temp, and C:\Users\[username]\AppData\Local\Temp. Sort by date modified. Look for files created around the time the infection started. AgentTesla often uses names like au.exe, svchost.exe in weird folders. Delete them. Don't delete anything you're not sure about — check the file properties first.
  6. Run Defender offline scan. Open Windows Security > Virus & threat protection > Scan options > Microsoft Defender Offline Scan. Click Scan Now. This runs before Windows boots and catches things Defender can't touch while the OS is running.
  7. Reboot and verify. Restart normally. Open Defender again. Run a full scan. If it comes back clean, you're done.

What to check if it still fails

Sometimes the infection is deeper. AgentTesla can inject into legitimate processes like explorer.exe or svchost.exe. If Defender still flags it after the steps above, try these:

  • Use Process Explorer from Microsoft Sysinternals. Look for DLLs loaded into explorer.exe that don't belong. AgentTesla often injects a DLL named something like msvcp140.dll but in a weird path. Right-click the suspicious DLL, go to Properties, and check the path. If it's in AppData, kill explorer.exe from Process Explorer and delete the DLL.
  • Check browser extensions. AgentTesla sometimes drops a Chrome or Edge extension to steal passwords. Go to chrome://extensions and remove anything you didn't install.
  • Reset Winsock and DNS cache. Open Command Prompt as admin. Run netsh winsock reset and ipconfig /flushdns. This clears any network-level persistence.
  • Last resort: nuke it. If you've spent more than an hour and it's still there, back up personal files (not executables or scripts) and do a clean install of Windows. AgentTesla variants keep evolving, and sometimes the manual cleanup just isn't worth the headache.

One more thing — change all passwords after you're clean. Email, banking, anything you typed on that machine. AgentTesla logs keystrokes and sends them out. Assume everything is compromised.

Was this solution helpful?