From 20154d8a7898cf55a9a998d0bd28cbb2addd28f0 Mon Sep 17 00:00:00 2001 From: Esonhugh Date: Thu, 21 Mar 2024 12:14:38 +0800 Subject: [PATCH] update: scan single srv record function --- pkg/scanner/scanner.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/scanner/scanner.go b/pkg/scanner/scanner.go index 8e4231d..c5dfabf 100644 --- a/pkg/scanner/scanner.go +++ b/pkg/scanner/scanner.go @@ -26,6 +26,19 @@ func ScanSubnet(subnet *net.IPNet) (records []define.Record) { return } +func ScanSingleSvcForPorts(records define.Record) define.Record { + cname, srv, err := pkg.SRVRecord(records.SvcDomain) + if err != nil { + log.Debugf("SRVRecord for %v,failed: %v", records.SvcDomain, err) + return records + } + for _, s := range srv { + log.Infof("SRVRecord: %v --> %v:%v", records.SvcDomain, s.Target, s.Port) + } + records.SetSrvRecord(cname, srv) + return records +} + func ScanSvcForPorts(records []define.Record) []define.Record { for i, r := range records { cname, srv, err := pkg.SRVRecord(r.SvcDomain)