Documentation
¶
Index ¶
- Constants
- func Base64Decode(s string) (string, error)
- func Base64Encode(s string) string
- func BuildTarGz(entries []TarEntry) ([]byte, error)
- func CanCheck(mod Exploit) bool
- func Contains(s, substr string) bool
- func ContainsI(s, substr string) bool
- func Dedent(s string) string
- func EncoderNames(platform string) []string
- func Errorf(format string, args ...any) error
- func HasOpt(opts []Option, name string) bool
- func HasOption(mod Exploit, name string) bool
- func HexEncode(s string) string
- func IsRand(v string) (string, bool)
- func JSONBody(v any) string
- func Multipart(parts map[string]string) (string, string)
- func MultipartOrdered(boundary string, parts ...string) (string, string)
- func NameOf(mod Exploit) string
- func Names() []string
- func ObfuscateEmail(email string) string
- func Opts(kv ...string) map[string]string
- func PHPEvalShell(run *Context) string
- func PHPEvalSystem(cmd string) string
- func PHPEvalWrap(code string) string
- func PHPReverseShell(run *Context) string
- func PHPSystem(cmd string) string
- func Poll(timeoutSec int, fn func() bool) error
- func ROT13(s string) string
- func Rand(label string) string
- func RandAlpha(n int) string
- func RandBool() bool
- func RandInt(min, max int) int
- func RandTextDefault(n int) string
- func RegexFind(pattern, s string) string
- func Register(mod Exploit)
- func RegisterEncoder(e *Encoder)
- func RegisterEnricher(fn OptionEnricher)
- func RegisterSenderFactory(proto string, factory func(Params) any)
- func Replace(s string, oldNew ...string) string
- func Reverse(s string) string
- func Run(mod Exploit, opts ...RunOption)
- func SetDialFactory(f DialFactory)
- func SetFaker(f Faker)
- func SetHTTPServerFunc(fn HTTPServerFunc)
- func SetLabManager(m LabManager)
- func SetPHPEvalShell(fn func(string, int) string)
- func SetPHPEvalSystem(fn func(string) string)
- func SetPHPReverseShell(fn func(string, int) string)
- func SetPHPSystem(fn func(string) string)
- func SetPoolFactory(f PoolFactory)
- func SetRunner(fn func(Exploit, RunOptions))
- func SetXMLFind(fn func(body, xpath string) []string)
- func Shuffle(items []string) []string
- func Sleep(seconds int)
- func Sprintf(format string, args ...any) string
- func StartHTTPServer(params Params, mux *ServerMux) (string, func(), error)
- func TestRegister(t *testing.T, name string, mod Exploit)
- func UTCDateOffset(days int) string
- func UTF16LEBase64(s string) string
- func WireSenders(ctx *Context, params Params)
- func WithPool(ctx context.Context, threads int, proxy string) context.Context
- type Author
- type AuthorRank
- type Buffer
- type CheckCode
- type CheckResult
- type Checker
- type CmdStager
- type Conn
- type Context
- func (c *Context) Commands() []string
- func (c *Context) CommentTrail(cmd string) string
- func (c *Context) Dial() (Conn, error)
- func (c *Context) Elapsed(start bool) float64
- func (c *Context) EncodedPayload() string
- func (c *Context) Error(format string, args ...any)
- func (c *Context) ExploitURL() string
- func (c *Context) Get(key string) string
- func (c *Context) Mux() *ServerMux
- func (c *Context) Params() Params
- func (c *Context) Payload() string
- func (c *Context) RandText(n int) string
- func (c *Context) RegisterSender(proto string, fn any)
- func (c *Context) Send(req Sendable) (*HTTPResponse, error)
- func (c *Context) ServeRoute(pattern, contentType string, body []byte)
- func (c *Context) SetCommands(cmds []string)
- func (c *Context) SetExploitURL(url string)
- func (c *Context) SetTarget(t Target)
- func (c *Context) Status(format string, args ...any)
- func (c *Context) Success(format string, args ...any)
- func (c *Context) Target() Target
- func (c *Context) WaitRoutes(timeoutSec int, patterns ...string) error
- func (c *Context) Warning(format string, args ...any)
- type DialFactory
- type Encoder
- type Exploit
- type Faker
- type Feature
- type HTTPRequest
- type HTTPResponse
- func (r *HTTPResponse) BodyBytes() ([]byte, error)
- func (r *HTTPResponse) BodyString() (string, error)
- func (r *HTTPResponse) Contains(substr string) bool
- func (r *HTTPResponse) ContainsAny(substrs ...string) bool
- func (r *HTTPResponse) Header(key string) string
- func (r *HTTPResponse) JSON(target any) error
- func (r *HTTPResponse) SetContainsFn(fn func(...string) bool)
- func (r *HTTPResponse) XMLFind(xpath string) []string
- type HTTPServerFunc
- type HTTPServerModule
- type Info
- type Lab
- type LabManager
- type LabServiceStatus
- type LabStatus
- type Notes
- type Option
- func OptAddress(name, def, desc string) Option
- func OptAdvanced(opt Option) Option
- func OptBool(name string, def bool, desc string) Option
- func OptEnum(name, def, desc string, values ...string) Option
- func OptInt(name string, def int, desc string) Option
- func OptPort(name string, def int, desc string) Option
- func OptRequired(name, def, desc string) Option
- func OptString(name, def, desc string) Option
- func OptTargetURI(def string) Option
- func ResolveOptions(mod Exploit) []Option
- type OptionEnricher
- type OptionType
- type Params
- func (p Params) Arch() string
- func (p Params) Clone() Params
- func (p Params) Get(key string) string
- func (p Params) GetOr(key, def string) string
- func (p Params) Int(key string) int
- func (p Params) IntOr(key string, def int) int
- func (p Params) Lhost() string
- func (p Params) Lport() int
- func (p Params) Map() map[string]string
- func (p Params) Set(key, value string)
- func (p Params) Target() string
- func (p Params) Tunnel() string
- type Pik
- type PoolFactory
- type Query
- type RefType
- type Reference
- type Reliability
- type RunOption
- type RunOptions
- type Sendable
- type SenderFactory
- type ServerMux
- type Service
- type Stance
- type TarEntry
- type Target
- type Values
- type WithHTTPServer
Constants ¶
const ( CrashSafe = "CRASH_SAFE" CrashUnsafe = "CRASH_UNSAFE" ServiceRestart = "SERVICE_RESTART" ArtifactsOnDisk = "ARTIFACTS_ON_DISK" IOCInLogs = "IOC_IN_LOGS" ConfigChanges = "CONFIG_CHANGES" RepeatableSession = "REPEATABLE_SESSION" AccountLockout = "ACCOUNT_LOCKOUT_POSSIBLE" )
Standard stability tags.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶ added in v0.2.0
Base64Decode decodes a base64 string.
func Base64Encode ¶ added in v0.2.0
Base64Encode encodes a string to base64.
func BuildTarGz ¶ added in v0.5.0
BuildTarGz creates a tar.gz archive from the given entries. bytes.Buffer is the underlying writer, so Write never fails.
func EncoderNames ¶ added in v0.5.0
EncoderNames returns all encoder names for the given platform.
func JSONBody ¶ added in v0.2.0
JSONBody serializes a value to a JSON string for use in Request.Body.
func Multipart ¶ added in v0.2.0
Multipart builds a multipart/form-data body from named parts (unordered). Returns the body string and content-type header.
func MultipartOrdered ¶ added in v0.2.0
MultipartOrdered builds a multipart/form-data body from ordered name-value pairs. Parts are provided as alternating name, value strings. Returns the body string and content-type header.
func ObfuscateEmail ¶ added in v0.2.0
ObfuscateEmail formats a raw email to <user[at]domain>. Already obfuscated emails are returned as-is.
func PHPEvalShell ¶ added in v0.5.0
PHPEvalShell returns PHP code (no tags) for a reverse shell via eval().
func PHPEvalSystem ¶ added in v0.5.0
PHPEvalSystem returns PHP code (no tags) for system exec via eval().
func PHPEvalWrap ¶ added in v0.5.0
PHPEvalWrap wraps raw PHP code in eval(base64_decode('...')) for safe transport.
func PHPReverseShell ¶ added in v0.5.0
PHPReverseShell returns a self-deleting PHP reverse shell for file drop. Reads LHOST/LPORT from the context automatically.
func Rand ¶ added in v0.3.0
Rand returns a placeholder that pkg/lab replaces with a random value. Same label across services = same generated value (shared credentials).
func RandAlpha ¶ added in v0.5.0
RandAlpha returns a random mixed-case alphabetic string of length n.
func RandTextDefault ¶ added in v0.2.0
RandTextDefault generates random alphanumeric text without needing a Context.
func RegexFind ¶ added in v0.2.0
RegexFind returns the first capturing group match of pattern in s, or empty string.
func Register ¶
func Register(mod Exploit)
Register adds an exploit to the global registry. The name is derived from the caller's file path relative to modules/. callerSkip controls stack depth: use 0 when calling from init() directly, use 1 when called through an intermediary (like sdk.Register wrapper).
func RegisterEncoder ¶ added in v0.5.0
func RegisterEncoder(e *Encoder)
RegisterEncoder registers a payload encoder.
func RegisterEnricher ¶
func RegisterEnricher(fn OptionEnricher)
func RegisterSenderFactory ¶ added in v0.5.0
RegisterSenderFactory registers a protocol's send factory. Called by protocol packages via init().
func Run ¶
Run starts a standalone single-module CLI. Requires importing _ "github.com/Chocapikk/pik/pkg/cli" to register the runner.
func SetDialFactory ¶ added in v0.4.0
func SetDialFactory(f DialFactory)
SetDialFactory registers the TCP dial implementation.
func SetFaker ¶ added in v0.5.0
func SetFaker(f Faker)
SetFaker registers the faker implementation (called from pkg/fake init).
func SetHTTPServerFunc ¶ added in v0.5.0
func SetHTTPServerFunc(fn HTTPServerFunc)
SetHTTPServerFunc registers the HTTP server implementation.
func SetLabManager ¶ added in v0.2.0
func SetLabManager(m LabManager)
SetLabManager registers the lab manager (called from pkg/lab init).
func SetPHPEvalShell ¶ added in v0.5.0
SetPHPEvalShell registers the PHP eval reverse shell implementation.
func SetPHPEvalSystem ¶ added in v0.5.0
SetPHPEvalSystem registers the PHP eval system exec implementation.
func SetPHPReverseShell ¶ added in v0.5.0
SetPHPReverseShell registers the PHP reverse shell drop implementation.
func SetPHPSystem ¶ added in v0.5.0
SetPHPSystem registers the PHP system exec drop implementation.
func SetPoolFactory ¶ added in v0.4.0
func SetPoolFactory(f PoolFactory)
SetPoolFactory registers the connection pool implementation.
func SetRunner ¶
func SetRunner(fn func(Exploit, RunOptions))
SetRunner registers the standalone runner function. Called from pkg/cli's init() to break the import cycle.
func SetXMLFind ¶ added in v0.5.0
SetXMLFind registers the XPath query implementation. Called by pkg/xmlutil.init() to avoid pulling xmlquery into all binaries.
func Sleep ¶ added in v0.5.0
func Sleep(seconds int)
Sleep pauses execution for the given number of seconds.
func StartHTTPServer ¶ added in v0.5.0
StartHTTPServer starts the HTTP server using the registered implementation.
func TestRegister ¶ added in v0.5.0
TestRegister registers a module under a specific name for testing purposes. It cleans up the registration when the test completes.
func UTCDateOffset ¶ added in v0.5.0
UTCDateOffset returns an ISO 8601 datetime string offset by days from now. Negative values produce past dates, positive values produce future dates.
func UTF16LEBase64 ¶ added in v0.5.0
UTF16LEBase64 encodes a string as UTF-16LE then base64. Used for PowerShell -EncodedCommand / -e payloads.
func WireSenders ¶ added in v0.5.0
WireSenders creates and registers all protocol senders on a context. Called by the runner in BuildContext.
Types ¶
type Author ¶ added in v0.2.0
type Author struct {
Name string // real name or alias
Handle string // online handle (e.g. "Chocapikk")
Email string // contact email, must use <user[at]domain> format (Register panics on raw @)
Company string // organization or team (e.g. "Horizon3 Attack Team")
}
Author describes a module contributor. Email is automatically formatted to <user[at]domain> for anti-scraping.
func Authors ¶ added in v0.5.0
Authors returns its arguments as a slice, removing []Author{} noise from module code.
func NewAuthor ¶ added in v0.5.0
NewAuthor creates an Author with the given name. Chain .Handle(), .Email(), .Company() for more.
func (Author) WithCompany ¶ added in v0.5.0
func (Author) WithHandle ¶ added in v0.5.0
type AuthorRank ¶
AuthorRank holds contributor statistics.
func Rankings ¶
func Rankings() []AuthorRank
Rankings returns a sorted leaderboard of exploit authors.
type Buffer ¶ added in v0.4.0
Buffer is a fluent binary packet builder for crafting protocol messages. Re-exported from pkg/encode.
type CheckResult ¶
type CheckResult struct {
Code CheckCode
Reason string
Details map[string]string // version detected, banner, etc.
}
func Detected ¶
func Detected(reason string) (CheckResult, error)
func Safe ¶
func Safe(reason string) (CheckResult, error)
func SleepCheck ¶ added in v0.5.0
func SleepCheck(run *Context, fn func(delay int) error) (CheckResult, error)
SleepCheck performs a sleep-based timing check. It calls fn with a random delay (2-4s) three times and verifies the response takes at least that long. Returns Vulnerable if 2+ rounds match, Safe otherwise.
func Unknown ¶
func Unknown(err error) (CheckResult, error)
func Vulnerable ¶
func Vulnerable(reason string, details ...string) (CheckResult, error)
Check result constructors - match MSF's CheckCode::Vulnerable() style.
func (CheckResult) FormatReason ¶
func (r CheckResult) FormatReason() string
type Checker ¶
type Checker interface {
Check(run *Context) (CheckResult, error)
}
Checker is an optional interface for modules that support vulnerability checking.
type CmdStager ¶
CmdStager is a marker interface for modules that support chunked command delivery. When the runner uses cmdstager mode, it sets commands on the Context via SetCommands(). The module reads them with Commands() and delivers them in its Exploit() method, handling its own setup/teardown.
type Conn ¶ added in v0.4.0
type Conn interface {
Send([]byte) error
Recv(int) ([]byte, error)
SendRecv(data []byte, recvSize int) ([]byte, error)
Close() error
}
Conn is a raw TCP connection returned by Dial.
type Context ¶
type Context struct {
// Function hooks injected by the runner.
DialFn func() (Conn, error)
StatusFn func(string, ...any)
SuccessFn func(string, ...any)
ErrorFn func(string, ...any)
WarningFn func(string, ...any)
CommentFn func(string) string
RandTextFn func(int) string
EncoderFn func(string) string
// contains filtered or unexported fields
}
Context is the execution context passed to exploits. Provides protocol dispatch, logging, payload helpers, and timing.
func NewContext ¶
NewContext creates a Context with option values and payload command.
func (*Context) CommentTrail ¶
func (*Context) EncodedPayload ¶ added in v0.5.0
EncodedPayload returns the payload wrapped with the selected encoder. Modules should use this instead of manually calling Base64Bash(Payload()).
func (*Context) ExploitURL ¶ added in v0.5.0
ExploitURL returns the URL of the exploit HTTP server started by the runner.
func (*Context) Mux ¶ added in v0.5.0
Mux returns the exploit HTTP server route table. The runner uses this to dispatch incoming requests.
func (*Context) Params ¶ added in v0.4.0
Params returns an sdk.Params built from the context values.
func (*Context) RegisterSender ¶ added in v0.5.0
RegisterSender adds a protocol send function to the context. Called by the runner for each registered protocol factory.
func (*Context) Send ¶
func (c *Context) Send(req Sendable) (*HTTPResponse, error)
Send dispatches a request to the appropriate protocol handler. The request type determines which protocol is used.
func (*Context) ServeRoute ¶ added in v0.5.0
ServeRoute registers a route on the exploit HTTP server.
func (*Context) SetCommands ¶
SetCommands is called by the runner to inject CmdStager commands.
func (*Context) SetExploitURL ¶ added in v0.5.0
SetExploitURL is called by the runner to set the exploit server URL.
func (*Context) WaitRoutes ¶ added in v0.5.0
WaitRoutes blocks until all registered patterns have been hit or timeout.
type DialFactory ¶ added in v0.4.0
DialFactory creates a Conn from module params.
type Encoder ¶ added in v0.5.0
type Encoder struct {
Name string
Platform string // "linux", "windows", "" (any)
Desc string
Fn func(string) string
}
Encoder describes a registered payload encoder.
func GetEncoder ¶ added in v0.5.0
GetEncoder returns an encoder by name, or nil if not found.
func ListEncoders ¶ added in v0.5.0
ListEncoders returns all encoders compatible with the given platform.
type Faker ¶ added in v0.5.0
type Faker interface {
DomainName() string
URL() string
IPv4Address() string
IPv6Address() string
Email() string
Username() string
FirstName() string
LastName() string
Name() string
}
Faker generates realistic fake data (domains, emails, IPs, etc.). Set by pkg/fake via init() - only loaded when imported.
type Feature ¶ added in v0.5.0
type Feature string
Feature identifies an optional dependency for standalone builds.
type HTTPRequest ¶ added in v0.5.0
type HTTPRequest struct {
Method string
Path string
Query Values
Form Values
Body string // raw request body
ContentType string
Headers map[string]string
Timeout int // seconds
NoRedirect bool
FireAndForget bool // send request, ignore response and errors
}
HTTPRequest describes an HTTP request from module code.
func (*HTTPRequest) BodyReader ¶ added in v0.5.0
func (r *HTTPRequest) BodyReader() io.Reader
BodyReader returns the Body as an io.Reader. Used internally by the HTTP bridge.
type HTTPResponse ¶ added in v0.5.0
type HTTPResponse struct {
StatusCode int
Body io.ReadCloser
Headers map[string]string
// contains filtered or unexported fields
}
HTTPResponse is an HTTP response for module code.
func (*HTTPResponse) BodyBytes ¶ added in v0.5.0
func (r *HTTPResponse) BodyBytes() ([]byte, error)
BodyBytes reads and caches the full response body.
func (*HTTPResponse) BodyString ¶ added in v0.5.0
func (r *HTTPResponse) BodyString() (string, error)
BodyString returns the response body as a string.
func (*HTTPResponse) Contains ¶ added in v0.5.0
func (r *HTTPResponse) Contains(substr string) bool
Contains checks if the response body contains the given substring.
func (*HTTPResponse) ContainsAny ¶ added in v0.5.0
func (r *HTTPResponse) ContainsAny(substrs ...string) bool
ContainsAny returns true if the response body contains any of the given substrings.
func (*HTTPResponse) Header ¶ added in v0.5.0
func (r *HTTPResponse) Header(key string) string
Header returns the value of a response header (case-insensitive).
func (*HTTPResponse) JSON ¶ added in v0.5.0
func (r *HTTPResponse) JSON(target any) error
JSON unmarshals the response body into the given target.
func (*HTTPResponse) SetContainsFn ¶ added in v0.5.0
func (r *HTTPResponse) SetContainsFn(fn func(...string) bool)
SetContainsFn sets the function used by ContainsAny.
func (*HTTPResponse) XMLFind ¶ added in v0.5.0
func (r *HTTPResponse) XMLFind(xpath string) []string
XMLFind returns the inner text of all XML nodes matching the XPath expression. Requires a parser registered via SetXMLFind (see pkg/xmlutil).
type HTTPServerFunc ¶ added in v0.5.0
HTTPServerFunc starts an HTTP server and returns its URL + stop func.
type HTTPServerModule ¶ added in v0.5.0
type HTTPServerModule interface {
HTTPServer() // marker
}
HTTPServerModule is a marker interface for modules that need an exploit HTTP server during exploitation (e.g. supply chain attacks, staging). The runner detects this interface and starts an HTTP server automatically. Modules register routes via Context.ServeRoute() and wait for hits via Context.WaitRoutes(). The server URL is available via Context.ExploitURL().
type Info ¶
type Info struct {
Name string // Software name (e.g. "OpenDCIM", "Langflow", "Next.js")
Versions string // Affected versions (e.g. "< 24.2", "1.0.0 - 1.2.9")
Description string // Vulnerability title (e.g. "SQLi to RCE via Config Poisoning")
Detail string
Authors []Author
Disclosure string // "2026-01-15"
Reliability Reliability
Stance Stance
Privileged bool // does exploitation yield privileged access?
Notes Notes
Refs []Reference
Queries []Query
Targets []Target
Defaults map[string]string
Features []Feature
Lab Lab
}
func (Info) AuthorNames ¶ added in v0.2.0
func (Info) TargetStrings ¶
type Lab ¶ added in v0.2.0
type Lab struct {
Services []Service
}
Lab declares an optional Docker lab environment for testing a module.
type LabManager ¶ added in v0.2.0
type LabManager interface {
Start(ctx context.Context, name string, services []Service) error
Stop(ctx context.Context, name string) error
Status(ctx context.Context) ([]LabStatus, error)
IsRunning(ctx context.Context, name string) bool
Target(ctx context.Context, name string) string
WaitReady(ctx context.Context, addr string, timeout time.Duration) error
WaitProbe(ctx context.Context, timeout time.Duration, fn func() error) error
DockerGateway() string
}
LabManager is implemented by pkg/lab and registered via SetLabManager. This late binding keeps Docker SDK out of the sdk package and out of standalone binaries that don't import pkg/lab.
func GetLabManager ¶ added in v0.2.0
func GetLabManager() LabManager
GetLabManager returns the registered lab manager, or nil if not available.
type LabServiceStatus ¶ added in v0.2.0
LabServiceStatus holds status for one service container.
type LabStatus ¶ added in v0.2.0
type LabStatus struct {
Name string
Services []LabServiceStatus
}
LabStatus holds status for a lab (mirrors lab.LabInfo without importing it).
type Notes ¶
type Notes struct {
Stability []string // CRASH_SAFE, CRASH_UNSAFE, SERVICE_RESTART
SideEffects []string // ARTIFACTS_ON_DISK, IOC_IN_LOGS, CONFIG_CHANGES
Reliability []string // REPEATABLE_SESSION, UNRELIABLE_SESSION
}
func SafeNotes ¶ added in v0.5.0
func SafeNotes() Notes
SafeNotes returns Notes with CrashSafe stability. Chain methods to add more.
func (Notes) ConfigChanges ¶ added in v0.5.0
ConfigChanges adds ConfigChanges to SideEffects.
func (Notes) Repeatable ¶ added in v0.5.0
Repeatable sets Reliability to RepeatableSession.
type Option ¶
type Option struct {
Name string
Type OptionType // defaults to TypeString if empty
Default string
Desc string
Required bool
Advanced bool
Enums []string // valid values for TypeEnum
}
func OptAddress ¶
func OptRequired ¶
func OptTargetURI ¶
func ResolveOptions ¶
ResolveOptions returns the full option set: module + enrichers + target defaults + module defaults.
type OptionEnricher ¶
type OptionType ¶
type OptionType string
const ( TypeString OptionType = "string" TypeInt OptionType = "int" TypeBool OptionType = "bool" TypePort OptionType = "port" TypePath OptionType = "path" TypeAddress OptionType = "address" TypeEnum OptionType = "enum" )
type Params ¶
Params holds the resolved option values for a module run.
type Pik ¶
type Pik struct{}
Pik is the base struct embedded by all modules. It provides default implementations for optional interface methods.
type PoolFactory ¶ added in v0.4.0
PoolFactory configures connection pooling on a context for concurrent scanning. Registered by protocol packages that support pooling (e.g. HTTP).
type Query ¶
type Query struct {
Engine string
Dork string
Scope string // optional, e.g. "service" or "leak" for LeakIX
}
Query is a search engine dork for finding targets.
func Dorks ¶ added in v0.5.0
Dorks returns its arguments as a slice, removing []Query{} noise from module code.
func LeakIXPlugin ¶ added in v0.5.0
type Reference ¶
type Reference struct {
Type RefType
ID string
Repo string // optional: "owner/repo" for repo-scoped advisories (GHSA)
}
Reference is a vulnerability reference.
func GHSA ¶
GHSA creates a GitHub Security Advisory reference. Use GHSA("xxxx-yyyy-zzzz") for global advisories, or GHSA("xxxx-yyyy-zzzz", "owner/repo") for repo-scoped ones.
func Packetstorm ¶
type Reliability ¶
type Reliability int
const ( Unstable Reliability = 0 Unlikely Reliability = 100 Difficult Reliability = 200 Typical Reliability = 300 Reliable Reliability = 400 VeryReliable Reliability = 500 Certain Reliability = 600 )
func (Reliability) String ¶
func (r Reliability) String() string
type RunOption ¶ added in v0.1.4
type RunOption func(*RunOptions)
RunOption is a functional option for Run.
func WithConsole ¶ added in v0.1.4
func WithConsole() RunOption
WithConsole enables the interactive console subcommand in standalone binaries.
type RunOptions ¶ added in v0.1.4
type RunOptions struct {
Console bool // Add interactive console subcommand.
Lab bool // Add lab management subcommands.
}
RunOptions configures standalone binary behavior.
type Sendable ¶ added in v0.5.0
type Sendable interface {
// contains filtered or unexported methods
}
Sendable is implemented by all request types that can be passed to run.Send().
type SenderFactory ¶ added in v0.5.0
SenderFactory creates a protocol-specific send function from module params.
type ServerMux ¶ added in v0.5.0
type ServerMux struct {
// contains filtered or unexported fields
}
ServerMux is an internal route table for the exploit HTTP server.
func (*ServerMux) Match ¶ added in v0.5.0
Match finds the first route matching the path. Pattern syntax: no wildcard = exact, *suffix = ends-with, prefix* = starts-with, *contains* = substring. Used internally by the runner's HTTP handler.
func (*ServerMux) ServeRoute ¶ added in v0.5.0
ServeRoute registers a route on the exploit HTTP server. Requests whose path contains the pattern are served with the given body.
type Service ¶ added in v0.2.0
type Service struct {
Name string // container name suffix (e.g. "web", "db")
Image string // Docker image (e.g. "vulhub/langflow:1.2.0")
Ports []string // port bindings (e.g. "7860:7860")
Env map[string]string // environment variables
Cmd []string // override entrypoint command
Volumes []string // bind mounts (host:container)
Healthcheck []string // CMD-SHELL health check command
PostStart []string // shell commands to exec after container start
}
Service describes a container in a lab environment. pkg/lab converts these to Docker SDK types at runtime.
func NewLabService ¶ added in v0.2.0
NewLabService builds a Service for the common case: image + port bindings. Chain WithEnv(), WithCmd(), WithVolume(), and WithHealthcheck() for more.
func (Service) WithHealthcheck ¶ added in v0.2.0
WithHealthcheck sets a CMD-SHELL health check.
func (Service) WithPostStart ¶ added in v0.5.0
WithPostStart adds shell commands to run inside the container after start.
func (Service) WithVolume ¶ added in v0.2.0
WithVolume adds a bind mount (host:container).
type TarEntry ¶ added in v0.5.0
type TarEntry struct {
Name string // path inside archive (directories end with /)
Body []byte // nil for directories
}
TarEntry is a file or directory entry for BuildTarGz.
type Target ¶
type Target struct {
Name string
Platform string
Type string // module-defined, e.g. "cmd", "dropper"
Arches []string
Defaults map[string]string // per-target option overrides
}
func LinuxCmd ¶ added in v0.5.0
func LinuxCmd() []Target
LinuxCmd returns a single Linux command shell target.
func TargetLinux ¶
func TargetWindows ¶
func (Target) SupportsArch ¶
type WithHTTPServer ¶ added in v0.5.0
type WithHTTPServer struct{}
WithHTTPServer is an embeddable type that satisfies HTTPServerModule. Modules embed this in their struct to signal they need an exploit HTTP server.
func (WithHTTPServer) HTTPServer ¶ added in v0.5.0
func (WithHTTPServer) HTTPServer()