- Add internal/fingerprint package with Fingerprinter type - Sends version.bind CHAOS TXT query to each server - Caches results per IP to avoid redundant queries - Concurrent batch fingerprinting via FingerprintAll - Gracefully handles non-responding servers (returns empty string) - Injectable exchange function for testability - Wire fingerprinting into RunTraversal - Triggered when both ShowVersions and ShowServers are enabled - Collects unique server IPs from traversal results - Stores results in output.Config.Fingerprints before WriteSummary - Display versions in text output (writeServers) - Appends version string after IP when ShowVersions is true - No output change when version is unknown - Include version in JSON output (jsonServer.Version field) - omitempty: field absent when version is unknown - Add comprehensive fingerprint tests (11 test cases) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
Copilot
multica-agent
parent
35be7539b4
commit
3e7580b919
@@ -99,7 +99,13 @@ func (f *textFormatter) writeServers(results []traverse.TraversalResult) error {
|
||||
|
||||
for _, name := range names {
|
||||
for _, ip := range servers[name] {
|
||||
if _, err := fmt.Fprintf(f.w, "%*s: %-15s\n", width, name, ip); err != nil {
|
||||
line := fmt.Sprintf("%*s: %-15s", width, name, ip)
|
||||
if f.cfg.ShowVersions {
|
||||
if version, ok := f.cfg.Fingerprints[ip]; ok && version != "" {
|
||||
line += " " + version
|
||||
}
|
||||
}
|
||||
if _, err := fmt.Fprintln(f.w, line); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user