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
- Variables
- func ArrayInArray(targets, origin []string) bool
- func ArrayStringContains(array []string, element string) bool
- func CalculateRelevance(element *rod.Element, elementType string) float64
- func CalculateRelevanceMatrix(elements rod.Elements, elementTypes []string) (map[string]*rod.Element, error)
- func CheckTagElementFromParent(elements rod.Elements, tags []string) (map[string]string, error)
- func ElementClick(page *rod.Page, selector string) (err error)
- func ElementInput(page *rod.Page, selector, inputInfo string) (err error)
- func ElementToValue(element *rod.Element, eval string) (string, error)
- func ElementsFilter(elements rod.Elements, selectors []string) rod.Elements
- func ElementsMinus(origins, targets rod.Elements) rod.Elements
- func ElementsToIds(elements ...*rod.Element) []string
- func ElementsToSelectors(elements ...*rod.Element) []string
- func ElementsToValue(elements rod.Elements, eval string) []string
- func FindLatestElement(page *rod.Page, origin, tagName string, maxLevel int) (rod.Elements, error)
- func GetAttribute(element *rod.Element, attr string) (string, error)
- func GetElement(page *rod.Page, selector string) (*rod.Element, error)
- func GetElementParam(element *rod.Element, param string) (string, error)
- func GetPageSimilarity(pageAHtml, pageBHtml string) float64
- func GetProperty(element *rod.Element, prop string) (string, error)
- func GetRepeatStr(origin, source string) string
- func GetSelector(element *rod.Element) (string, error)
- func HttpBruteForce(targetUrl string, opts ...BruteConfigOpt) (chan Result, error)
- func ListRemove(targetList []string, obj string) []string
- func LongestCommonSubsequence(text1, text2 []string) int
- func ParseProxyStringToUrl(address, username, password string) *url.URL
- func ScreenShot(page *rod.Page) (string, error)
- func StringArrayContains(array []string, element string) bool
- type BrowserConfig
- type BrowserConfigOpt
- type BrowserStarter
- type BruteConfig
- type BruteConfigOpt
- func WithCaptchaImgSelector(selector string) BruteConfigOpt
- func WithCaptchaMode(mode string) BruteConfigOpt
- func WithCaptchaSelector(selector string) BruteConfigOpt
- func WithCaptchaUrl(url string) BruteConfigOpt
- func WithExePath(exePath string) BruteConfigOpt
- func WithExtraWaitLoadTime(time int) BruteConfigOpt
- func WithLeakless(leakless LeaklessMode) BruteConfigOpt
- func WithLoginButtonSelector(selector string) BruteConfigOpt
- func WithLoginDetectMode(mode loginDetectMode, degree ...float64) BruteConfigOpt
- func WithPassword(password []string) BruteConfigOpt
- func WithPasswordList(password ...string) BruteConfigOpt
- func WithPasswordSelector(selector string) BruteConfigOpt
- func WithProxy(proxy string, details ...string) BruteConfigOpt
- func WithResultChannel(ch chan Result) BruteConfigOpt
- func WithUsername(username []string) BruteConfigOpt
- func WithUsernameList(username ...string) BruteConfigOpt
- func WithUsernameSelector(selector string) BruteConfigOpt
- func WithWsAddress(ws string) BruteConfigOpt
- type BruteResult
- func (result *BruteResult) Base64() string
- func (result *BruteResult) Info() string
- func (result *BruteResult) LoginSuccessUrl() string
- func (result *BruteResult) LoginToken() string
- func (result *BruteResult) Password() string
- func (result *BruteResult) Status() bool
- func (result *BruteResult) Username() string
- type CaptchaIdentifier
- func (identifier *CaptchaIdentifier) Detect(page *rod.Page, elementSelector string) (string, error)
- func (identifier *CaptchaIdentifier) SetMode(mode string)
- func (identifier *CaptchaIdentifier) SetProxy(proxy *url.URL)
- func (identifier *CaptchaIdentifier) SetRequest(req requestStructr)
- func (identifier *CaptchaIdentifier) SetResponse(res responseStructr)
- func (identifier *CaptchaIdentifier) SetUrl(url string)
- type DDDDCaptcha
- type DDDDResult
- type DataMatrix
- type HttpBruteForceCore
- type LeaklessMode
- type NormalCaptchaRequest
- type NormalCaptchaResponse
- type Result
Constants ¶
const ( UrlChangeMode loginDetectMode = 0 HtmlChangeMode loginDetectMode = 1 DefaultChangeMode loginDetectMode = -1 )
Variables ¶
var ElementAttribute = []string{
"placeholder", "id", "name", "value", "alt",
}
var ElementKeyword = append(ElementAttribute, ElementProperty...)
var ElementProperty = []string{
"innerHTML",
}
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, }
var KeywordDict = map[string][]string{
"Username": usernameKeyword,
"Password": passwordKeyword,
"Captcha": captchaKeyword,
"Login": loginKeyword,
}
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, }
var SimpleKeywordDict = map[string][]string{
"Username": simpleUsernameKeyword,
"Password": simplePasswordKeyword,
"Captcha": simpleCaptchaKeyword,
"Login": loginKeyword,
}
Functions ¶
func ArrayInArray ¶ added in v1.2.8
func ArrayStringContains ¶ added in v1.2.8
func CalculateRelevance ¶ added in v1.2.8
func CalculateRelevanceMatrix ¶ added in v1.2.8
func CheckTagElementFromParent ¶ added in v1.2.8
func ElementInput ¶ added in v1.2.8
func ElementToValue ¶ added in v1.2.8
func ElementsFilter ¶ added in v1.2.8
func ElementsToIds ¶ added in v1.2.8
func ElementsToSelectors ¶ added in v1.2.8
func ElementsToValue ¶ added in v1.2.8
func FindLatestElement ¶ added in v1.2.8
func GetAttribute ¶ added in v1.2.8
func GetElement ¶ added in v1.2.8
func GetElementParam ¶ added in v1.2.8
func GetPageSimilarity ¶ added in v1.2.8
func GetProperty ¶ added in v1.2.8
func GetRepeatStr ¶ added in v1.2.8
func HttpBruteForce ¶ added in v1.2.8
func HttpBruteForce(targetUrl string, opts ...BruteConfigOpt) (chan Result, error)
func ListRemove ¶ added in v1.2.8
func LongestCommonSubsequence ¶ added in v1.2.8
func ParseProxyStringToUrl ¶ added in v1.2.8
func StringArrayContains ¶ added in v1.2.8
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) 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