web

package
v0.0.0-...-23de231 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 16 Imported by: 1 module, 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

Overview

Package web asks a site's public URLs what they give away, from outside: whether files that shouldn't be public are served, folders listed, users listed, XML-RPC open, headers missing, the certificate about to expire, trackers starting before consent. It only reads (HEAD, one-byte GETs, a listing's first 8 KB, the landing page and the tracker containers it loads) and never asks a documentation or test domain (RFC 2606, 6761).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlogURLs

func BlogURLs(base string, options map[string]string) map[string]string

BlogURLs are the docroot URLs of a multisite's other sites by blog id, from the blog-tagged home options ("2:home"): each site's own host with the main docroot's path, as uploads aren't under a subdirectory site's path.

func DocrootURL

func DocrootURL(home string) string

DocrootURL is the public URL of the release's docroot from the site's home URL: Bedrock serves web/ at the home URL, plain WordPress its root.

func NewClient

func NewClient() *http.Client

NewClient is the default client: no redirects (a redirect isn't the file), short timeouts, connections kept for reuse.

func Probe

func Probe(ctx context.Context, client *http.Client, t Target, o Options) *audit.WebFacts

Probe asks t's public URLs. Base is "" in the result when t has no usable home URL (or a test domain's): then nothing was asked.

func SiteURLs

func SiteURLs(options map[string]string) map[string]string

SiteURLs are every site's home → siteurl from the collector's options ("home", "2:home", "2:siteurl"), test domains left out.

Types

type Options

type Options struct {
	Files      []string
	Public     bool
	UploadsPHP bool
	Browse     func(ctx context.Context, url string) ([]audit.Cookie, error)
}

Options say what to ask: Files are candidate paths (audit.Candidates), Public the public-site checks, UploadsPHP whether the server runs PHP in uploads (asked with a file that doesn't exist, so nothing runs). Browse, when set, loads a landing page in a fresh browser and returns the cookies it then holds (browser.Visit).

type Target

type Target struct {
	Home    string
	Options map[string]string
	Content string
}

Target is where the site is: its home URL and the collector's options (a multisite's other sites: "2:home"), and its content folder (web/app on Bedrock, whose docroot is web/; "" means Bedrock).

Directories

Path Synopsis
Package browser loads a page the way a first-time visitor's browser does, in a headless Chrome with an empty profile, and reports the cookies the browser holds afterwards: every domain's, as nothing was clicked, so nothing was consented to.
Package browser loads a page the way a first-time visitor's browser does, in a headless Chrome with an empty profile, and reports the cookies the browser holds afterwards: every domain's, as nothing was clicked, so nothing was consented to.

Jump to

Keyboard shortcuts

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