ing
This commit is contained in:
parent
dfdc9bdf82
commit
50c7d862c6
|
@ -20,11 +20,19 @@ const (
|
|||
defaultUlimit = 1024
|
||||
)
|
||||
|
||||
var (
|
||||
discovererType = omm.ToMetaDiscovererType(omm.MetaDiscovererTypeEnumTCPConnection)
|
||||
)
|
||||
|
||||
func Scan(discoverySession session.DiscoverySession, targetHost *omd.Host) error {
|
||||
if nil == targetHost || nil == discoverySession.DiscoverPort() || !discoverySession.DiscoverPort().IncludeTCP {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !discoverySession.HostNeedScan(targetHost, discovererType) {
|
||||
return nil
|
||||
}
|
||||
|
||||
dp := discoverySession.DiscoverPort()
|
||||
|
||||
lock := semaphore.NewWeighted(Ulimit())
|
||||
|
@ -101,7 +109,7 @@ func tryConnect(discoverySession session.DiscoverySession, ports map[int]*omd.Po
|
|||
|
||||
ports[port] = p
|
||||
|
||||
go discoverySession.AddPort(omm.ToMetaDiscovererType(omm.MetaDiscovererTypeEnumTCPConnection), p, nil)
|
||||
go discoverySession.AddPort(discovererType, p, nil)
|
||||
}
|
||||
|
||||
func Ulimit() int64 {
|
||||
|
|
|
@ -6,11 +6,19 @@ import (
|
|||
"git.loafle.net/overflow_scanner/probe/discovery/session"
|
||||
)
|
||||
|
||||
var (
|
||||
discovererType = omm.ToMetaDiscovererType(omm.MetaDiscovererTypeEnumTCPSyn)
|
||||
)
|
||||
|
||||
func Scan(discoverySession session.DiscoverySession, targetHost *omd.Host) error {
|
||||
if nil == targetHost || nil == discoverySession.DiscoverPort() || !discoverySession.DiscoverPort().IncludeTCP {
|
||||
return nil
|
||||
}
|
||||
|
||||
if !discoverySession.HostNeedScan(targetHost, discovererType) {
|
||||
return nil
|
||||
}
|
||||
|
||||
metaIPTypeEnum := omm.ToMetaIPTypeEnum(discoverySession.Zone().MetaIPType)
|
||||
|
||||
switch metaIPTypeEnum {
|
||||
|
|
|
@ -16,15 +16,7 @@ import (
|
|||
"github.com/google/gopacket/layers"
|
||||
)
|
||||
|
||||
var (
|
||||
discovererType = omm.ToMetaDiscovererType(omm.MetaDiscovererTypeEnumTCPSyn)
|
||||
)
|
||||
|
||||
func scanV4(discoverySession session.DiscoverySession, targetHost *omd.Host) (err error) {
|
||||
if !discoverySession.HostNeedScan(targetHost, discovererType) {
|
||||
return nil
|
||||
}
|
||||
|
||||
ps := discoverySession.PCapScanner()
|
||||
if nil == ps {
|
||||
err = fmt.Errorf("Cannot retain pcap instance")
|
||||
|
|
Loading…
Reference in New Issue
Block a user