tcp

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SYNScanType   = "tcpsyn"
	FINScanType   = "tcpfin"
	NULLScanType  = "tcpnull"
	XmasScanType  = "tcpxmas"
	FlagsScanType = "tcpflags"
)
View Source
const MaxPacketLength = 1518

Set to typical maximum Ethernet frame size = MTU (1500 bytes) + Ethernet header (14 bytes) + FCS (4 bytes)

Variables

This section is empty.

Functions

func AllFlags

func AllFlags(pkt *layers.TCP) string

func BPFFilter

func BPFFilter(r *scan.Range) (filter string, maxPacketLength int)

func EmptyFlags

func EmptyFlags(*layers.TCP) string

func SYNACKBPFFilter

func SYNACKBPFFilter(r *scan.Range) (filter string, maxPacketLength int)

func TrueFilter

func TrueFilter(*layers.TCP) bool

Types

type PacketFiller

type PacketFiller struct {
	SYN bool
	ACK bool
	FIN bool
	RST bool
	PSH bool
	URG bool
	ECE bool
	CWR bool
	NS  bool
	// contains filtered or unexported fields
}

func NewPacketFiller

func NewPacketFiller(opts ...PacketFillerOption) *PacketFiller

func (*PacketFiller) Fill

func (f *PacketFiller) Fill(packet gopacket.SerializeBuffer, r *scan.Request) (err error)

type PacketFillerOption

type PacketFillerOption func(f *PacketFiller)

func WithACK

func WithACK() PacketFillerOption

func WithCWR

func WithCWR() PacketFillerOption

func WithECE

func WithECE() PacketFillerOption

func WithFIN

func WithFIN() PacketFillerOption

func WithFillerVPNmode

func WithFillerVPNmode(vpnMode bool) PacketFillerOption

func WithNS

func WithNS() PacketFillerOption

func WithPSH

func WithPSH() PacketFillerOption

func WithRST

func WithRST() PacketFillerOption

func WithSYN

func WithSYN() PacketFillerOption

func WithURG

func WithURG() PacketFillerOption

type PacketFilterFunc

type PacketFilterFunc func(pkt *layers.TCP) bool

type PacketFlagsFunc

type PacketFlagsFunc func(pkt *layers.TCP) string

type ScanMethod

type ScanMethod struct {
	scan.PacketSource
	// contains filtered or unexported fields
}

func NewScanMethod

func NewScanMethod(scanType string, psrc scan.PacketSource,
	results scan.ResultChan, opts ...ScanMethodOption) *ScanMethod

func (*ScanMethod) ProcessPacketData

func (s *ScanMethod) ProcessPacketData(data []byte, _ *gopacket.CaptureInfo) (err error)

func (*ScanMethod) Results

func (s *ScanMethod) Results() <-chan scan.Result

type ScanMethodOption

type ScanMethodOption func(s *ScanMethod)

func WithPacketFilterFunc

func WithPacketFilterFunc(pktFilter PacketFilterFunc) ScanMethodOption

func WithPacketFlagsFunc

func WithPacketFlagsFunc(pktFlags PacketFlagsFunc) ScanMethodOption

func WithScanVPNmode

func WithScanVPNmode(vpnMode bool) ScanMethodOption

type ScanResult

type ScanResult struct {
	ScanType string `json:"scan"`
	IP       string `json:"ip"`
	Port     uint16 `json:"port"`
	Flags    string `json:"flags,omitempty"`
}

func (*ScanResult) ID

func (r *ScanResult) ID() string

func (ScanResult) MarshalEasyJSON

func (v ScanResult) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ScanResult) MarshalJSON

func (v ScanResult) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ScanResult) String

func (r *ScanResult) String() string

func (*ScanResult) UnmarshalEasyJSON

func (v *ScanResult) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ScanResult) UnmarshalJSON

func (v *ScanResult) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL