hookpack

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 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 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

View Source
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

func Extensions(c Category) []string

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

func ListBundled(category Category) []string

ListBundled returns the names of every file embedded under a category. Used by /doctor and the catalogue API to confirm what shipped.

func ProgramNames

func ProgramNames(c Category) []string

ProgramNames returns the names of every program in a category.

func ScriptPath

func ScriptPath(category Category, name, ext string) (string, error)

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"
)

func Categories

func Categories() []Category

Categories lists every category, in stable order.

type Program

type Program struct {
	Name        string // file stem, e.g. "iam_enum"
	Description string // one-line summary, shown to the model
	Args        string // usage hint, e.g. "[--profile PROFILE] [--json-output]"
}

Program describes one bundled script.

func FindProgram

func FindProgram(c Category, name string) (Program, bool)

FindProgram looks up a program in a category by name.

Jump to

Keyboard shortcuts

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