util

package
v0.0.0-...-22906a1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 19 Imported by: 6

Documentation

Overview

Package util 通用函数

Index

Constants

This section is empty.

Variables

View Source
var Logger logger

Logger 日志打印

Functions

func AiderCheck

func AiderCheck(randStr string) bool

AiderCheck 辅助验证,使用标识字符串判断漏洞是否存在(触发漏洞会把标识字符串传输到辅助脚本上,如果查询存在,说明存在漏洞)

func DeleteSliceValue

func DeleteSliceValue(list *[]string, value string)

DeleteSliceValue 删除切片里指定的值

func GetAiderNetloc

func GetAiderNetloc() string

GetAiderNetloc 获取辅助验证地址,可使用dns和http请求判断

func GetMd5

func GetMd5(body []byte) string

GetMd5 计算字符md5值

func GetRandomBytes

func GetRandomBytes(l int) []byte

GetRandomBytes 获取包含随机字母的 byte 数组

func GetRandomString

func GetRandomString(l int) string

GetRandomString 获取随机字符串

func InArray

func InArray(list []string, value string, regex bool) bool

InArray 判断字符串是否存在指定列表中,可开启正则判断模式

func ParseNetLoc

func ParseNetLoc(netloc string) (host string, port int)

ParseNetloc 把 netloc 拆分为 host 和 port, 如果有的话

func Struct2Map

func Struct2Map(obj interface{}) map[string]interface{}

Struct2Map 结构转map

func TCPSend

func TCPSend(netloc string, data []byte) ([]byte, error)

TCPSend 指定目标发送tcp报文,返回结果(仅适用于一次交互即可判断漏洞的场景)

Types

type Resp

type Resp struct {
	Body        []byte
	Other       *http.Response
	RequestRaw  string
	ResponseRaw string
}

Resp 封装的http返回包

func RequestDo

func RequestDo(request *http.Request, hasRaw bool) (Resp, error)

RequestDo 发送指定的request,返回结果结构,hasRaw参数决定是否返回原始请求包和返回包内容

Jump to

Keyboard shortcuts

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