pkg/session - Target & Credential Management
The session package is the foundation for all tools. It parses Impacket-style target strings and manages authentication credentials.
Types
Credentials
Target
Functions
ParseTargetString
Parses an Impacket-style target string into a Target and Credentials.
Format: [domain/]user[:password]@target[:port]
The @ delimiter is split on the last @ in the string, allowing passwords containing @.
EnsurePassword
Prompts interactively for a password if one is not already set and no alternative authentication method (hash, Kerberos, etc.) is configured.
Methods
Target.Addr
Returns the connection address using net.JoinHostPort, correctly handling IPv6 addresses.
Target.Network
Returns "tcp6" when IPv6 is requested, "tcp" otherwise.