cerberus

package module
v0.0.0-...-8f868a3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Unlicense Imports: 13 Imported by: 0

README

Cerberus

A fast Tartarus solver lib.

For technical details, you can try asking Josh (not me) or reverse engineer the solver solutions offered on Tartarus' no-js page. Good luck.


Donations are always appreciated but never expected nor required:

XMR: 8BjCARiV2uB2gZTbbiMUetfRxcAYZgVM5fXxjEbpmb2nAu8ND1grazZ1EhMGdRqVerAtvEJeiy7SzA3SLXpg2CtRDtCAFfn

Other crypto (anonpay) (Tor version)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRedirect  = errors.New("No redirect to challenge page.")
	ErrParseFailed = errors.New("Failed to parse challenge from HTML data tags.")
)

Functions

func Submit

func Submit(ctx context.Context, hc http.Client, s Solution, redirect string) (*http.Response, error)

Submit a Solution for a Challenge.

If redirect is empty, "/" is used as a sensible default. Auth cookies get set automatically in http.Client's CookieJar. The *http.Response is provided to support more advanced setups. The auth token can also be found in its Body.

Types

type Challenge

type Challenge struct {
	Salt  string // Challenge salt from server.
	Diff  uint32 // Difficulty level.
	Steps int8   // Each step consists of a Challenge and a Solution. More than 1 may be required.
	// contains filtered or unexported fields
}

func NewChallenge

func NewChallenge(ctx context.Context, hc http.Client, host string) (Challenge, error)

Request new Tartarus challenge from provided host.

func ParseChallenge

func ParseChallenge(r io.Reader, host string) (Challenge, error)

func (Challenge) Solve

func (c Challenge) Solve(ctx context.Context) (Solution, error)

Convenience wrapper, equivalent to Solve(ctx, c).

type ErrInvalidSolution

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

func (*ErrInvalidSolution) Error

func (e *ErrInvalidSolution) Error() string

type Solution

type Solution struct {
	Hash     []byte // Not required in POST, but provided for reference.
	Salt     string // Challenge salt.
	Nonce    uint32 // Solution nonce. This is the "answer" to the problem.
	Redirect string // Relative path to redirect to after Solution is accepted.

	Steps int8 // Steps, as described in Challenge.
	// contains filtered or unexported fields
}

func Solve

func Solve(ctx context.Context, c Challenge) (Solution, error)

Solve Challenge c. Returns Solution that can be submitted.

Jump to

Keyboard shortcuts

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