Documentation
¶
Index ¶
- func Domain(con *client.Client) carapace.Action
- func Guard(label string, fn carapace.CompletionCallback) carapace.CompletionCallback
- func Interface() carapace.Action
- func MAC(con *client.Client) carapace.Action
- func PortSpec(con *client.Client) carapace.Action
- func PortValue(con *client.Client) carapace.Action
- func Secret(con *client.Client) carapace.Action
- func SourceAddr() carapace.Action
- func Targets(con *client.Client) carapace.Action
- func Username(con *client.Client) carapace.Action
- func WebURL(con *client.Client) carapace.Action
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Domain ¶
Domain completes a domain value — an NSE `dns-*` arg (dns-brute.domain, …), and any DNS/recon tool's domain flag later — from the DNS names already in the database. Each known hostname contributes its parent zones (every suffix of ≥2 labels, minus the host name itself), aggregated by how many known hosts fall under each; zones under the current agent's host are promoted via the relevance layer. Cached; the cache key carries the agent id.
The value is intentionally *not* a full host FQDN (that is the target completer's job) — it is the zone an operator hands to a brute/transfer tool to enumerate.
func Guard ¶
func Guard(label string, fn carapace.CompletionCallback) carapace.CompletionCallback
Guard wraps a completion callback so a panic degrades to a visible carapace message instead of crashing the exec-once `_carapace` subprocess — which the shell experiences as completion hanging with no output. The message also surfaces the failure (with its location in the panic text) so it can be diagnosed rather than silently swallowed. label names the completer for the message.
func Interface ¶
Interface completes a network-interface value — nmap's `-e`, an NSE `*.interface` arg, and any other scanner's interface flag — from the LOCAL machine's interfaces (the box the completion process runs on). It is deliberately not agent-context aware: interfaces belong to the operator's host, not the possibly-remote loaded agent. Purely local and cheap, so it is not cached. Interfaces are grouped up vs down (you scan from an up interface), each described by its addresses.
func MAC ¶
MAC completes a MAC-address value — nmap's `--spoof-mac`, masscan's `--router-mac`/ `--adapter-mac`/`--spoof-mac`, and an NSE `*.mac` arg — from the MACs already in the database (the `Host.MAC` field and any address of type "mac", which carries an OUI vendor). MACs on the agent's host, then its subnet, are promoted via the relevance layer. Cached; the key carries the agent id.
func PortSpec ¶
PortSpec is PortValue plus named-service tokens (ssh, http, …), for nmap's `-p`, which — unlike masscan — accepts a service name and expands it via nmap-services. The service group renders last, after the numeric ports.
func PortValue ¶
PortValue completes a numeric port value — masscan's `-p`/`--ports` and NSE `*.port` — from the DB's known open ports plus a curated set of well-known ports. Ports open on the current agent's host, then on its subnet neighbours, are promoted via the shared relevance layer, so the operator sees "what's open around here" first. Cached; the cache key carries the agent id.
func Secret ¶
Secret completes a secret value — an NSE `*.password`/`*.passphrase` arg, and any brute/auth tool's secret flag later — from the credential store, so known passwords/hashes can be reused (AIMS's whole point). Secrets are grouped by credential type (the PrivateType axis), and the credentials used on the current agent's host are promoted to the top via the relevance layer (RelevanceOfHostID over the Logins that attach a credential to a host). Cached; key carries the agent id.
Note: this deliberately surfaces plaintext secrets as completion values — that is the point of credential reuse, and the operator owns the store (cf. Sliver's GetPlaintextCredsByHashType).
func SourceAddr ¶
SourceAddr completes a source-address value — nmap's `-S`, masscan's `--source-ip`/ `--adapter-ip` — from the LOCAL machine's interface addresses: the legitimate source IPs a scan can send from. Like Interface it is deliberately local, not agent-context (the source belongs to the box running the scan tooling, not the possibly-remote loaded agent). Free-form is still accepted — spoofing an arbitrary address — this only offers the real local addresses as a shortcut.
func Targets ¶
Targets completes a target slot with known hosts, sub-grouped by address locality, and drops any target already present on the command line. It is the shared target completer — the nmap positional target slot and NSE host-valued script args both use it — so excluding already-chosen targets happens here, once, for every reuse site.
The exclusion (Filter against c.Args) is applied *outside* the cache: cachedTargets stores the whole host set once, and each keystroke filters that set against the live arguments. Filtering by exact token is safe against the DisableFlagParsing arg stream — flags and flag-values (-sS, a --script value) never equal a host candidate.
func Username ¶
Username completes a username value — an NSE `*.username`/`*.user` arg, and any auth tool's user flag later — from the credential store, and is the username half of the credential pair: each candidate is described by the secret it is paired with (its type and realm), so the operator picks a username *knowing* whether its password is on hand. It mirrors Secret's agent-context promotion on the username axis — usernames whose login is on the agent's host lead. This replaces the flat credentials.CompleteByUsername for scan slots. Cached; the key carries the agent id.
func WebURL ¶
WebURL completes a URL value — an NSE `*.url`/`*.uri` arg, and any web scanner's `-u`/`--url` later — by synthesizing `scheme://host[:port]/` from the DB's web services rather than completing free text. Endpoints on the current agent's host, then its subnet, are promoted via the relevance layer; the rest are grouped by scheme (with un-fingerprinted web ports flagged as guesses). Cached; the cache key carries the agent id.
Types ¶
This section is empty.