Skip to content

ShieldGate 2.1

Choose a tag to compare

@GnasValluk GnasValluk released this 20 Nov 14:24
· 30 commits to main since this release

Fix the re-infection loop

A USB drive that is cleaned and re-infected within seconds means the source is
running on the PC, not on the drive. A field log showed one shortcut reappearing
50 times in 27 minutes (median gap 35 seconds) while the scheduled task was
"fixed" only three times — the files were removed while the process that
recreated them was still running.

This release changes the order, extends the search, and stops cleaning silently.

Detection

  • Fix order reversed. Check this PC stops processes and services first,
    then removes tasks and WMI subscriptions, then startup entries, and only then
    quarantines files.
  • Processes are linked to payloads. A running process whose image lives in a
    folder holding known payloads or the drive's fake folder (Docusment, ...) is
    reported and its image is queued for quarantine.
  • Services and drivers are scanned. A service whose ImagePath points into
    ProgramData, AppData, Temp, Users\Public or to an unsigned binary
    outside Windows/Program Files is reported. Windows Defender's own
    ProgramData\Microsoft\Windows Defender platform folder is excluded.
  • Hidden and \Microsoft\... scheduled tasks are read from the XML. Task
    Scheduler hides both by default. Results show [hidden], and that subtree is
    reported only when the command targets a user-writable folder, a script host
    (mshta, wscript, .hta, .vbs) or an odd numeric executable — Windows'
    own encoded PowerShell tasks are not flagged.

Fixing

  • Task XML is backed up to backup\task_*.xml before schtasks /Delete /F;
    disabling is now only the fallback when the backup fails.
  • Service registry keys are exported before sc stop + sc delete; without a
    backup nothing is touched.
  • Killing a process verifies PID, name and image path first.

Awareness

  • Cleaning the same volume three times in ten minutes raises a warning and a
    tray balloon, and Guard runs a read-only source hunt in the background so the
    log names the process, task, service or file.
  • If the drive is re-infected within 60 minutes after a fix, the warning becomes
    "re-infected after a fix — the source may be a driver/rootkit, run Microsoft
    Defender Offline" instead of asking for the same cleanup again.

Requirements and checks

  • Windows 7 or later, .NET Framework 4.0, single ShieldGate.exe, no installer.
  • build.ps1 → dist\ShieldGate.exe (532 KB);
    SHA256 8ff033312b8c66bcaea585896040d898d4b4d219287f6c9c362df7cbdc3a4b5d.
  • test.ps1 → Đạt 54/54 phép kiểm tra, exit 0 (37 checks in 2.0).

Limits, stated plainly

ShieldGate is a user-mode tool. If the source is a kernel driver or a protected
process it can only show the traces and tell you, not remove them. In that case
run Microsoft Defender Offline Scan (Windows Security → Virus & threat
protection → Scan options), then plug the drive back in.