Run a Microsoft Defender Offline scan now, because the threat reappears immediately after restart and the offline scanner can remove persistence that hides while Windows is running.^1^
1. Isolate and scan the computer offline
- Disconnect the computer from the Internet and other local-network devices.
- Save all open work.
- Open Windows Security → Virus & threat protection → Scan options.
- Select Microsoft Defender Antivirus (offline scan) → Scan now.
- The computer will restart, scan in the Windows Recovery Environment, and restart again.
- Open Windows Security → Virus & threat protection → Protection history and verify that detected items were removed or quarantined.^2^
Also check Allowed threats on that page. If this detection was accidentally allowed, select it and choose Don’t allow so Defender can act on it.
Do not manually delete:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
MSBuild.exe is a legitimate Microsoft build utility, but attackers can misuse it to run malicious content.^3^ The persistence mechanism launching it—such as a scheduled task, startup entry, service, or script—may be the malicious component rather than that executable itself.
2. If the command window still appears at startup
Use Microsoft Sysinternals Autoruns to locate the launcher:
- Download and run Autoruns as administrator.
- Under Options, enable Hide Signed Microsoft Entries and signature verification.
- Inspect Logon, Scheduled Tasks, Services, WMI, and Winlogon.
- Look for entries created around the infection date that launch
cmd.exe, MSBuild.exe, scripts, or files from unusual user-writable locations.
- Right-click a suspicious entry and use Properties or Jump to Entry to inspect it.
- Uncheck the entry first to disable it rather than deleting it immediately. Restart and check whether the command window and Defender alert stop.
Autoruns covers startup folders, Run/RunOnce keys, scheduled tasks, services, WMI entries, Winlogon components, and other autostart locations.^4^
Do not run an FRST fixlist.txt written for another computer. Such scripts are machine-specific and can damage Windows when reused.^5^
3. If the detection returns again
Because credentials were already stolen, continued recurrence after the offline scan should be treated as an untrusted Windows installation. Back up only personal documents, photographs, and similar data—not executables, scripts, installers, or archives from the infection period—then perform a clean installation using Windows installation media.
This is destructive: a clean installation removes personal files, applications, and settings from the selected drive. Microsoft specifically recommends this route when malware remains after scanning.^6^
After reinstalling:
- Complete Windows Update before restoring files.
- Scan the backup before opening anything.
- Reinstall applications only from their official sources.
- Avoid restoring old startup settings or unknown browser extensions.
4. Secure the stolen accounts again
Since the passwords were changed while the computer may still have been infected, change them again from a known-clean phone or computer, or after Windows has been cleaned/reinstalled. Microsoft’s compromised-account procedure places malware removal before the password change.^7^
For every important account:
- Use a unique password.
- Enable two-step verification.
- Review recent sign-ins, active sessions, recovery methods, trusted devices, email-forwarding rules, and connected applications.
- Sign out other sessions where the service offers that option.
- Prioritize email, password manager, banking, shopping, cloud storage, and social-media accounts.
For a personal Microsoft account, recent activity shows sign-ins from the preceding 30 days and lets you report unusual activity.^8^
References
- Troubleshoot problems with detecting and removing malware | Microsoft Support
- Virus and Threat Protection in the Windows Security App | Microsoft Support
- Applications that can bypass App Control and how to block them
- Autoruns v14.3
- MSBuild.exe contacting an unknown website every 10 minutes - Microsoft Q&A
- Recovery options in Windows | Microsoft Support
- How to recover a hacked or compromised Microsoft account | Microsoft Support
- What is the Recent activity page? | Microsoft Support