httpx

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultResolvers = []string{
	"1.1.1.1",
	"1.0.0.1",
	"8.8.8.8",
	"8.8.4.4",
	"223.5.5.5",
	"223.6.6.6",
	"119.29.29.29",
	"114.114.114.114",
	"114.114.115.115",
}

DefaultResolvers contains the default list of resolvers known to be good

Functions

func Header(headers http.Header) string

func NewSession

func NewSession(rateLimit ...int)

func ValidateProxyURL

func ValidateProxyURL(proxy string) (string, error)

Types

type Param

type Param struct {
	// Name of the posted parameter.
	Name string `json:"name"`
	// Value of the posted parameter.
	Value string `json:"value,omitempty"`
	// Filename of a posted file.
	Filename string `json:"fileName,omitempty"`
	// ContentType is the content type of posted file.
	ContentType string `json:"contentType,omitempty"`

	FileHeader   textproto.MIMEHeader
	FileSize     int64
	FileContent  []byte
	IsFile       bool
	Boundary     string
	FilenotFound bool
	IsBase64     bool
	Index        int //
}

Param describes an individual posted parameter.

type Response

type Response struct {
	Status           string
	StatusCode       int
	Body             string
	RequestDump      string
	ResponseDump     string
	Header           http.Header
	ContentLength    int
	RequestUrl       string
	Location         string
	ServerDurationMs float64 // 服务器响应时间
}

func Get added in v0.3.1

func Get(target string) (*Response, error)

func Request

func Request(target string, method string, postdata string, isredirect bool, headers map[string]string) (*Response, error)

func RequestBasic

func RequestBasic(username string, password string, target string, method string, postdata string, isredirect bool, headers map[string]string) (*Response, error)

func UploadRequest

func UploadRequest(target string, params map[string]string, name, path string) (*Response, error)

UploadRequest 新建上传请求

type Session

type Session struct {
	// Client is the current http client
	Client *http.Client
	// Rate limit instance
	RateLimiter ratelimit.Limiter // 每秒请求速率限制
}

type Variations

type Variations struct {
	// MimeType is the MIME type of the posted data.
	MimeType string `json:"mimeType"`
	// Params is a list of posted parameters (in case of URL encoded parameters).
	Params []Param `json:"params"`
	// OriginalParams 存储原始的值
	OriginalParams []Param `json:"params"`
	// Text contains the posted data. Although its type is string, it may contain
	// binary data.
	Text string `json:"text"`
}

func ParseUri

func ParseUri(uri string, body []byte, method string, contentType string, headers map[string]string) (*Variations, error)

ParseUri 对请求进行格式化

func (Variations) Len

func (p Variations) Len() int

func (Variations) Less

func (p Variations) Less(i, j int) bool

Less 顺序有低到高排序

func (*Variations) Release

func (p *Variations) Release() string

func (Variations) Set

func (p Variations) Set(key string, value string) error

func (*Variations) SetPayload

func (p *Variations) SetPayload(uri string, payload string, method string, key ...[]string) []string

func (*Variations) SetPayloadByIndex

func (p *Variations) SetPayloadByIndex(index int, uri string, payload string, method string) string

SetPayloadByIndex 根据索引设置payload

GET 返回 http://testphp.vulnweb.com/listproducts.php?artist=((,”"(,"","((

POST 返回 artist=')”,)'(())')(

func (Variations) Swap

func (p Variations) Swap(i, j int)

Jump to

Keyboard shortcuts

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