scream

package
v0.0.0-...-a2a1003 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StopChan stop all procces
	StopChan = make(chan struct{}, 8)
	// PauseChan pause all goroutins
	PauseChan = make(chan struct{}, 16)
	// ContChan makes all goroutins continue
	ContChan = make(chan struct{}, 16)
)

Functions

func CustomPscan

func CustomPscan(host string, timeout time.Duration, gt int64, rgscan []int, udpmsg []byte, contype bool, ch chan<- ScanResults)

CustomPscan start port scanning tcp or udp (or both) for port mapper tool

func DetectWeb

func DetectWeb(addr string, port int) (string, error)

DetectWeb return webserver name and an error

func GetHosts

func GetHosts(cidr string) ([]string, error)

GetHosts get a cidr network range and return slice of ip addesses

func PingHost

func PingHost(addr string, blackout int) (*net.IPAddr, time.Duration, error)

PingHost Send a icmp packet and wait for reply, and return icmp reply time

func SendARP

func SendARP(ip net.IP) (net.HardwareAddr, error)

SendARP used to bcast arp in network

Types

type CustomScanTCP

type CustomScanTCP struct {
	OK bool
	NM int
}

CustomScanTCP struct type for tcp scan

func (CustomScanTCP) PortInfo

func (p CustomScanTCP) PortInfo() string

PortInfo TCP

func (CustomScanTCP) SigPort

func (CustomScanTCP) SigPort() string

SigPort return port protocol type

func (CustomScanTCP) StatInfo

func (p CustomScanTCP) StatInfo() (bool, int)

StatInfo returns stat and port number

type CustomScanUDP

type CustomScanUDP struct {
	OK bool
	NM int
}

CustomScanUDP struct type for udp scan

func (CustomScanUDP) PortInfo

func (p CustomScanUDP) PortInfo() string

PortInfo UDP

func (CustomScanUDP) SigPort

func (CustomScanUDP) SigPort() string

SigPort return port protocol type

func (CustomScanUDP) StatInfo

func (p CustomScanUDP) StatInfo() (bool, int)

StatInfo returns stat and port number

type PortType

type PortType struct {
	Nm int
	Tp string
}

PortType struct is a part of settings for ipscanner and port mapper

type PoutComming

type PoutComming struct {
	Stat, Ptype string
	Number      int
}

PoutComming struct to return scanning resualts

func StartPscan

func StartPscan(host string, timeout time.Duration, gt int64, portstruct ...PortType) []PoutComming

StartPscan start port scanning tcp or udp (or both)

type ScanResults

type ScanResults interface {
	PortInfo() string
	SigPort() string
	StatInfo() (bool, int)
}

ScanResults implement CustomScanTCP and CustomScanUDP

type Weighted

type Weighted struct {
	// contains filtered or unexported fields
}

Weighted provides a way to bound concurrent access to a resource. The callers can request access with a given weight.

func NewWeighted

func NewWeighted(n int64) *Weighted

NewWeighted creates a new weighted semaphore with the given maximum combined weight for concurrent access.

func (*Weighted) Acquire

func (s *Weighted) Acquire(ctx context.Context, n int64) error

Acquire acquires the semaphore with a weight of n, blocking until resources are available or ctx is done. On success, returns nil. On failure, returns ctx.Err() and leaves the semaphore unchanged.

If ctx is already done, Acquire may still succeed without blocking.

func (*Weighted) AcquireSnix

func (s *Weighted) AcquireSnix(ctx context.Context, n int64) (int8, error)

AcquireSnix same as Acquire but with a custom channel to puase runing opration Change By Snix.IR, for orginal package please see golang.org/x/sync/semaphore

func (*Weighted) Release

func (s *Weighted) Release(n int64)

Release releases the semaphore with a weight of n.

func (*Weighted) TryAcquire

func (s *Weighted) TryAcquire(n int64) bool

TryAcquire acquires the semaphore with a weight of n without blocking. On success, returns true. On failure, returns false and leaves the semaphore unchanged.

Jump to

Keyboard shortcuts

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