Documentation ¶
Index ¶
- Variables
- func CompactDB(dayPath, scanID string)
- func GetNextScanID() string
- func PersistScanRequest(psr PersistedScanRequest)
- func PersistScans(psr PersistedScanRequest, server string, scans []PortACK)
- func ScanCIDR(config ScanConfig, cidrAddresses ...string) <-chan PortACK
- func ScheduleTCPScan(ipSource func() []string)
- func Service(configPath string)
- type MyPPP
- type PersistedScanRequest
- type PortACK
- type PortAckSorter
- type ScanConfig
- type ScanRequest
- type TCPScanConfig
Constants ¶
This section is empty.
Variables ¶
var ( //TCPScanConfigPath is the default config path of the TCPScan service TCPScanConfigPath = filepath.Join("data", "config", "TCPScanConfig.yml") )
Functions ¶
func CompactDB ¶ added in v0.4.0
func CompactDB(dayPath, scanID string)
CompactDB reclaims space by pruning the database
func GetNextScanID ¶ added in v0.4.0
func GetNextScanID() string
GetNextScanID returns the next unique scan ID
func PersistScanRequest ¶ added in v0.4.0
func PersistScanRequest(psr PersistedScanRequest)
PersistScanRequest persists scan request
func PersistScans ¶ added in v0.4.0
func PersistScans(psr PersistedScanRequest, server string, scans []PortACK)
PersistScans persists the result of scans per server
func ScanCIDR ¶
func ScanCIDR(config ScanConfig, cidrAddresses ...string) <-chan PortACK
ScanCIDR scans for open TCP ports in IP addresses within a CIDR range
func ScheduleTCPScan ¶ added in v0.4.0
func ScheduleTCPScan(ipSource func() []string)
ScheduleTCPScan runs TCPScan service scan
Types ¶
type MyPPP ¶
MyPPP is layers.PPP with CanDecode and other decoding operations implemented
func (*MyPPP) CanDecode ¶
func (ppp *MyPPP) CanDecode() gopacket.LayerClass
CanDecode indicates that we can decode PPP packets
func (*MyPPP) DecodeFromBytes ¶
func (ppp *MyPPP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error
DecodeFromBytes as name suggest
func (*MyPPP) NextLayerType ¶
NextLayerType gets type
type PersistedScanRequest ¶ added in v0.4.0
type PersistedScanRequest struct { Request ScanRequest Hosts []string ScanStart time.Time ScanEnd time.Time Progress int }
PersistedScanRequest persisted version of ScanRequest
func LoadScanRequest ¶ added in v0.4.0
func LoadScanRequest(dir, scanID string) (psr PersistedScanRequest, e error)
LoadScanRequest retrieves persisted scan request from folder following a layout pattern
func UnmasharlPersistedScanRequest ¶ added in v0.4.0
func UnmasharlPersistedScanRequest(data []byte) (PersistedScanRequest, error)
UnmasharlPersistedScanRequest builds PersistedScanRequest from bytes
func (PersistedScanRequest) Marshall ¶ added in v0.4.0
func (psr PersistedScanRequest) Marshall() []byte
Marshall scan request
type PortACK ¶
PortACK describes a port with an ACK after a TCP SYN request
func (PortACK) GetServiceName ¶
GetServiceName returns the service name indicated by the port number
type PortAckSorter ¶ added in v0.4.0
type PortAckSorter []PortACK
PortAckSorter sorts ack messages
func (PortAckSorter) Len ¶ added in v0.4.0
func (k PortAckSorter) Len() int
func (PortAckSorter) Less ¶ added in v0.4.0
func (k PortAckSorter) Less(i, j int) bool
func (PortAckSorter) Swap ¶ added in v0.4.0
func (k PortAckSorter) Swap(i, j int)
type ScanConfig ¶
type ScanConfig struct { //How long to wait listening for TCP ACK/RST responses Timeout int //Number of Packets per Second to send out during scan PacketsPerSecond int //Should a running commentary of results be generated? Quiet bool //If not empty, indicates which network interface to use, bypassing automated guessing Interface string }
ScanConfig describes details of how the port scan should be carried out
type ScanRequest ¶ added in v0.4.0
type ScanRequest struct { CIDRs []string Config ScanConfig Day string //Date the scan was run in the format yyyy-mm-dd ScanID string //Non-empty ScanID means this is a ScanRequest to resume an existing, possibly incomplete, scan }
ScanRequest is a model to describe a given TLS Audit scan
func ListScans ¶ added in v0.4.0
func ListScans(rewindDays int, completed bool) (result []ScanRequest)
ListScans returns the ScanID list of persisted scans
type TCPScanConfig ¶ added in v0.4.0
type TCPScanConfig struct { DailySchedules []string `yaml:"dailySchedules"` // in the format 13:45, 01:20 etc IsProduction bool `yaml:"isProduction"` PacketsPerSecond int `yaml:"packetsPerSecond"` Timeout int `yaml:"timeout"` CIDRRanges []string `yaml:"cidrRanges"` }
TCPScanConfig config data structure for the scanner service