add scanPort template , detectScanDest

This commit is contained in:
MaineK00n
2020-10-14 17:29:15 +09:00
parent 3112cbe886
commit ad67c5bd15
2 changed files with 59 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ type osTypeInterface interface {
postScan() error
scanWordPress() error
scanLibraries() error
scanPorts() error
scanPackages() error
convertToModel() models.ScanResult
@@ -637,11 +638,18 @@ func GetScanResults(scannedAt time.Time, timeoutSec int) (results models.ScanRes
return nil
}, timeoutSec)
for _, s := range servers {
if err = s.scanPorts(); err != nil {
util.Log.Errorf("Failed to scan Ports: %+v", err)
}
}
hostname, _ := os.Hostname()
ipv4s, ipv6s, err := util.IP()
if err != nil {
util.Log.Errorf("Failed to fetch scannedIPs. err: %+v", err)
}
for _, s := range append(servers, errServers...) {
r := s.convertToModel()
r.ScannedAt = scannedAt