waa

package
v0.2.18 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterpreterHash

func InterpreterHash(source []byte) string

InterpreterHash 返回解释器源码的 SHA-256 base64url 摘要

Types

type Challenge

type Challenge struct {
	MessageID                  string
	InterpreterJavaScript      string
	InterpreterURL             string
	InterpreterHash            string
	Program                    string
	GlobalName                 string
	ClientExperimentsStateBlob string
}

Challenge 保存 Waa/Create 返回的客户端解释器输入

func ParseChallenge

func ParseChallenge(raw []byte) (Challenge, error)

ParseChallenge 解析 Waa/Create 响应,第 2 字段的混淆 challenge 为空时读取第 1 字段的明文 challenge

type Options

type Options struct {
	Challenge   Challenge
	Interpreter string
	Profile     Profile
	LoadImage   func(string) bool
}

Options 定义一份 BotGuard VM 的解释器、宿主现场与网络依赖

type Profile

type Profile struct {
	PageURL      string
	Locale       string
	TimeZone     string
	Window       map[string]any
	Navigator    map[string]any
	Screen       map[string]any
	Document     map[string]any
	Globals      map[string]any
	LocalStorage map[string]string
	HasFocus     bool
	// TrustedTypes 表示页面 CSP 要求脚本注入点使用 Trusted Types
	TrustedTypes bool
	// NavigationStart 是页面导航开始的时间,为零时页面时间起点取宿主安装时刻
	NavigationStart time.Time
}

Profile 保存账户指纹与页面状态决定的宿主现场值

type Runtime

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

Runtime 在嵌入的 SpiderMonkey 中持有一份与官网页面同形态的 BotGuard 生命周期

func NewRuntime

func NewRuntime(ctx context.Context, options Options) (*Runtime, error)

NewRuntime 在 Firefox 宿主中加载解释器并初始化 challenge program

func (*Runtime) Close

func (runtime *Runtime) Close()

Close 结束 VM 生命周期并停止事件循环,关闭超时时中断仍在执行的脚本

func (*Runtime) FillPrompt

func (runtime *Runtime) FillPrompt(ctx context.Context, prompt string, submit bool) error

FillPrompt 向页面提示词输入框写入文本并派发官网 Worker 相同的事件,submit 时点击 Run

func (*Runtime) Proof

func (runtime *Runtime) Proof(ctx context.Context, digest string, prompt string) (string, error)

Proof 同步页面提示词后为 SHA-256 digest 生成 snapshot proof,结束后清空输入框

func (*Runtime) RefreshSnapshot

func (runtime *Runtime) RefreshSnapshot(ctx context.Context) (string, error)

RefreshSnapshot 生成官网刷新 Waa/Create 时携带的无绑定 snapshot

func (*Runtime) Settle

func (runtime *Runtime) Settle(ctx context.Context) error

Settle 等待 VM 发出的页面资源请求完成

Directories

Path Synopsis
Package mozjs 经 cgo 嵌入 SpiderMonkey,提供线程绑定的上下文、根表句柄、求值、Go 原生函数、微任务与中断
Package mozjs 经 cgo 嵌入 SpiderMonkey,提供线程绑定的上下文、根表句柄、求值、Go 原生函数、微任务与中断

Jump to

Keyboard shortcuts

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