simulator

package
v1.2.8-sp4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

README

目录

simulator模块使用说明:

simulator.simple

新增simulator.simple接口

相比于之前复杂的操作,对接口进行简化

api

func

simulator.simple.createBrowser(opts ...BrowserConfigOpt) *Browser 根据参数创建浏览器,并完成初始化

其中 浏览器的参数设置如下:

simulator.simple.wsAddress(wsAddress string) BrowserConfigOpt 设置远程浏览器地址

simulator.simple.proxy(proxy string, proxyInfo ...string) BrowserConfigOpt 设置浏览器代理

  • proxy为代理地址,必填
  • proxyInfo为代理的用户名和密码,选填

simulator.simple.noSandBox(bool) BrowserConfigOpt 设置no-sandbox

simulator.simple.headless(bool) BrowserConfigOpt 设置headless

simulator.simple.requestModify(url string, modifyTarget ModifyTarget, mofidyResult interface{}) BrowserConfigOpt 设置需要修改的request包

  • url为需要修改包内容对应的请求url中的关键字,支持正则
  • modifyTarget为修改的位置 包括:
    • simulator.simple.headersModifyTarget 对请求包的headers进行添加操作
    • simulator.simple.hostModifyTarget 对请求包的host进行修改操作
    • simulator.simple.bodyModifyTarget 对请求包的body进行直接修改操作
  • modifyResult为修改的具体内容,内容的结构会随着modifyTarget的不同而不同:
    • 对请求包的headers进行添加操作时,modifyResult可以是[]string结构,也可以是map[string]string结构。
      • 当modifyResult结构是[]string时,切片从头开始两个字符串为一组,一组中第一个字符串为headers的key,第二个字符串为headers的value,例如[]string{"testHeaders", "testValue"}
      • 当modifyResult结构是map[string]string时,map结构中的key为headers的key,结构中的value为headers的value,例如map[string]string{"testHeaders":"testValue"}
    • 对请求包的host进行修改操作时,modifyResult为string类型,内容是所要修改成为的host
    • 对请求包的body进行直接修改操作时,modifyResult为string类型,内容是所要修改成为的body

simulator.simple.responseModify(url string, modifyTarget ModifyTarget, mofidyResult interface{}) BrowserConfigOpt 设置需要修改的response包

  • url为需要修改包内容对应的请求url中的关键字,支持正则
  • modifyTarget为修改的位置 包括:
    • simulator.simple.headersModifyTarget 对响应包的headers进行添加操作
    • simulator.simple.bodyModifyTarget 对响应包的body进行直接修改操作
    • simulator.simple.bodyReplaceTarget 对响应包的body进行替换操作
  • modifyResult为修改的具体内容,内容的结构会随着modifyTarget的不同而不同:
    • 对响应包的headers进行添加操作时,modifyResult结构同请求包中headers进行添加操作时的modifyResult的结构
    • 对响应包的body进行直接修改操作时,modifyResult为string类型,内容是所要修改成为的body
    • 对响应包的body进行替换操作时,modifyResult为[]string类型,切片从头开始两个字符串为一组,一组中第一个字符串为body中待替换的字符串,第二个字符串为其对应被替换成的字符串
type Browser func

func (b *Browser) Navigate(urlStr string) *Page 创建一个页面并访问指定的url,返回该页面

type Page func

func (p *Page) Navigate(urlStr string) 使该页面访问指定url

func (p *Page) Click(selector string) error 点击页面中selector对应元素

func (p *Page) Input(selector, inputStr string) error 在页面中的selector对应元素中输入参数

func (p *Page) HTML() (string, error) 返回当前页面的HTML代码

func (p *Page) ScreenShot() (string, error) 返回当前页面截图的base64编码

simulator.simple Yak代码示例

replaceStr = []string{"0","1"}
replaceModify = simulator.simple.responseModify("uapws/login.ajax", simulator.simple.bodyReplaceTarget, replaceStr)
headless = simulator.simple.headless(false)
browser = simulator.simple.createBrowser(headless, replaceModify)
page = browser.Navigate("http://192.168.0.111:8099/uapws/")
page.Input("#password", "123321")
page.Click("#dijit_form_Button_0_label")
time.Sleep(2)

httpbrute 基于模拟点击的http自动化爆破使用说明

代码实例

urlStr = "http://192.168.0.203/#/login"
captchaUrl = "http://192.168.0.115:9898/ocr/b64/json"

opts = [
    simulator.captchaUrl(captchaUrl),
    simulator.username("admin"),
    simulator.password("admin", "luckyadmin123"),
]

ch, err = simulator.HttpBruteForce(urlStr, opts...)
for item := range ch {
    yakit.Info(`[bruteforce] %s:%s login %v with info: %s`, item.Username(), item.Password(), item.Status(), item.Info())
}

Data Struct

simulator.BruteResult

爆破结果数据结构

struct
type BruteResult interface {
    PtrStructMethods(指针结构方法/函数):
        func Username() return (string)
        func Password() return (string)
        func Status() return (bool)
    
        func Info() return (string)
        func Base64() return (string)

        func LoginSuccessUrl() return (string)
}
method

func (*BruteResult) Username() return (r0: string) 爆破测试的用户名

func (*BruteResult) Password() return (r0: string) 爆破测试的密码

func (*BruteResult) Status() return (r0: bool) 本次爆破是否成功

func (*BruteResult) Info() return (r0: string) 本次爆破过程的部分信息

func (*BruteResult) Base64() return (r0: string) 爆破成功时浏览器页面截图的base64编码

func (*BruteResult) LoginSuccessUrl() return (r0: string) 爆破成功后跳转到的url

API

simulator.HttpBruteForce

设置爆破参数 开始爆破任务

定义

simulator.HttpBruteForce(url string, opts ...simulator.BruteConfigOpt) return (ch: chan simulator.BruteResult, err: error)

参数
参数名 参数类型 参数解释
url string 爆破目标
opts ...simulator.BruteConfigOpt 爆破参数
返回值
返回值 返回值类型 返回值解释
ch chan simulator.BruteResult 爆破结果传递channel
err error 错误信息
simulator.username

设置爆破的用户名

定义

simulator.username(username ...string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
username ...string 待爆破的用户名
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.usernameList

设置爆破的用户名

定义

simulator.usernameList(usernameList []string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
usernameList []string 待爆破的用户名切片
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.password

设置爆破的密码

定义

simulator.password(password ...string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
password ...string 待爆破的密码
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.passwordList

设置爆破的密码

定义

simulator.passwordList(passwordList []string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
passwordList []string 待爆破的密码切片
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.wsAddress

设置浏览器的ws地址

定义

simulator.wsAddress(wsAddress string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
wsAddress string 浏览器的ws地址
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.proxy

设置浏览器代理

定义

simulator.proxy(proxy string, details ...string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
proxy string 浏览器代理地址
details ...string 代理的用户名和密码(如果有则填写)
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.captchaUrl

设置验证码图片识别链接

定义

simulator.captchaUrl(captchaUrl string) return (r0: simulator.BruteConfigOpt)

默认的验证码数据接口匹配使用ddddocr的ocr_api_server项目:ocr_api_server

这里默认操作类型ocr,数据类型b64,返回类型json,所以使用该项目时默认接口为:http://{host}:{port}/ocr/b64/json

参数
参数名 参数类型 参数解释
captchaUrl string 浏览器代理地址
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.captchaMode

设置验证码图片识别模式(可选)

一般情况下不会使用该接口

定义

simulator.captchaMode(captchaMode string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
captchaMode string 验证码识别模式
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.usernameSelector

设置输入用户名的element的selector

定义

simulator.usernameSelector(usernameSelector string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
usernameSelector string 用户名element的selector
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.passwordSelector

设置输入密码的element的selector

定义

simulator.passwordSelector(passwordSelector string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
passwordSelector string 密码element的selector
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.captchaInputSelector

设置输入验证码的element的selector

定义

simulator.captchaInputSelector(captchaSelector string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
captchaSelector string 验证码element的selector
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.captchaImgSelector

设置验证码图片的element的selector

定义

simulator.captchaImgSelector(captchaImgSelector string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
captchaImgSelector string 验证码图片element的selector
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.submitButtonSelector

设置提交请求按钮对应element的selector

定义

simulator.submitButtonSelector(buttonSelector string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
buttonSelector string 提交请求按钮element的selector
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.loginDetectMode

设置确认成功登陆的检测类型

定义

simulator.loginDetectMode(detectMode loginDetectMode, degree ...float64) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
detectMode loginDetectMode 确认成功登陆的检测类型
degree ...float64 附加参数

loginDetectMode包括三种:

  • simulator.urlChangeMode 通过url变化判断是否登陆成功
  • simulator.htmlChangeMode 通过html页面的变化程度判断是否登陆成功
  • simulator.defaultChangeMode 同时使用以上两种判断方法,两种方法都通过才确定登陆成功(默认)

当使用了html页面变化程度进行判断时,可以通过degree设置判断相似程度的阈值,值越小表示尝试登陆后的页面相似程度越小,默认为0.6

返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.exePath

设置chrome浏览器可执行文件路径

定义

simulator.exePath(exePath string) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
exePath string chrome浏览器可执行文件路径
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.extraWaitLoadTime

设置页面的额外等待时间 因为有些时候通过devtools拿到的页面状态为加载完成 但是实际上页面仍然在渲染部分内容 此时可以通过该函数进行额外的等待时间的设置

定义

simulator.extraWaitLoadTime(timeout: int) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
timeout int 额外等待时间 (单位Millisecond)
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数
simulator.leaklessStatus

浏览器是否自动进程关闭设置 浏览器自动进程关闭进行在windows下会报病毒 默认在windows下会关闭 如在windows下开启请关闭相关安全软件 当关闭时 如果强制关闭爬虫进程时chrome.exe会存在后台 过多时需要手动进行关闭 默认是simulator.leaklessDefault, 强制开启为simulator.leaklessOn,强制关闭为simulator.leaklessOff

定义

simulator.leaklessStatus(status: simulator.LeaklessMode) return (r0: simulator.BruteConfigOpt)

参数
参数名 参数类型 参数解释
status simulator.LeaklessMode 自动进程关闭模式

simulator.LeaklessMode包括三种:

  • simulator.leaklessDefault 默认根据系统进行选择 不设置为默认选项
  • simulator.leaklessOn 强制开启自动进程关闭模式
  • simulator.leaklessOff 强制关闭自动进程关闭模式
返回值
返回值 返回值类型 返回值解释
r0 simulator.BruteConfigOpt 参数设置函数

Documentation

Overview

Package simulator @Author bcy2007 2023/8/17 16:17

Package simulator @Author bcy2007 2023/8/21 10:59

Package simulator @Author bcy2007 2023/8/17 16:18

Package simulator @Author bcy2007 2023/8/17 16:19

Package simulator @Author bcy2007 2023/8/17 16:19

Package simulator @Author bcy2007 2023/8/23 15:32

Package simulator @Author bcy2007 2023/8/21 15:19

Package simulator @Author bcy2007 2023/8/17 17:28

Package simulator @Author bcy2007 2023/8/21 15:48

Package simulator @Author bcy2007 2023/8/22 13:35

Package simulator @Author bcy2007 2023/8/17 16:20

Package simulator @Author bcy2007 2023/8/23 11:06

Package simulator @Author bcy2007 2023/8/22 10:24

Package simulator @Author bcy2007 2023/8/17 16:18

Index

Constants

View Source
const (
	UrlChangeMode     loginDetectMode = 0
	HtmlChangeMode    loginDetectMode = 1
	DefaultChangeMode loginDetectMode = -1
)

Variables

View Source
var ElementAttribute = []string{
	"placeholder", "id", "name", "value", "alt",
}
View Source
var ElementProperty = []string{
	"innerHTML",
}
View Source
var Exports = map[string]interface{}{
	"HttpBruteForce": HttpBruteForce,

	"username":             WithUsernameList,
	"usernameList":         WithUsername,
	"password":             WithPasswordList,
	"passwordList":         WithPassword,
	"wsAddress":            WithWsAddress,
	"proxy":                WithProxy,
	"captchaUrl":           WithCaptchaUrl,
	"captchaMode":          WithCaptchaMode,
	"usernameSelector":     WithUsernameSelector,
	"passwordSelector":     WithPasswordSelector,
	"captchaInputSelector": WithCaptchaSelector,
	"captchaImgSelector":   WithCaptchaImgSelector,
	"submitButtonSelector": WithLoginButtonSelector,
	"loginDetectMode":      WithLoginDetectMode,
	"exePath":              WithExePath,
	"extraWaitLoadTime":    WithExtraWaitLoadTime,
	"leaklessStatus":       WithLeakless,

	"urlChangeMode":     UrlChangeMode,
	"htmlChangeMode":    HtmlChangeMode,
	"defaultChangeMode": DefaultChangeMode,

	"leaklessDefault": LeaklessDefault,
	"leaklessOn":      LeaklessOn,
	"leaklessOff":     LeaklessOff,

	"simple": SimpleExports,
}
View Source
var KeywordDict = map[string][]string{
	"Username": usernameKeyword,
	"Password": passwordKeyword,
	"Captcha":  captchaKeyword,
	"Login":    loginKeyword,
}
View Source
var SimpleExports = map[string]interface{}{
	"createBrowser": simple.CreateHeadlessBrowser,

	"wsAddress":      simple.WithWsAddress,
	"proxy":          simple.WithProxy,
	"noSandBox":      simple.WithNoSandBox,
	"headless":       simple.WithHeadless,
	"requestModify":  simple.WithRequestModification,
	"responseModify": simple.WithResponseModification,

	"bodyModifyTarget":    simple.BodyModifyTarget,
	"bodyReplaceTarget":   simple.BodyReplaceTarget,
	"headersModifyTarget": simple.HeadersModifyTarget,
	"hostModifyTarget":    simple.HostModifyTarget,
}
View Source
var SimpleKeywordDict = map[string][]string{
	"Username": simpleUsernameKeyword,
	"Password": simplePasswordKeyword,
	"Captcha":  simpleCaptchaKeyword,
	"Login":    loginKeyword,
}

Functions

func ArrayInArray added in v1.2.8

func ArrayInArray(targets, origin []string) bool

func ArrayStringContains added in v1.2.8

func ArrayStringContains(array []string, element string) bool

func CalculateRelevance added in v1.2.8

func CalculateRelevance(element *rod.Element, elementType string) float64

func CalculateRelevanceMatrix added in v1.2.8

func CalculateRelevanceMatrix(elements rod.Elements, elementTypes []string) (map[string]*rod.Element, error)

func CheckTagElementFromParent added in v1.2.8

func CheckTagElementFromParent(elements rod.Elements, tags []string) (map[string]string, error)

func ElementClick added in v1.2.8

func ElementClick(page *rod.Page, selector string) (err error)

func ElementInput added in v1.2.8

func ElementInput(page *rod.Page, selector, inputInfo string) (err error)

func ElementToValue added in v1.2.8

func ElementToValue(element *rod.Element, eval string) (string, error)

func ElementsFilter added in v1.2.8

func ElementsFilter(elements rod.Elements, selectors []string) rod.Elements

func ElementsMinus added in v1.2.8

func ElementsMinus(origins, targets rod.Elements) rod.Elements

func ElementsToIds added in v1.2.8

func ElementsToIds(elements ...*rod.Element) []string

func ElementsToSelectors added in v1.2.8

func ElementsToSelectors(elements ...*rod.Element) []string

func ElementsToValue added in v1.2.8

func ElementsToValue(elements rod.Elements, eval string) []string

func FindLatestElement added in v1.2.8

func FindLatestElement(page *rod.Page, origin, tagName string, maxLevel int) (rod.Elements, error)

func GetAttribute added in v1.2.8

func GetAttribute(element *rod.Element, attr string) (string, error)

func GetElement added in v1.2.8

func GetElement(page *rod.Page, selector string) (*rod.Element, error)

func GetElementParam added in v1.2.8

func GetElementParam(element *rod.Element, param string) (string, error)

func GetPageSimilarity added in v1.2.8

func GetPageSimilarity(pageAHtml, pageBHtml string) float64

func GetProperty added in v1.2.8

func GetProperty(element *rod.Element, prop string) (string, error)

func GetRepeatStr added in v1.2.8

func GetRepeatStr(origin, source string) string

func GetSelector added in v1.2.8

func GetSelector(element *rod.Element) (string, error)

func HttpBruteForce added in v1.2.8

func HttpBruteForce(targetUrl string, opts ...BruteConfigOpt) (chan Result, error)

func ListRemove added in v1.2.8

func ListRemove(targetList []string, obj string) []string

func LongestCommonSubsequence added in v1.2.8

func LongestCommonSubsequence(text1, text2 []string) int

func ParseProxyStringToUrl added in v1.2.8

func ParseProxyStringToUrl(address, username, password string) *url.URL

func ScreenShot added in v1.2.8

func ScreenShot(page *rod.Page) (string, error)

func StringArrayContains added in v1.2.8

func StringArrayContains(array []string, element string) bool

Types

type BrowserConfig added in v1.2.8

type BrowserConfig struct {
	// contains filtered or unexported fields
}

func CreateNewBrowserConfig added in v1.2.8

func CreateNewBrowserConfig() *BrowserConfig

type BrowserConfigOpt added in v1.2.8

type BrowserConfigOpt func(*BrowserConfig)

type BrowserStarter added in v1.2.8

type BrowserStarter struct {
	// contains filtered or unexported fields
}

func CreateNewStarter added in v1.2.8

func CreateNewStarter(opts ...BrowserConfigOpt) *BrowserStarter

func (*BrowserStarter) Close added in v1.2.8

func (starter *BrowserStarter) Close() error

func (*BrowserStarter) CreatePage added in v1.2.8

func (starter *BrowserStarter) CreatePage() (*rod.Page, error)

func (*BrowserStarter) Start added in v1.2.8

func (starter *BrowserStarter) Start() error

type BruteConfig added in v1.2.8

type BruteConfig struct {
	// contains filtered or unexported fields
}

func NewBruteConfig added in v1.2.8

func NewBruteConfig() *BruteConfig

type BruteConfigOpt added in v1.2.8

type BruteConfigOpt func(*BruteConfig)

func WithCaptchaImgSelector added in v1.2.8

func WithCaptchaImgSelector(selector string) BruteConfigOpt

func WithCaptchaMode added in v1.2.8

func WithCaptchaMode(mode string) BruteConfigOpt

func WithCaptchaSelector added in v1.2.8

func WithCaptchaSelector(selector string) BruteConfigOpt

func WithCaptchaUrl added in v1.2.8

func WithCaptchaUrl(url string) BruteConfigOpt

func WithExePath added in v1.2.8

func WithExePath(exePath string) BruteConfigOpt

func WithExtraWaitLoadTime added in v1.2.8

func WithExtraWaitLoadTime(time int) BruteConfigOpt

func WithLeakless added in v1.2.8

func WithLeakless(leakless LeaklessMode) BruteConfigOpt

func WithLoginButtonSelector added in v1.2.8

func WithLoginButtonSelector(selector string) BruteConfigOpt

func WithLoginDetectMode added in v1.2.8

func WithLoginDetectMode(mode loginDetectMode, degree ...float64) BruteConfigOpt

func WithPassword added in v1.2.8

func WithPassword(password []string) BruteConfigOpt

func WithPasswordList added in v1.2.8

func WithPasswordList(password ...string) BruteConfigOpt

func WithPasswordSelector added in v1.2.8

func WithPasswordSelector(selector string) BruteConfigOpt

func WithProxy added in v1.2.8

func WithProxy(proxy string, details ...string) BruteConfigOpt

func WithResultChannel added in v1.2.8

func WithResultChannel(ch chan Result) BruteConfigOpt

func WithUsername added in v1.2.8

func WithUsername(username []string) BruteConfigOpt

func WithUsernameList added in v1.2.8

func WithUsernameList(username ...string) BruteConfigOpt

func WithUsernameSelector added in v1.2.8

func WithUsernameSelector(selector string) BruteConfigOpt

func WithWsAddress added in v1.2.8

func WithWsAddress(ws string) BruteConfigOpt

type BruteResult added in v1.2.8

type BruteResult struct {
	// contains filtered or unexported fields
}

func (*BruteResult) Base64 added in v1.2.8

func (result *BruteResult) Base64() string

func (*BruteResult) Info added in v1.2.8

func (result *BruteResult) Info() string

func (*BruteResult) LoginSuccessUrl added in v1.2.8

func (result *BruteResult) LoginSuccessUrl() string

func (*BruteResult) LoginToken added in v1.2.8

func (result *BruteResult) LoginToken() string

func (*BruteResult) Password added in v1.2.8

func (result *BruteResult) Password() string

func (*BruteResult) Status added in v1.2.8

func (result *BruteResult) Status() bool

func (*BruteResult) Username added in v1.2.8

func (result *BruteResult) Username() string

type CaptchaIdentifier added in v1.2.8

type CaptchaIdentifier struct {
	// contains filtered or unexported fields
}

func (*CaptchaIdentifier) Detect added in v1.2.8

func (identifier *CaptchaIdentifier) Detect(page *rod.Page, elementSelector string) (string, error)

func (*CaptchaIdentifier) SetMode added in v1.2.8

func (identifier *CaptchaIdentifier) SetMode(mode string)

func (*CaptchaIdentifier) SetProxy added in v1.2.8

func (identifier *CaptchaIdentifier) SetProxy(proxy *url.URL)

func (*CaptchaIdentifier) SetRequest added in v1.2.8

func (identifier *CaptchaIdentifier) SetRequest(req requestStructr)

func (*CaptchaIdentifier) SetResponse added in v1.2.8

func (identifier *CaptchaIdentifier) SetResponse(res responseStructr)

func (*CaptchaIdentifier) SetUrl added in v1.2.8

func (identifier *CaptchaIdentifier) SetUrl(url string)

type DDDDCaptcha added in v1.2.8

type DDDDCaptcha struct {
	// contains filtered or unexported fields
}

func (*DDDDCaptcha) Generate added in v1.2.8

func (dddd *DDDDCaptcha) Generate() interface{}

func (*DDDDCaptcha) GetBase64 added in v1.2.8

func (dddd *DDDDCaptcha) GetBase64() string

func (*DDDDCaptcha) InputBase64 added in v1.2.8

func (dddd *DDDDCaptcha) InputBase64(b64 string)

func (*DDDDCaptcha) InputMode added in v1.2.8

func (dddd *DDDDCaptcha) InputMode(string)

type DDDDResult added in v1.2.8

type DDDDResult struct {
	Status  int    `json:"status"`
	Result  string `json:"result"`
	Message string `json:"msg"`
}

func (*DDDDResult) GetErrorInfo added in v1.2.8

func (dddd *DDDDResult) GetErrorInfo() string

func (*DDDDResult) GetResult added in v1.2.8

func (dddd *DDDDResult) GetResult() string

func (*DDDDResult) GetStatus added in v1.2.8

func (dddd *DDDDResult) GetStatus() bool

type DataMatrix added in v1.2.8

type DataMatrix[T any] struct {
	//ItemList rod.Elements
	ItemList []T
	TagList  []string
	Data     [][]float64
}

func (*DataMatrix[T]) GetResult added in v1.2.8

func (matrix *DataMatrix[T]) GetResult() (map[string]T, error)

func (*DataMatrix[T]) ValidCheck added in v1.2.8

func (matrix *DataMatrix[T]) ValidCheck() error

type HttpBruteForceCore added in v1.2.8

type HttpBruteForceCore struct {
	UsernameSelector    string
	PasswordSelector    string
	CaptchaSelector     string
	CaptchaImgSelector  string
	LoginButtonSelector string
	// contains filtered or unexported fields
}

func NewHttpBruteForceCore added in v1.2.8

func NewHttpBruteForceCore(targetUrl string, opts ...BruteConfigOpt) (*HttpBruteForceCore, error)

func (*HttpBruteForceCore) Start added in v1.2.8

func (bruteForce *HttpBruteForceCore) Start() error

type LeaklessMode added in v1.2.8

type LeaklessMode int
const (
	LeaklessDefault LeaklessMode = 0
	LeaklessOn      LeaklessMode = 1
	LeaklessOff     LeaklessMode = -1
)

type NormalCaptchaRequest added in v1.2.8

type NormalCaptchaRequest struct {
	ProjectName string `json:"project_name"`
	Image       string `json:"image"`
}

func (*NormalCaptchaRequest) Generate added in v1.2.8

func (captchaRequest *NormalCaptchaRequest) Generate() interface{}

func (*NormalCaptchaRequest) InputBase64 added in v1.2.8

func (captchaRequest *NormalCaptchaRequest) InputBase64(b64 string)

func (*NormalCaptchaRequest) InputMode added in v1.2.8

func (captchaRequest *NormalCaptchaRequest) InputMode(mode string)

type NormalCaptchaResponse added in v1.2.8

type NormalCaptchaResponse struct {
	Uuid    string `json:"uuid"`
	Data    string `json:"data"`
	Success bool   `json:"success"`
}

func (*NormalCaptchaResponse) GetErrorInfo added in v1.2.8

func (captchaResponse *NormalCaptchaResponse) GetErrorInfo() string

func (*NormalCaptchaResponse) GetResult added in v1.2.8

func (captchaResponse *NormalCaptchaResponse) GetResult() string

func (*NormalCaptchaResponse) GetStatus added in v1.2.8

func (captchaResponse *NormalCaptchaResponse) GetStatus() bool

type Result added in v1.2.8

type Result interface {
	Username() string
	Password() string
	Status() bool

	Info() string
	Base64() string

	LoginToken() string
	LoginSuccessUrl() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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