Documentation
¶
Overview ¶
Package script embeds a Lua 5.1 runtime (gopher-lua) so users can write small probes that run against open ports. See scry-plan.md §7 for the design discussion.
A script defines three globals:
description = "one-line summary shown in --help / --list-scripts"
ports = {80, 443} -- table of ports; or "any" for every port
function run(host, port)
...
return "finding string" -- or return nil, "reason"
end
A fresh Lua state is created for each run, so scripts cannot leak state between invocations. The API surface is registered under the global `scry` table; see api*.go for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine runs a collection of scripts against (host, port) pairs.
func NewEngine ¶
NewEngine returns an Engine configured with a per-call timeout. timeout<=0 uses a 5s default.
type Script ¶
type Script struct {
Name string // basename of the file, minus extension
Path string // absolute path used to re-compile
Description string // from `description` global
Ports []uint16 // from `ports` table; empty + AnyPort false = no ports
AnyPort bool // set when `ports = "any"`
// contains filtered or unexported fields
}
Script is a compiled, metadata-parsed Lua script ready to run.
Click to show internal directories.
Click to hide internal directories.