lab

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package lab is a deliberately vulnerable in-process target for the examples.

It exists so `go run ./examples/webshell-chain` can demonstrate the whole chain — command injection, shell drop, session takeover — with no Docker and no network, and so the same example can be pointed at the real PHP container described in STATE.md with just -base/-dir.

It is a fixture, not a product. Every route is intentionally insecure, it binds to loopback only, and it must never be exposed or reused as a real server. The "PHP" it serves is a toy subset: it recognises the payload template's own shape (a pass literal and a cmd parameter) rather than interpreting PHP. That is enough to prove the chain moved real bytes to a real file, which is what the example is for; the real evidence run uses PHP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryEscape

func QueryEscape(s string) string

QueryEscape is a convenience for building inject payloads in the example.

Types

type Lab

type Lab struct {
	// Dir is the writable "web root" the injection point can write into and the
	// fallback handler serves from. A dropped shell lands here.
	Dir string

	Server *httptest.Server
	// contains filtered or unexported fields
}

Lab is a running vulnerable target plus the state its routes share.

func New

func New() (*Lab, error)

New starts the lab on a loopback port.

func (*Lab) BaseURL

func (l *Lab) BaseURL() string

BaseURL is the lab's origin, e.g. http://127.0.0.1:41234.

func (*Lab) Close

func (l *Lab) Close()

Close stops the server and removes the web root.

func (*Lab) Credentials

func (l *Lab) Credentials() (user, password string)

Credentials are the lab's known-good account.

func (*Lab) LoginURL

func (l *Lab) LoginURL() string

LoginURL and UserInfoURL are the routes the identity example uses.

func (*Lab) ShellURL

func (l *Lab) ShellURL(name string) string

ShellURL is where a dropped file named name is served.

func (*Lab) UserInfoURL

func (l *Lab) UserInfoURL() string

Jump to

Keyboard shortcuts

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