util

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: AGPL-3.0 Imports: 31 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParamFilter = []string{"submit", "reset", "button", "image", "hidden", "csrf_token", "user_token", "userToken"}

ParamFilter 过滤一些参数不进行处理 https://github.com/yhy0/Jie/issues/4 TODO 待增加

Functions

func ArrayToString

func ArrayToString(arr []string) string

ArrayToString 数组转字符串,空格分开

func Base64Encode

func Base64Encode(braw []byte) []byte

func BytesToString

func BytesToString(b []byte) string

func CheckCdn added in v1.0.0

func CheckCdn(target string) (cdn bool, value string, itemType string, dnsData *retryabledns.DNSData)

func CheckErrs

func CheckErrs(err error) bool

func Cidr2IPs

func Cidr2IPs(cidr string) []string

Cidr2IPs C段转ip

func Contains

func Contains(stringA, stringB string) bool

func CvtLines

func CvtLines(s string) []string

func DecodeBase64 added in v0.3.1

func DecodeBase64(i string) ([]byte, error)

func DecodeHex added in v0.3.1

func DecodeHex(i string) ([]byte, error)

func Difference

func Difference(slice1, slice2 []string) []string

func EncodeBase64 added in v0.3.1

func EncodeBase64(i interface{}) string

func Exists

func Exists(path string) bool

Exists 判断所给路径文件/文件夹是否存在

func ExtractParameters added in v1.0.0

func ExtractParameters(u, method string, requestBody string, header map[string]string) []string

ExtractParameters 提取参数,这一部分就不在 pkg/task/task.go 里进行了,哪里需要哪里调用

func FaviconHash

func FaviconHash(data []byte) int32

func FirstToUpper

func FirstToUpper(str string) string

FirstToUpper 字符串首字母大写

func FormatTarget

func FormatTarget(target string) (targets []string)

func GetReqParameters added in v1.1.1

func GetReqParameters(method, contentType string, target *url.URL, body []byte) ([]string, error)

func GetResParameters added in v1.1.1

func GetResParameters(contentType string, body []byte) ([]string, error)

func Hostname

func Hostname(target string) string

func InCaseFoldSlice added in v1.1.1

func InCaseFoldSlice(slice []string, word string) bool

func InMap added in v0.3.1

func InMap(target string, strs map[string]string) bool

func InSlice added in v0.3.1

func InSlice(slice []string, word string) bool

func InSliceCaseFold added in v1.0.0

func InSliceCaseFold(target string, strs []string) bool

InSliceCaseFold 这个是数组中每个元素范围大, target 只是一个子串 比如 target: a 在 []string{"asd", "1"} 中

func InsertInto

func InsertInto(s string, interval int, sep rune) string

func IntInSlice

func IntInSlice(i int, slice []int) bool

func IsDir

func IsDir(path string) bool

IsDir 判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

IsFile 判断所给路径是否为文件

func IsIPv6

func IsIPv6(ip string) bool

IsIPv6 returns true when the provided net.IP address is an IPv6 address.

func IsInnerIP

func IsInnerIP(ip string) bool

IsInnerIP 判断是否为内网IP

func MD5

func MD5(str string) string

MD5 获取字符串md5

func MapToJson added in v0.3.1

func MapToJson(param http.Header) string

func MatchAnyOfRegexp

func MatchAnyOfRegexp(regexps []string, match string) (bool, string)

func Mmh3Hash32

func Mmh3Hash32(raw []byte) int32

Mmh3Hash32 计算 mmh3 hash

func RandStr added in v1.0.0

func RandStr() string

func RandomFromChoices added in v0.3.1

func RandomFromChoices(n int, choices string) string

RandomFromChoices 从choices里面随机获取

func RandomLetterNumbers added in v0.3.1

func RandomLetterNumbers(n int) string

RandomLetterNumbers 随机大小写字母和数字

func RandomLetters added in v0.3.1

func RandomLetters(n int) string

RandomLetters 随机小写字母

func RandomLowLetterNumber added in v0.3.1

func RandomLowLetterNumber(n int) string

RandomLowLetterNumber 随机小写字母和数字

func RandomNumber added in v0.3.1

func RandomNumber(n int, m int) int

RandomNumber 随机数字

func RandomString added in v0.3.1

func RandomString(n int) string

RandomString 随机大小写字母

func RandomUpper

func RandomUpper(s string) string

func ReadFileAsLine

func ReadFileAsLine(path string) ([]string, error)

ReadFileAsLine 读取文件并返回一个字符串切片

func RegexpStr added in v1.0.0

func RegexpStr(patterns []string, str string) bool

func RemoveDuplicateElement added in v0.3.1

func RemoveDuplicateElement(strs []string) []string

RemoveDuplicateElement 数组去重

func RemoveQuotation added in v1.0.0

func RemoveQuotation(str []string) []string

RemoveQuotation 为什么 go 正则中不能只提取 " ' 中的内容,而是连带着 " ' 一起提取出来,使用 matches := ipRex.FindAllStringSubmatch(body, -1) 也要循环matches取 matche[1]

func RemoveQuotationMarks added in v1.0.0

func RemoveQuotationMarks(str string) string

func ReverseString

func ReverseString(s string) string

ReverseString 反转字符串 style --> elyts

func SimpleUniqueId added in v1.0.0

func SimpleUniqueId(u string) string

SimpleUniqueId 只对 http://testphp.vulnweb.com/redir.php?r=https://beautybeer.blogspot.com/ 这种简单的进行获取唯一 id

func SliceInCaseFold added in v1.0.0

func SliceInCaseFold(target string, strs []string) bool

SliceInCaseFold 判断一个字符串是否在另一个字符数组里面,存在返回true target 中是否包含 strs 中的某一个 这个是 target 范围大, element只是一个子串

func StringToBytes

func StringToBytes(s string) []byte

func StructToJsonString

func StructToJsonString(item interface{}) string

StructToJsonString 将结构体输出位 json 字符

func StructureIps

func StructureIps(ipsTmp []string, num int) (ips []string)

func ToLower added in v1.0.0

func ToLower(a []string) []string

func ToStringSlice

func ToStringSlice(actual interface{}) ([]string, error)

func ToUpper

func ToUpper(a []string) []string

func Trim

func Trim(s string) string

func UUID

func UUID() string

func UniqueId added in v1.0.0

func UniqueId(req *proxy.Request) string

UniqueId 生成唯一id(md5), 用来判断是否扫描过 空代表目前逻辑还不支持判断,可以看成没有扫描过

func WriteFile

func WriteFile(path string, data []byte) error

Types

type UserPass

type UserPass struct {
	Username string
	Password string
}

func CvtUps

func CvtUps(s string) []UserPass

Jump to

Keyboard shortcuts

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