Documentation ¶
Overview ¶
Package bytefmt contains helper methods and constants for converting to and from a human-readable byte format.
bytefmt.ByteSize(100.5*bytefmt.MEGABYTE) // "100.5M" bytefmt.ByteSize(uint64(1024)) // "1K"
sshclient implements an ssh client
Index ¶
- Constants
- Variables
- func ARPWithPcap(ctx context.Context, ifaceName string, targets string) (map[string]net.HardwareAddr, error)
- func AddressFamilyUint32ToString(i uint32) string
- func Arp(ifaceName string, target string) (net.HardwareAddr, error)
- func ArpIPAddressesWithContext(ctx context.Context, ifaceName string, addrs string) (map[string]net.HardwareAddr, error)
- func ArpWithContext(ctx context.Context, ifaceName string, target string) (net.HardwareAddr, error)
- func ArpWithTimeout(timeoutContext time.Duration, ifaceName string, target string) (net.HardwareAddr, error)
- func AsciiBytesToRegexpMatchedRunes(in []byte) []rune
- func AsciiBytesToRegexpMatchedString(in []byte) string
- func AsciiEqualFold(s, t string) bool
- func AsciiToLower(s string) (lower string, ok bool)
- func Atof(i string) float64
- func Atoi(i string) int
- func BKDRHash(str []byte) uint32
- func BufReadLen(r io.Reader, length uint64) ([]byte, error)
- func BufioReadLine(reader *bufio.Reader) ([]byte, error)
- func ByteCountBinary(b int64) string
- func ByteCountDecimal(b int64) string
- func ByteSize(bytes uint64) string
- func BytesClone(raw []byte) (newBytes []byte)
- func BytesStripUntil(raw []byte, s byte) []byte
- func CalcFaviconHash(urlRaw string) (string, error)
- func CalcMd5(items ...interface{}) string
- func CalcSSDeepStability(req ...[]byte) (float64, error)
- func CalcSha1(items ...interface{}) string
- func CalcSha1WithSuffix(items []interface{}, suffix string) string
- func CalcSimHashStability(req ...[]byte) (float64, error)
- func CalcSimilarity(raw ...[]byte) float64
- func CalcTextSubStringStability(raw ...[]byte) (float64, error)
- func ChanStringToSlice(c chan string) (result []string)
- func ConcatPorts(ports []int) string
- func ConnExpect(c net.Conn, timeout time.Duration, callback func([]byte) bool) (bool, error)
- func ConvertTextFileToYakFuzztagByPath(file_bin_path string) (string, error)
- func ConvertToStringSlice(raw ...interface{}) (r []string)
- func CopyBytes(rsp []byte) []byte
- func CopyMapInterface(i map[string]interface{}) map[string]interface{}
- func CopyReader(r io.ReadCloser) (io.ReadCloser, io.ReadCloser, error)
- func DataVerbose(i interface{}) string
- func DatetimePretty() string
- func DatetimePretty2() string
- func Debug(f func())
- func DebugMockHTTP(rsp []byte) (string, int)
- func DebugMockHTTPWithTimeout(du time.Duration, rsp []byte) (string, int)
- func DomainToIP(domain string, timeout time.Duration) []string
- func DomainToURLFilter(domain string) (*regexp.Regexp, error)
- func DownloadFile(client *http.Client, u string, localFile string, every1s ...func(float64)) error
- func DumpFileWithTextAndFiles(raw string, divider string, files ...string) (string, error)
- func DumpHostFileWithTextAndFiles(raw string, divider string, files ...string) (string, error)
- func Error(i interface{}) error
- func Errorf(origin string, args ...interface{}) error
- func EscapeInvalidUTF8Byte(s []byte) string
- func ExtractHost(raw string) string
- func ExtractHostPort(raw string) string
- func ExtractRawHeadersFromRequest(req *http.Request) string
- func ExtractRawHeadersFromResponse(rsp *http.Response) string
- func ExtractRawPath(target string) string
- func ExtractStrContextByKeyword(raw []byte, res []string) []string
- func ExtractTitleFromHTMLTitle(s string, defaultValue string) string
- func FileLineReader(file string) (chan []byte, error)
- func FixForParseIP(host string) string
- func FixHTTPRequestForHTTPDo(r *http.Request) (*http.Request, error)
- func FixHTTPRequestForHTTPDoWithHttps(r *http.Request, isHttps bool) (*http.Request, error)
- func FixJsonRawBytes(rawBytes []byte) []byte
- func FixProxy(i string) string
- func FloatSecondDuration(f float64) time.Duration
- func Format(raw string, data map[string]string) string
- func GetAllFiles(path string) (fileNames []string, err error)
- func GetAutoProxyConn(target string, proxy string, connectTimeout time.Duration) (net.Conn, error)
- func GetAutoProxyConnWithGMTLS(target string, proxy string, connectTimeout time.Duration, c *gmtls.Config) (net.Conn, error)
- func GetAutoProxyConnWithTLS(target string, proxy string, connectTimeout time.Duration, c *tls.Config) (net.Conn, error)
- func GetCClassByIPv4(s string) (string, error)
- func GetCurrentDate() (time.Time, error)
- func GetCurrentWeekMonday() (time.Time, error)
- func GetDate(t time.Time) (time.Time, error)
- func GetFileAbsDir(filePath string) (string, error)
- func GetFileAbsPath(filePath string) (string, error)
- func GetFileMd5(filepath string) string
- func GetFileModTime(path string) int64
- func GetFirstExcludedHighPort(excluded ...string) int
- func GetFirstExistedExecutablePath(paths ...string) string
- func GetFirstExistedFile(paths ...string) string
- func GetFirstExistedFileE(paths ...string) (string, error)
- func GetFirstExistedPath(paths ...string) string
- func GetFirstExistedPathE(paths ...string) (string, error)
- func GetFirstIPByDnsWithCache(domain string, timeout time.Duration, dnsServers ...string) string
- func GetFirstIPFromHostWithContextE(timeout time.Duration, domain string, DNSServers []string) (string, error)
- func GetFirstIPFromHostWithTimeout(timeout time.Duration, domain string, dnsServres []string) string
- func GetFirstIPFromHostWithTimeoutE(timeout time.Duration, domain string, dnsServres []string) (string, error)
- func GetHomeDir() (string, error)
- func GetHomeDirDefault(d string) string
- func GetIPByDomain(target string, timeout time.Duration) ([]net.IPAddr, error)
- func GetIPByURL(url url.URL, timeout time.Duration) ([]net.IPAddr, error)
- func GetIPFromHostWithContextAndDNSServers(timeout time.Duration, domain string, DNSServers []string, ...) error
- func GetIPsFromHostWithContextE(timeout time.Duration, domain string, DNSServers []string) ([]string, error)
- func GetIPsFromHostWithTimeout(timeout time.Duration, domain string, dnsServers []string) []string
- func GetIPsFromHostWithTimeoutE(timeout time.Duration, domain string, dnsServers []string) ([]string, error)
- func GetLatestFile(dir, suffix string) (filename string, err error)
- func GetLocalIPAddress() string
- func GetLocalIPAddressViaIface() string
- func GetMachineCode() string
- func GetNExcludeExcludeHighPort(n int, excluded ...string) []int
- func GetProxyConn(target string, proxy string, connectTimeout time.Duration) (net.Conn, error)
- func GetProxyConnWithContext(ctx context.Context, target string, proxy string, connectTimeout time.Duration) (net.Conn, error)
- func GetProxyFromEnv() string
- func GetRandomAvailableTCPPort() int
- func GetRandomAvailableUDPPort() int
- func GetRandomIPAddress() string
- func GetRandomLocalAddr() string
- func GetSameSubStrings(raw ...string) []string
- func GetSameSubStringsRunes(text1, text2 []rune) [][]rune
- func GetSystemMachineCode() (_ string, err error)
- func GetSystemNameServerList() ([]string, error)
- func GetTargetAddrInterfaceName(targetAddr string) (string, error)
- func GetTargetAddrLocalAddr(targetAddr string) (string, error)
- func GetUnexportedField(field reflect.Value) interface{}
- func GetWeekStartMonday(t time.Time) (time.Time, error)
- func GetWeekStartSunday() (time.Time, error)
- func GzipCompress(i interface{}) ([]byte, error)
- func GzipDeCompress(ret []byte) ([]byte, error)
- func HTTPPacketIsLargerThanMaxContentLength(res interface{}, maxLength int) bool
- func HandleStdout(ctx context.Context, handle func(string)) error
- func HostPort(host string, port interface{}) string
- func HttpDumpWithBody(i interface{}, body bool) ([]byte, error)
- func HttpGet(url string) ([]byte, error)
- func HttpGetWithRetry(retry int, url string) ([]byte, error)
- func HttpShow(i interface{}) []byte
- func IContains(s, sub string) bool
- func IPv4ToCClassNetwork(s string) (string, error)
- func IPv4ToUint32(ip net.IP) (uint32, error)
- func IPv4ToUint64(ip string) (int64, error)
- func IStringContainsAnyOfSubString(s string, subs []string) bool
- func IfaceNameToPcapIfaceName(name string) (string, error)
- func InDebugMode() bool
- func InetAtoN(ip net.IP) int64
- func InetNtoA(ip int64) net.IP
- func InitialCapitalizationEachWords(str string) string
- func Int64SliceToIntSlice(i []int64) []int
- func IntArrayContains(array []int, element int) bool
- func IntLargerZeroOr(s ...int) int
- func IntSliceToInt64Slice(i []int) []int64
- func InterfaceToBytes(i interface{}) (result []byte)
- func InterfaceToBytesSlice(i interface{}) [][]byte
- func InterfaceToGeneralMap(params interface{}) (finalResult map[string]interface{})
- func InterfaceToMap(i interface{}) map[string][]string
- func InterfaceToMapInterface(i interface{}) map[string]interface{}
- func InterfaceToMapInterfaceE(i interface{}) (map[string]interface{}, error)
- func InterfaceToQuotedString(i interface{}) string
- func InterfaceToString(i interface{}) string
- func InterfaceToStringSlice(i interface{}) []string
- func IsASCIIPrint(s string) bool
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsGzip(raw []byte) bool
- func IsGzipBytes(i interface{}) bool
- func IsHttp(raw string) bool
- func IsIPv4(raw string) bool
- func IsIPv6(raw string) bool
- func IsImage(i []byte) bool
- func IsJSON(raw string) (string, bool)
- func IsLoopback(t string) bool
- func IsPortAvailable(host string, p int) bool
- func IsPortAvailableWithUDP(host string, p int) bool
- func IsPrivateIP(ip net.IP) bool
- func IsProtobuf(raw []byte) bool
- func IsStrongPassword(s string) bool
- func IsTCPPortAvailable(p int) bool
- func IsTCPPortAvailableWithLoopback(p int) bool
- func IsTCPPortOpen(host string, p int) bool
- func IsTLSService(addr string, proxies ...string) bool
- func IsUDPPortAvailable(p int) bool
- func IsUDPPortAvailableWithLoopback(p int) bool
- func IsValidCIDR(raw string) bool
- func IsValidDomain(raw string) bool
- func IsValidFloat(raw string) bool
- func IsValidHostsRange(raw string) bool
- func IsValidInteger(raw string) bool
- func IsValidPortsRange(ports string) bool
- func JavaTimeFormatter(t time.Time, formatter string) string
- func Jsonify(i interface{}) []byte
- func LastLine(s []byte) []byte
- func LoopEvery1sBreakUntil(until func() bool)
- func MapGetBool(m map[string]interface{}, key string) bool
- func MapGetBoolOr(m map[string]interface{}, key string, value bool) bool
- func MapGetFirstRaw(m map[string]interface{}, key ...string) interface{}
- func MapGetFloat32(m map[string]interface{}, key string) float32
- func MapGetFloat32Or(m map[string]interface{}, key string, value float32) float32
- func MapGetFloat64(m map[string]interface{}, key string) float64
- func MapGetFloat64Or(m map[string]interface{}, key string, value float64) float64
- func MapGetInt(m map[string]interface{}, key string) int
- func MapGetInt64(m map[string]interface{}, key string) int64
- func MapGetInt64Or(m map[string]interface{}, key string, value int64) int64
- func MapGetIntOr(m map[string]interface{}, key string, value int) int
- func MapGetMapRaw(m map[string]interface{}, key string) map[string]interface{}
- func MapGetMapRawOr(m map[string]interface{}, key string, value map[string]interface{}) map[string]interface{}
- func MapGetRaw(m map[string]interface{}, key string) interface{}
- func MapGetRawOr(m map[string]interface{}, key string, value interface{}) interface{}
- func MapGetString(m map[string]interface{}, key string) string
- func MapGetString2(m map[string]string, key string) string
- func MapGetStringOr(m map[string]interface{}, key string, value string) string
- func MapGetStringOr2(m map[string]string, key string, value string) string
- func MapQueryToString(values map[string][]string) string
- func MapStringGet(m map[string]string, key string) string
- func MapStringGetOr(m map[string]string, key string, value string) string
- func MarshalHTTPRequest(req *http.Request) ([]byte, error)
- func MatchAllOfGlob(i interface{}, re ...string) bool
- func MatchAllOfRegexp(i interface{}, re ...string) bool
- func MatchAllOfSubString(i interface{}, re ...string) bool
- func MatchAnyOfGlob(i interface{}, re ...string) bool
- func MatchAnyOfRegexp(i interface{}, re ...string) bool
- func MatchAnyOfSubString(i interface{}, re ...string) bool
- func Max(x, y int) int
- func MaxByte(x, y byte) byte
- func MaxInt64(x, y int64) int64
- func MergeStringMap(ms ...map[string]string) map[string]string
- func Min(x, y int) int
- func MinByte(x, y byte) byte
- func MinInt64(x, y int64) int64
- func Mmh3Hash32(raw []byte) string
- func NewBlockParser(reader io.Reader) *blockParser
- func NewDefaultGMTLSConfig() *gmtls.Config
- func NewDefaultHTTPClient() *http.Client
- func NewDefaultHTTPClientWithProxy(proxy string) *http.Client
- func NewDefaultTLSClient(conn net.Conn) *tls.Conn
- func NewDefaultTLSConfig() *tls.Config
- func NewNetConnFromReadWriter()
- func NewSignalChannel(targetSignal ...os.Signal) chan os.Signal
- func ParseCStyleBinaryRawToBytes(raw []byte) []byte
- func ParseHostToAddrString(host string) string
- func ParseIPNetToRange(n *net.IPNet) (int64, int64, error)
- func ParseLines(raw string) chan string
- func ParseStringToCClassHosts(targets string) string
- func ParseStringToHostPort(raw string) (host string, port int, err error)
- func ParseStringToHosts(raw string) []string
- func ParseStringToLines(raw string) []string
- func ParseStringToPorts(ports string) []int
- func ParseStringToRawLines(raw string) []string
- func ParseStringToUrlParams(i interface{}) string
- func ParseStringToUrls(targets ...string) []string
- func ParseStringToUrlsWith3W(sub ...string) []string
- func ParseStringToVisible(raw interface{}) string
- func ParseStringUrlToUrlInstance(s string) (*url.URL, error)
- func ParseStringUrlToWebsiteRootPath(s string) string
- func PathExists(path string) (bool, error)
- func PcapInterfaceEqNetInterface(piface pcap.Interface, iface *net.Interface) bool
- func PrettifyListFromStringSplitEx(Raw string, sep ...string) (targets []string)
- func PrettifyListFromStringSplited(Raw string, sep string) (targets []string)
- func PrintCurrentGoroutineRuntimeStack()
- func RandNumberStringBytes(n int) string
- func RandSample(n int, material ...string) string
- func RandSecret(n int) string
- func RandStringBytes(n int) string
- func ReadConnWithTimeout(r net.Conn, timeout time.Duration) ([]byte, error)
- func ReadLineEx(reader io.Reader) (string, int64, error)
- func ReadN(reader io.Reader, n int) ([]byte, error)
- func ReadWithChunkLen(raw []byte, length int) chan []byte
- func ReadWithContext(ctx context.Context, reader io.Reader) []byte
- func ReadWithContextCallback(ctx context.Context, rc io.Reader, callback func([]byte))
- func ReadWithContextCallbackWithMaxLength(ctx context.Context, rc io.Reader, callback func([]byte), length int)
- func ReadWithContextTickCallback(ctx context.Context, rc io.Reader, callback func([]byte) bool, ...)
- func ReadWithLen(r io.Reader, length int) ([]byte, int)
- func ReaderToReaderCloser(body io.Reader) io.ReadCloser
- func RemoveBOM(raw []byte) []byte
- func RemoveBOMForString(raw string) string
- func RemoveRepeatStringSlice(slc []string) []string
- func RemoveRepeatStringSliceByLoop(slc []string) []string
- func RemoveRepeatStringSliceByMap(slc []string) []string
- func RemoveRepeatUintSlice(slc []uint) []uint
- func RemoveRepeatUintSliceByLoop(slc []uint) []uint
- func RemoveRepeatUintSliceByMap(slc []uint) []uint
- func RemoveRepeatedWithStringSlice(slice []string) []string
- func RemoveUnprintableChars(raw string) string
- func RemoveUnprintableCharsWithReplace(raw string, handle func(i byte) string) string
- func RemoveUnprintableCharsWithReplaceItem(raw string) string
- func SSDeepHash(raw []byte) string
- func SaveFile(raw interface{}, filePath string) error
- func SetUnexportedField(field reflect.Value, value interface{})
- func ShuffleInt(slice []int)
- func ShuffleString(slice []string)
- func SimHash(raw []byte) uint64
- func SimilarStr(str1 []rune, str2 []rune) (int, int, int)
- func SliceGroup(origin []string, groupSize int) [][]string
- func SnakeString(s string) string
- func SocketTypeUint32ToString(i uint32) string
- func SplitHostsToPrivateAndPublic(hosts ...string) (privs, pub []string)
- func StableReader(conn io.Reader, timeout time.Duration, maxSize int) []byte
- func StableReaderEx(conn net.Conn, timeout time.Duration, maxSize int) []byte
- func StarAsWildcardToRegexp(prefix string, target string) (*regexp.Regexp, error)
- func StringAfter(value string, a string) string
- func StringArrayContains(array []string, element string) bool
- func StringArrayFilterEmpty(array []string) []string
- func StringArrayIndex(array []string, element string) int
- func StringArrayMerge(t ...[]string) []string
- func StringAsFileParams(target interface{}) []byte
- func StringBefore(value string, a string) string
- func StringContainsAllOfSubString(s string, subs []string) bool
- func StringContainsAnyOfSubString(s string, subs []string) bool
- func StringGlobArrayContains(array []string, element string) bool
- func StringHasPrefix(s string, prefix []string) bool
- func StringLowerAndTrimSpace(raw string) string
- func StringOr(s ...string) string
- func StringReverse(s string) string
- func StringSliceContain(s interface{}, raw string) (result bool)
- func StringSliceContainsAll(o []string, elements ...string) bool
- func StringSplitAndStrip(raw string, sep string) []string
- func StringToAsciiBytes(s string) []byte
- func TCPConnect(target string, timeout time.Duration, proxies ...string) (net.Conn, error)
- func Tick1sWithTimeout(timeout time.Duration, falseToBreak func() bool) (exitedByCondition bool)
- func TickEvery1s(falseToBreak func() bool)
- func TickWithTimeout(timeout, interval time.Duration, falseToBreak func() bool) (exitedByCondition bool)
- func TickWithTimeoutContext(ctx context.Context, timeout, interval time.Duration, falseToBreak func() bool) (exitedByCondition bool)
- func TimeoutContext(d time.Duration) context.Context
- func TimeoutContextSeconds(d float64) context.Context
- func TimestampMs() int64
- func TimestampNano() int64
- func TimestampSecond() int64
- func ToBytes(s string) (uint64, error)
- func ToLowerAndStrip(s string) string
- func ToMapParams(params interface{}) (map[string]interface{}, error)
- func ToMegabytes(s string) (uint64, error)
- func ToNsServer(server string) string
- func TrimFileNameExt(raw string) string
- func Uint32ToIPv4(ip uint32) net.IP
- func UrlJoin(origin string, paths ...string) (string, error)
- func UrlJoinParams(i string, params ...interface{}) string
- func VersionCompare(v1, v2 string) (int, error)
- func VersionEqual(v1, v2 string) bool
- func VersionGreater(v1, v2 string) bool
- func VersionGreaterEqual(v1, v2 string) bool
- func VersionLess(v1, v2 string) bool
- func VersionLessEqual(v1, v2 string) bool
- func WaitConnect(addr string, timeout float64) error
- func WriteConnWithTimeout(w net.Conn, timeout time.Duration, data []byte) error
- func ZlibCompress(i interface{}) ([]byte, error)
- func ZlibDeCompress(ret []byte) ([]byte, error)
- type AtomicBool
- type BruteDictParser
- type BufferedPeekableConn
- func (b *BufferedPeekableConn) GetBuf() []byte
- func (b *BufferedPeekableConn) GetOriginConn() net.Conn
- func (b *BufferedPeekableConn) GetReader() io.Reader
- func (b *BufferedPeekableConn) Peek(i int) ([]byte, error)
- func (b *BufferedPeekableConn) PeekByte() (byte, error)
- func (b *BufferedPeekableConn) PeekUint16() uint16
- func (b *BufferedPeekableConn) Read(buf []byte) (int, error)
- func (b *BufferedPeekableConn) SetBuf(buf []byte)
- type BufferedPeekableReader
- type BufferedPeekableReaderWriter
- func (b *BufferedPeekableReaderWriter) GetBuf() []byte
- func (b *BufferedPeekableReaderWriter) GetReader() io.Reader
- func (b *BufferedPeekableReaderWriter) Peek(i int) ([]byte, error)
- func (b *BufferedPeekableReaderWriter) Read(buf []byte) (int, error)
- func (b *BufferedPeekableReaderWriter) SetBuf(buf []byte)
- type ConvertIfaceNameError
- type CoolDown
- type DelayWaiter
- type FileInfo
- type FloatSecondsDelayWaiter
- type HTTPPacketFilter
- func (j *HTTPPacketFilter) Conditions() []string
- func (h *HTTPPacketFilter) Hash() string
- func (h *HTTPPacketFilter) IsAllowed(req *http.Request, rsp *http.Response) bool
- func (i *HTTPPacketFilter) Remove(name string)
- func (j *HTTPPacketFilter) SetAllowForRequestHeader(header, regexp string)
- func (j *HTTPPacketFilter) SetAllowForRequestPath(regexp string)
- func (j *HTTPPacketFilter) SetAllowForRequestRaw(regexp string)
- func (j *HTTPPacketFilter) SetAllowForResponseHeader(header, regexp string)
- func (j *HTTPPacketFilter) SetAllowForResponseRaw(regexp string)
- func (j *HTTPPacketFilter) SetRejectForRequestHeader(header, regexp string)
- func (j *HTTPPacketFilter) SetRejectForRequestPath(regexp string)
- func (j *HTTPPacketFilter) SetRejectForRequestRaw(regexp string)
- func (j *HTTPPacketFilter) SetRejectForResponseHeader(header, regexp string)
- func (j *HTTPPacketFilter) SetRejectForResponseRaw(regexp string)
- type HostPortClassifier
- type HostsFilter
- type LimitRate
- type MatchedRule
- type PathForest
- type PathNodes
- type PortScanTarget
- type PortsFilter
- type ProbeRule
- type ProtoType
- type Quake360Client
- type SSHClient
- func SSHDial(network, addr string, config *ssh.ClientConfig) (*SSHClient, error)
- func SSHDialWithKey(addr, user, keyfile string) (*SSHClient, error)
- func SSHDialWithKeyWithPassphrase(addr, user, keyfile string, passphrase string) (*SSHClient, error)
- func SSHDialWithPasswd(addr, user, passwd string) (*SSHClient, error)
- func (c *SSHClient) Close() error
- func (c *SSHClient) Cmd(cmd string) *SSHRemoteScript
- func (c *SSHClient) CopyLocalFileToRemote(srcFilePath string, dstFilePath string) error
- func (c *SSHClient) CopyRemoteFileToLocal(dstFilePath string, srcFilePath string) error
- func (c *SSHClient) Script(script string) *SSHRemoteScript
- func (c *SSHClient) ScriptFile(fname string) *SSHRemoteScript
- func (c *SSHClient) Shell() *SSHRemoteShell
- func (c *SSHClient) Terminal(config *TerminalConfig) *SSHRemoteShell
- type SSHRemoteScript
- type SSHRemoteScriptType
- type SSHRemoteShell
- type SSHRemoteShellType
- type Set
- type SizedWaitGroup
- type Stack
- type StringRoundRobinSelector
- type SubProcess
- func (s *SubProcess) CombinedOutput() ([]byte, error)
- func (s *SubProcess) GetStderr() []byte
- func (s *SubProcess) GetStdout() []byte
- func (s *SubProcess) Run() error
- func (s *SubProcess) SetStderrTickCallback(cb func(raws interface{}))
- func (s *SubProcess) SetStdoutTickCallback(cb func(raws interface{}))
- func (s *SubProcess) Start() error
- type TerminalConfig
- type UserPassPair
- type WebHookServer
Examples ¶
Constants ¶
const ( BYTE = 1 << (10 * iota) KILOBYTE MEGABYTE GIGABYTE TERABYTE PETABYTE EXABYTE )
const ( AllSepcialChars = ",./<>?;':\"[]{}`~!@#$%^&*()_+-=\\|" LittleChar = "abcdefghijklmnopqrstuvwxyz" BigChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" NumberChar = "1234567890" )
const DefaultDateFormat = "2006-01-02"
const DefaultTimeFormat = "2006_01_02-15_04_05"
const DefaultTimeFormat2 = "20060102_15_04_05"
Variables ¶
var ( DefaultDNSClient = dns.Client{ Timeout: 5 * time.Second, DialTimeout: 5 * time.Second, ReadTimeout: 5 * time.Second, WriteTimeout: 5 * time.Second, } RetryableDNSClient = &retryabledns.Client{ TCPFallback: false, } DefaultDNSConn = dns.Dial DefaultDNSServer = []string{ "223.5.5.5", "119.29.29.29", "180.76.76.76", "114.114.114.114", "1.1.1.1", "8.8.8.8", } )
var BashCompleteScriptTpl = `` /* 1147-byte string literal not displayed */
var GBKSafeString = codec.GBKSafeString
var GbkToUtf8 = codec.GbkToUtf8
var ParseStringToInts = ParseStringToPorts
var (
TargetIsLoopback = Errorf("loopback")
)
var Utf8ToGbk = codec.Utf8ToGbk
var WaitBySignal = func(fn func(), sigs ...os.Signal) { sigC := NewSignalChannel(sigs...) defer signal.Stop(sigC) for { select { case <-sigC: log.Warn("recv signal abort") fn() return } } }
var WaitReleaseBySignal = func(fn func()) { sigC := NewSignalChannel(os.Interrupt, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL) defer signal.Stop(sigC) for { select { case <-sigC: log.Warn("recv signal abort") fn() return } } }
var ZshCompleteScriptTpl = `` /* 1072-byte string literal not displayed */
Functions ¶
func ARPWithPcap ¶
func ArpWithContext ¶
func ArpWithTimeout ¶
func AsciiEqualFold ¶
AsciiEqualFold is strings.EqualFold, ASCII only. It reports whether s and t are equal, ASCII-case-insensitively.
func AsciiToLower ¶
asciiToLower returns the lowercase version of s if s is ASCII and printable, and whether or not it was.
func ByteCountBinary ¶
func ByteCountDecimal ¶
func ByteSize ¶
ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The following units are available:
E: Exabyte P: Petabyte T: Terabyte G: Gigabyte M: Megabyte K: Kilobyte B: Byte
The unit that results in the smallest number greater than or equal to 1 is always chosen.
func BytesClone ¶
func BytesStripUntil ¶
func CalcFaviconHash ¶
func CalcSSDeepStability ¶
稳定性定义为最远距离 / 最低分数
func CalcSha1WithSuffix ¶
func CalcSimHashStability ¶
计算 simhash 稳定性
func CalcSimilarity ¶
func ChanStringToSlice ¶
func ConcatPorts ¶
func ConnExpect ¶
func ConvertToStringSlice ¶
func ConvertToStringSlice(raw ...interface{}) (r []string)
func CopyMapInterface ¶
func CopyReader ¶
func CopyReader(r io.ReadCloser) (io.ReadCloser, io.ReadCloser, error)
func DataVerbose ¶
func DataVerbose(i interface{}) string
func DatetimePretty ¶
func DatetimePretty() string
func DatetimePretty2 ¶
func DatetimePretty2() string
func DebugMockHTTP ¶
func DownloadFile ¶
func EscapeInvalidUTF8Byte ¶
func ExtractHost ¶
func ExtractHostPort ¶
func ExtractRawPath ¶
func FileLineReader ¶
func FixForParseIP ¶
func FixJsonRawBytes ¶
func FloatSecondDuration ¶
func GetAllFiles ¶
func GetAutoProxyConn ¶
func GetAutoProxyConnWithTLS ¶
func GetCClassByIPv4 ¶
func GetCurrentDate ¶
func GetCurrentWeekMonday ¶
func GetFileAbsDir ¶
func GetFileAbsPath ¶
func GetFileMd5 ¶
func GetFileModTime ¶
func GetFirstExistedFile ¶
func GetFirstExistedFileE ¶
func GetFirstExistedPath ¶
func GetFirstExistedPathE ¶
func GetHomeDir ¶
func GetHomeDirDefault ¶
func GetLatestFile ¶
func GetLocalIPAddress ¶
func GetLocalIPAddress() string
func GetLocalIPAddressViaIface ¶
func GetLocalIPAddressViaIface() string
func GetMachineCode ¶
func GetMachineCode() string
func GetProxyConn ¶
func GetProxyConnWithContext ¶
func GetProxyFromEnv ¶
func GetProxyFromEnv() string
func GetRandomAvailableTCPPort ¶
func GetRandomAvailableTCPPort() int
func GetRandomAvailableUDPPort ¶
func GetRandomAvailableUDPPort() int
func GetRandomIPAddress ¶
func GetRandomIPAddress() string
func GetRandomLocalAddr ¶
func GetRandomLocalAddr() string
func GetSameSubStrings ¶
func GetSameSubStringsRunes ¶
func GetSystemMachineCode ¶
func GetSystemNameServerList ¶
func GetTargetAddrLocalAddr ¶
func GetUnexportedField ¶
func GetWeekStartSunday ¶
func GzipCompress ¶
func GzipDeCompress ¶
func HttpDumpWithBody ¶
func IPv4ToCClassNetwork ¶
func IPv4ToUint64 ¶
func InDebugMode ¶
func InDebugMode() bool
func InitialCapitalizationEachWords ¶
每个单词首字母大写
func Int64SliceToIntSlice ¶
func IntArrayContains ¶
func IntLargerZeroOr ¶
func IntSliceToInt64Slice ¶
func InterfaceToBytes ¶
func InterfaceToBytes(i interface{}) (result []byte)
func InterfaceToBytesSlice ¶
func InterfaceToBytesSlice(i interface{}) [][]byte
func InterfaceToGeneralMap ¶
func InterfaceToGeneralMap(params interface{}) (finalResult map[string]interface{})
func InterfaceToMap ¶
func InterfaceToMapInterface ¶
func InterfaceToMapInterface(i interface{}) map[string]interface{}
func InterfaceToQuotedString ¶
func InterfaceToQuotedString(i interface{}) string
func InterfaceToString ¶
func InterfaceToString(i interface{}) string
func InterfaceToStringSlice ¶
func InterfaceToStringSlice(i interface{}) []string
func IsASCIIPrint ¶
isASCIIPrint returns whether s is ASCII and printable according to https://tools.ietf.org/html/rfc20#section-4.2.
func IsGzipBytes ¶
func IsGzipBytes(i interface{}) bool
func IsLoopback ¶
func IsPortAvailable ¶
func IsPortAvailableWithUDP ¶
func IsPrivateIP ¶
func IsProtobuf ¶
func IsStrongPassword ¶
func IsTCPPortAvailable ¶
func IsTCPPortOpen ¶
func IsTLSService ¶
func IsUDPPortAvailable ¶
func IsValidCIDR ¶
func IsValidDomain ¶
func IsValidFloat ¶
func IsValidHostsRange ¶
func IsValidInteger ¶
func IsValidPortsRange ¶
func LoopEvery1sBreakUntil ¶
func LoopEvery1sBreakUntil(until func() bool)
func MapGetBool ¶
func MapGetFirstRaw ¶
func MapGetFloat32 ¶
func MapGetFloat32Or ¶
func MapGetFloat64 ¶
func MapGetFloat64Or ¶
func MapGetInt64 ¶
func MapGetMapRaw ¶
func MapGetMapRawOr ¶
func MapGetRawOr ¶
func MapGetString ¶
func MapGetStringOr ¶
func MapQueryToString ¶
map[string][]string to query
func MatchAllOfGlob ¶
func MatchAllOfRegexp ¶
func MatchAllOfSubString ¶
func MatchAnyOfGlob ¶
func MatchAnyOfRegexp ¶
func MatchAnyOfSubString ¶
func Mmh3Hash32 ¶
func NewBlockParser ¶
func NewDefaultGMTLSConfig ¶
func NewDefaultHTTPClient ¶
func NewDefaultTLSConfig ¶
func NewNetConnFromReadWriter ¶
func NewNetConnFromReadWriter()
func ParseHostToAddrString ¶
func ParseLines ¶
func ParseStringToHostPort ¶
func ParseStringToHosts ¶
func ParseStringToLines ¶
func ParseStringToPorts ¶
func ParseStringToRawLines ¶
func ParseStringToUrlParams ¶
func ParseStringToUrlParams(i interface{}) string
func ParseStringToUrls ¶
func ParseStringToUrlsWith3W ¶
func ParseStringToVisible ¶
func ParseStringToVisible(raw interface{}) string
func PathExists ¶
func PrintCurrentGoroutineRuntimeStack ¶
func PrintCurrentGoroutineRuntimeStack()
func RandNumberStringBytes ¶
func RandSample ¶
func RandSecret ¶
func RandStringBytes ¶
func ReadConnWithTimeout ¶
func ReadWithChunkLen ¶
func ReadWithContextCallback ¶
func ReaderToReaderCloser ¶
func ReaderToReaderCloser(body io.Reader) io.ReadCloser
func RemoveBOMForString ¶
func RemoveUnprintableChars ¶
func SSDeepHash ¶
func SetUnexportedField ¶
func ShuffleInt ¶
func ShuffleInt(slice []int)
func ShuffleString ¶
func ShuffleString(slice []string)
func SimilarStr ¶
return the len of longest string both in str1 and str2 and the positions in str1 and str2
func SliceGroup ¶
func SnakeString ¶
func StarAsWildcardToRegexp ¶
func StringAfter ¶
func StringArrayContains ¶
func StringArrayFilterEmpty ¶
func StringArrayIndex ¶
func StringArrayMerge ¶
func StringAsFileParams ¶
func StringAsFileParams(target interface{}) []byte
func StringBefore ¶
func StringGlobArrayContains ¶
func StringHasPrefix ¶
func StringLowerAndTrimSpace ¶
func StringSliceContain ¶
func StringSliceContainsAll ¶
func StringSplitAndStrip ¶
func StringToAsciiBytes ¶
func TCPConnect ¶
func Tick1sWithTimeout ¶
func TickEvery1s ¶
func TickEvery1s(falseToBreak func() bool)
func TickWithTimeout ¶
func TickWithTimeoutContext ¶
func TimeoutContextSeconds ¶
func TimestampMs ¶
func TimestampMs() int64
func TimestampNano ¶
func TimestampNano() int64
func TimestampSecond ¶
func TimestampSecond() int64
func ToBytes ¶
ToBytes parses a string formatted by ByteSize as bytes. Note binary-prefixed and SI prefixed units both mean a base-2 units KB = K = KiB = 1024 MB = M = MiB = 1024 * K GB = G = GiB = 1024 * M TB = T = TiB = 1024 * G PB = P = PiB = 1024 * T EB = E = EiB = 1024 * P
func ToLowerAndStrip ¶
func ToMapParams ¶
func ToMegabytes ¶
ToMegabytes parses a string formatted by ByteSize as megabytes.
func ToNsServer ¶
func TrimFileNameExt ¶
func Uint32ToIPv4 ¶
func UrlJoin ¶
https://baidu.com/abc a?key=value https://baidu.com/abc/a?key=value => [X] https://baidu.com/abc/a%xxkey=value
func UrlJoinParams ¶
func VersionCompare ¶
VersionCompare 泛用形的版本比较,传入(p1,p2 string), p1>p2返回1,nil, p1<p2返回-1,nil, p1==p2返回0,nil, 比较失败返回 -2,err
func VersionGreaterEqual ¶
VersionGreaterEqual v1 大于等于 v2 返回 true
func VersionLessEqual ¶
VersionLessEqual v1 小于等于 v2 返回true
func WaitConnect ¶
func WriteConnWithTimeout ¶
func ZlibCompress ¶
func ZlibDeCompress ¶
Types ¶
type AtomicBool ¶
type AtomicBool int32
AtomicBool is an atomic Boolean Its methods are all atomic, thus safe to be called by multiple goroutines simultaneously Note: When embedding into a struct, one should always use *AtomicBool to avoid copy
Example ¶
cond := NewAtomicBool() // default to false cond.Set() // set to true cond.IsSet() // returns true cond.UnSet() // set to false cond.SetTo(true) // set to whatever you want
Output:
func NewAtomicBool ¶
func NewAtomicBool() *AtomicBool
New creates an AtomicBool with default to false
func NewBool ¶
func NewBool(ok bool) *AtomicBool
NewBool creates an AtomicBool with given default value
func (*AtomicBool) IsSet ¶
func (ab *AtomicBool) IsSet() bool
IsSet returns whether the Boolean is true
func (*AtomicBool) SetTo ¶
func (ab *AtomicBool) SetTo(yes bool)
SetTo sets the boolean with given Boolean
func (*AtomicBool) SetToIf ¶
func (ab *AtomicBool) SetToIf(old, new bool) (set bool)
SetToIf sets the Boolean to new only if the Boolean matches the old Returns whether the set was done
type BruteDictParser ¶
type BruteDictParser struct {
UserDictFile, PassDictFile *os.File
UserDict, PassDict *bufio.Scanner
// contains filtered or unexported fields
}
func NewBruteDictParser ¶
func NewBruteDictParser(userDict, passDict string) (*BruteDictParser, error)
func (*BruteDictParser) Next ¶
func (b *BruteDictParser) Next() (*UserPassPair, error)
type BufferedPeekableConn ¶
func NewPeekableNetConn ¶
func NewPeekableNetConn(r net.Conn) *BufferedPeekableConn
func (*BufferedPeekableConn) GetBuf ¶
func (b *BufferedPeekableConn) GetBuf() []byte
func (*BufferedPeekableConn) GetOriginConn ¶
func (b *BufferedPeekableConn) GetOriginConn() net.Conn
func (*BufferedPeekableConn) GetReader ¶
func (b *BufferedPeekableConn) GetReader() io.Reader
func (*BufferedPeekableConn) PeekByte ¶
func (b *BufferedPeekableConn) PeekByte() (byte, error)
func (*BufferedPeekableConn) PeekUint16 ¶
func (b *BufferedPeekableConn) PeekUint16() uint16
func (*BufferedPeekableConn) SetBuf ¶
func (b *BufferedPeekableConn) SetBuf(buf []byte)
type BufferedPeekableReader ¶
func NewPeekableReader ¶
func NewPeekableReader(r io.Reader) *BufferedPeekableReader
func (*BufferedPeekableReader) GetBuf ¶
func (b *BufferedPeekableReader) GetBuf() []byte
func (*BufferedPeekableReader) GetReader ¶
func (b *BufferedPeekableReader) GetReader() io.Reader
func (*BufferedPeekableReader) Read ¶
func (b *BufferedPeekableReader) Read(buf []byte) (int, error)
func (*BufferedPeekableReader) SetBuf ¶
func (b *BufferedPeekableReader) SetBuf(buf []byte)
type BufferedPeekableReaderWriter ¶
type BufferedPeekableReaderWriter struct { io.ReadWriter // contains filtered or unexported fields }
func NewPeekableReaderWriter ¶
func NewPeekableReaderWriter(r io.ReadWriter) *BufferedPeekableReaderWriter
func (*BufferedPeekableReaderWriter) GetBuf ¶
func (b *BufferedPeekableReaderWriter) GetBuf() []byte
func (*BufferedPeekableReaderWriter) GetReader ¶
func (b *BufferedPeekableReaderWriter) GetReader() io.Reader
func (*BufferedPeekableReaderWriter) Peek ¶
func (b *BufferedPeekableReaderWriter) Peek(i int) ([]byte, error)
func (*BufferedPeekableReaderWriter) Read ¶
func (b *BufferedPeekableReaderWriter) Read(buf []byte) (int, error)
func (*BufferedPeekableReaderWriter) SetBuf ¶
func (b *BufferedPeekableReaderWriter) SetBuf(buf []byte)
type ConvertIfaceNameError ¶
type ConvertIfaceNameError struct {
// contains filtered or unexported fields
}
func NewConvertIfaceNameError ¶
func NewConvertIfaceNameError(name string) *ConvertIfaceNameError
func (*ConvertIfaceNameError) Error ¶
func (e *ConvertIfaceNameError) Error() string
type CoolDown ¶
type CoolDown struct {
// contains filtered or unexported fields
}
func NewCoolDown ¶
type DelayWaiter ¶
type DelayWaiter struct {
// contains filtered or unexported fields
}
delay with range
func NewDelayWaiter ¶
func NewDelayWaiter(min int32, max int32) (*DelayWaiter, error)
func (*DelayWaiter) Wait ¶
func (d *DelayWaiter) Wait()
func (*DelayWaiter) WaitWithProbabilityPercent ¶
func (d *DelayWaiter) WaitWithProbabilityPercent(raw float64)
type FloatSecondsDelayWaiter ¶
type FloatSecondsDelayWaiter struct {
// contains filtered or unexported fields
}
delay with range
func NewFloatSecondsDelayWaiter ¶
func NewFloatSecondsDelayWaiter(min, max float64) (*FloatSecondsDelayWaiter, error)
func NewFloatSecondsDelayWaiterSingle ¶
func NewFloatSecondsDelayWaiterSingle(min float64) (*FloatSecondsDelayWaiter, error)
func (*FloatSecondsDelayWaiter) Wait ¶
func (d *FloatSecondsDelayWaiter) Wait()
func (*FloatSecondsDelayWaiter) WaitWithProbabilityPercent ¶
func (d *FloatSecondsDelayWaiter) WaitWithProbabilityPercent(raw float64)
type HTTPPacketFilter ¶
type HTTPPacketFilter struct {
// contains filtered or unexported fields
}
func NewHTTPPacketFilter ¶
func NewHTTPPacketFilter() *HTTPPacketFilter
func (*HTTPPacketFilter) Conditions ¶
func (j *HTTPPacketFilter) Conditions() []string
func (*HTTPPacketFilter) Hash ¶
func (h *HTTPPacketFilter) Hash() string
func (*HTTPPacketFilter) Remove ¶
func (i *HTTPPacketFilter) Remove(name string)
func (*HTTPPacketFilter) SetAllowForRequestHeader ¶
func (j *HTTPPacketFilter) SetAllowForRequestHeader(header, regexp string)
func (*HTTPPacketFilter) SetAllowForRequestPath ¶
func (j *HTTPPacketFilter) SetAllowForRequestPath(regexp string)
func (*HTTPPacketFilter) SetAllowForRequestRaw ¶
func (j *HTTPPacketFilter) SetAllowForRequestRaw(regexp string)
func (*HTTPPacketFilter) SetAllowForResponseHeader ¶
func (j *HTTPPacketFilter) SetAllowForResponseHeader(header, regexp string)
func (*HTTPPacketFilter) SetAllowForResponseRaw ¶
func (j *HTTPPacketFilter) SetAllowForResponseRaw(regexp string)
func (*HTTPPacketFilter) SetRejectForRequestHeader ¶
func (j *HTTPPacketFilter) SetRejectForRequestHeader(header, regexp string)
func (*HTTPPacketFilter) SetRejectForRequestPath ¶
func (j *HTTPPacketFilter) SetRejectForRequestPath(regexp string)
func (*HTTPPacketFilter) SetRejectForRequestRaw ¶
func (j *HTTPPacketFilter) SetRejectForRequestRaw(regexp string)
func (*HTTPPacketFilter) SetRejectForResponseHeader ¶
func (j *HTTPPacketFilter) SetRejectForResponseHeader(header, regexp string)
func (*HTTPPacketFilter) SetRejectForResponseRaw ¶
func (j *HTTPPacketFilter) SetRejectForResponseRaw(regexp string)
type HostPortClassifier ¶
type HostPortClassifier struct {
// contains filtered or unexported fields
}
func NewHostPortClassifier ¶
func NewHostPortClassifier() *HostPortClassifier
func (*HostPortClassifier) AddHostPort ¶
func (*HostPortClassifier) FilterTagByHostPort ¶
func (h *HostPortClassifier) FilterTagByHostPort(host string, port int) []string
type HostsFilter ¶
type HostsFilter struct {
// contains filtered or unexported fields
}
func NewHostsFilter ¶
func NewHostsFilter(excludeHosts ...string) *HostsFilter
func (*HostsFilter) Add ¶
func (f *HostsFilter) Add(block ...string)
func (*HostsFilter) Contains ¶
func (f *HostsFilter) Contains(target string) bool
type LimitRate ¶
type LimitRate struct {
// contains filtered or unexported fields
}
func NewLimitRate ¶
func (*LimitRate) WaitUntilNextAsync ¶
func (l *LimitRate) WaitUntilNextAsync()
func (*LimitRate) WaitUntilNextAsyncWithFallback ¶
func (l *LimitRate) WaitUntilNextAsyncWithFallback(f func())
func (*LimitRate) WaitUntilNextSync ¶
func (l *LimitRate) WaitUntilNextSync()
type MatchedRule ¶
func ParseNmapServiceMatchedRule ¶
func ParseNmapServiceMatchedRule(raw []byte) []*MatchedRule
type PathForest ¶
type PathForest struct {
// contains filtered or unexported fields
}
func GeneratePathTrees ¶
func GeneratePathTrees(l ...string) (*PathForest, error)
func (*PathForest) Output ¶
func (p *PathForest) Output() []*pathNode
type PortScanTarget ¶
func SplitHostsAndPorts ¶
func SplitHostsAndPorts(hosts, ports string, portGroupSize int, proto string) []PortScanTarget
func (*PortScanTarget) String ¶
func (t *PortScanTarget) String() string
type PortsFilter ¶
type PortsFilter struct {
// contains filtered or unexported fields
}
func NewPortsFilter ¶
func NewPortsFilter(blocks ...string) *PortsFilter
func (*PortsFilter) Add ¶
func (f *PortsFilter) Add(block ...string)
func (*PortsFilter) Contains ¶
func (f *PortsFilter) Contains(port int) bool
type ProbeRule ¶
type ProbeRule struct { Type ProtoType Payload []byte Matched []*MatchedRule }
type Quake360Client ¶
type Quake360Client struct {
// contains filtered or unexported fields
}
func NewQuake360Client ¶
func NewQuake360Client(apiKey string) *Quake360Client
func (*Quake360Client) QueryNext ¶
func (q *Quake360Client) QueryNext(queries ...string) ([]quakeschema.Data, error)
func (*Quake360Client) UserInfo ¶
func (q *Quake360Client) UserInfo() (*quakeUserInfo, error)
type SSHClient ¶
type SSHClient struct {
// contains filtered or unexported fields
}
func SSHDial ¶
func SSHDial(network, addr string, config *ssh.ClientConfig) (*SSHClient, error)
SSHDial starts a client connection to the given SSH server. This is wrap the ssh.SSHDial
func SSHDialWithKey ¶
SSHDialWithKey starts a client connection to the given SSH server with key authmethod.
func SSHDialWithKeyWithPassphrase ¶
func SSHDialWithKeyWithPassphrase(addr, user, keyfile string, passphrase string) (*SSHClient, error)
SSHDialWithKeyWithPassphrase same as SSHDialWithKey but with a passphrase to decrypt the private key
func SSHDialWithPasswd ¶
SSHDialWithPasswd starts a client connection to the given SSH server with passwd authmethod.
func (*SSHClient) Cmd ¶
func (c *SSHClient) Cmd(cmd string) *SSHRemoteScript
Cmd create a command on client
func (*SSHClient) CopyLocalFileToRemote ¶
Copy local file to remote
func (*SSHClient) CopyRemoteFileToLocal ¶
Copy remote file to local
func (*SSHClient) ScriptFile ¶
func (c *SSHClient) ScriptFile(fname string) *SSHRemoteScript
ScriptFile
func (*SSHClient) Shell ¶
func (c *SSHClient) Shell() *SSHRemoteShell
Shell create a noninteractive shell on client.
func (*SSHClient) Terminal ¶
func (c *SSHClient) Terminal(config *TerminalConfig) *SSHRemoteShell
Terminal create a interactive shell on client.
type SSHRemoteScript ¶
type SSHRemoteScript struct {
// contains filtered or unexported fields
}
func (*SSHRemoteScript) Cmd ¶
func (rs *SSHRemoteScript) Cmd(cmd string) *SSHRemoteScript
func (*SSHRemoteScript) Output ¶
func (rs *SSHRemoteScript) Output() ([]byte, error)
func (*SSHRemoteScript) SetStdio ¶
func (rs *SSHRemoteScript) SetStdio(stdout, stderr io.Writer) *SSHRemoteScript
func (*SSHRemoteScript) SmartOutput ¶
func (rs *SSHRemoteScript) SmartOutput() ([]byte, error)
type SSHRemoteScriptType ¶
type SSHRemoteScriptType byte
type SSHRemoteShell ¶
type SSHRemoteShell struct {
// contains filtered or unexported fields
}
func (*SSHRemoteShell) SetStdio ¶
func (rs *SSHRemoteShell) SetStdio(stdin io.Reader, stdout, stderr io.Writer) *SSHRemoteShell
func (*SSHRemoteShell) Start ¶
func (rs *SSHRemoteShell) Start() error
Start start a remote shell on client
type SSHRemoteShellType ¶
type SSHRemoteShellType byte
type SizedWaitGroup ¶
type SizedWaitGroup struct { Size int WaitingEventCount int // contains filtered or unexported fields }
SizedWaitGroup has the same role and close to the same API as the Golang sync.WaitGroup but adds a limit of the amount of goroutines started concurrently.
func NewSizedWaitGroup ¶
func NewSizedWaitGroup(limit int) SizedWaitGroup
New creates a SizedWaitGroup. The limit parameter is the maximum amount of goroutines which can be started concurrently.
func (*SizedWaitGroup) Add ¶
func (s *SizedWaitGroup) Add()
Add increments the internal WaitGroup counter. It can be blocking if the limit of spawned goroutines has been reached. It will stop blocking when Done is been called.
See sync.WaitGroup documentation for more information.
func (*SizedWaitGroup) AddWithContext ¶
func (s *SizedWaitGroup) AddWithContext(ctx context.Context) error
AddWithContext increments the internal WaitGroup counter. It can be blocking if the limit of spawned goroutines has been reached. It will stop blocking when Done is been called, or when the context is canceled. Returns nil on success or an error if the context is canceled before the lock is acquired.
See sync.WaitGroup documentation for more information.
func (*SizedWaitGroup) Done ¶
func (s *SizedWaitGroup) Done()
Done decrements the SizedWaitGroup counter. See sync.WaitGroup documentation for more information.
func (*SizedWaitGroup) Wait ¶
func (s *SizedWaitGroup) Wait()
Wait blocks until the SizedWaitGroup counter is zero. See sync.WaitGroup documentation for more information.
type StringRoundRobinSelector ¶
type StringRoundRobinSelector struct {
// contains filtered or unexported fields
}
func NewStringRoundRobinSelector ¶
func NewStringRoundRobinSelector(l ...string) *StringRoundRobinSelector
func (*StringRoundRobinSelector) Add ¶
func (s *StringRoundRobinSelector) Add(raw ...string)
func (*StringRoundRobinSelector) Len ¶
func (s *StringRoundRobinSelector) Len() int
func (*StringRoundRobinSelector) List ¶
func (s *StringRoundRobinSelector) List() []string
func (*StringRoundRobinSelector) Next ¶
func (s *StringRoundRobinSelector) Next() string
type SubProcess ¶
type SubProcess struct { Ctx context.Context Cmd *exec.Cmd StderrTickReader, StdoutTickReader io.Reader // contains filtered or unexported fields }
func NewSubProcess ¶
func NewSubProcess(ctx context.Context, name string, args ...string) *SubProcess
func (*SubProcess) CombinedOutput ¶
func (s *SubProcess) CombinedOutput() ([]byte, error)
func (*SubProcess) GetStderr ¶
func (s *SubProcess) GetStderr() []byte
func (*SubProcess) GetStdout ¶
func (s *SubProcess) GetStdout() []byte
func (*SubProcess) Run ¶
func (s *SubProcess) Run() error
func (*SubProcess) SetStderrTickCallback ¶
func (s *SubProcess) SetStderrTickCallback(cb func(raws interface{}))
func (*SubProcess) SetStdoutTickCallback ¶
func (s *SubProcess) SetStdoutTickCallback(cb func(raws interface{}))
func (*SubProcess) Start ¶
func (s *SubProcess) Start() error
type TerminalConfig ¶
type TerminalConfig struct { Term string Height int Weight int Modes ssh.TerminalModes }
type UserPassPair ¶
type WebHookServer ¶
type WebHookServer struct {
// contains filtered or unexported fields
}
func NewWebHookServer ¶
func NewWebHookServer(port int, cb func(data interface{})) *WebHookServer
func (*WebHookServer) Addr ¶
func (w *WebHookServer) Addr() string
func (*WebHookServer) Shutdown ¶
func (w *WebHookServer) Shutdown()
func (*WebHookServer) Start ¶
func (w *WebHookServer) Start()
Source Files ¶
- arp.go
- atomic_bool.go
- auto-complete-tpl.go
- bytes-reader.go
- bytes_utils.go
- bytesfmt.go
- cd.go
- compare.go
- crawler_utils.go
- debugprint.go
- definitions.go
- delay-chan.go
- delayer_float64.go
- dict-utils.go
- dns.go
- faviconhash.go
- filetype.go
- fileutil.go
- gzip.go
- host_n_port_utils.go
- http2.go
- http_utils.go
- httpfilter.go
- is_private_net.go
- is_tls.go
- javatime.go
- limit_rate.go
- limited_read.go
- line-reader.go
- listener.go
- map_op.go
- matcher.go
- math_utils.go
- misc.go
- netparser_utils.go
- nmap-rule-parser.go
- os_utils.go
- parse-host.go
- peekableConn.go
- quake360.go
- read_fp.go
- redirect_stdout.go
- roundrobin.go
- signal_chan_utils.go
- sized-waitgroup.go
- ssh_client.go
- stack.go
- str_calc.go
- str_utils.go
- string-op.go
- subprocess.go
- threadsafe-set.go
- time.go
- tree.go
- unsafe.go
- url.go
- url_fix.go
- utils.go
- validator.go
- version_compare.go
- webhook.go
Directories ¶
Path | Synopsis |
---|---|
grdp/example
main.go
|
main.go |
grdp/protocol/rfb
rfb.go
|
rfb.go |
Package htmlquery provides extract data from HTML documents using XPath expression.
|
Package htmlquery provides extract data from HTML documents using XPath expression. |
lowhttp2
Package http2 implements the HTTP/2 protocol.
|
Package http2 implements the HTTP/2 protocol. |
lowhttp2/hpack
Package hpack implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
|
Package hpack implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2. |
netroute
Originally found in https://github.com/google/gopacket/blob/master/routing/routing.go
|
Originally found in https://github.com/google/gopacket/blob/master/routing/routing.go |
fofa
Package fofa implements some fofa-api utility functions.
|
Package fofa implements some fofa-api utility functions. |
go-shodan
Package shodan is an interface for the Shodan API
|
Package shodan is an interface for the Shodan API |
go-pkcs12
Package pkcs12 implements some of PKCS#12 (also known as P12 or PFX).
|
Package pkcs12 implements some of PKCS#12 (also known as P12 or PFX). |
go-pkcs12/rc2
Package rc2 implements the RC2 cipher
|
Package rc2 implements the RC2 cipher |