Documentation
¶
Overview ¶
Package hookpack ships the offensive-security script library inside the binary and unpacks each script to disk on first use.
These are the post-exploitation and vulnerability-testing programs the hook tools (attack_script, awshook, azurehook, kubehook, winhook, machook, cipipe, ebpf) execute. They are written in Python (PowerShell for a couple of Windows programs) and rely only on the standard library plus a few well-known third-party packages that the user is prompted to install when they are missing.
Scripts are embedded with //go:embed so the binary stays self-contained. They are written to ~/.antares/hooks/<category>/<name><ext> lazily — only when a tool actually asks for one. Upgrades are detected by hashing the embedded content and comparing to a sidecar file, so a new binary always wins and an edited on-disk copy is always replaced.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Catalog = map[Category][]Program{ CategoryAttackScript: attackScripts, CategoryAWS: awsPrograms, CategoryAzure: azurePrograms, CategoryKube: kubePrograms, CategoryWin: winPrograms, CategoryMac: macPrograms, CategoryCI: ciPrograms, CategoryEBPF: ebpfPrograms, }
Catalog is the static catalogue of bundled programs per category. It is what each hook tool's schema and "not found" message is built from.
Functions ¶
func Extensions ¶
Extensions lists the file extensions a category uses, in preference order. Windows programs can be either PowerShell (.ps1) or Python (.py); every other category is Python only.
func ListBundled ¶
ListBundled returns the names of every file embedded under a category. Used by /doctor and the catalogue API to confirm what shipped.
func ProgramNames ¶
ProgramNames returns the names of every program in a category.
func ScriptPath ¶
ScriptPath returns the absolute path to an extracted script, writing it to ~/.antares/hooks/<category>/<name><ext> first if it is missing or stale. ext is one of Extensions(category) — the caller picks the language. The returned path is reused on subsequent calls within the same process.
Staleness is decided by comparing the sha256 of the embedded content to a sidecar file at <path>.sum: a missing script, a missing sidecar, or any hash mismatch triggers an atomic rewrite. This means a freshly built binary with updated scripts always wins over an older on-disk copy, without rewriting anything when the scripts have not changed.
Types ¶
type Category ¶
type Category string
Category is the directory name under data/ — also the tool that owns it.
const ( CategoryAttackScript Category = "scripts" // attack_script tool CategoryAWS Category = "awshook" CategoryAzure Category = "azurehook" CategoryKube Category = "kubehook" CategoryWin Category = "winhook" CategoryMac Category = "machook" CategoryCI Category = "cipipe" CategoryEBPF Category = "ebpf" )