Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAuth returned if the post request is droped due to invalid credentials ErrAuth = fmt.Errorf("Unauthorized request") // ErrPing returned if the ping fails ErrPing = fmt.Errorf("Ping failed, can't recive any response form target") )
Functions ¶
func TTYGetPasswd ¶
TTYGetPasswd will be valid if it's used from a valid TTY input, This can be passed in ClientConfig
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client type retains information about the winrm connection
func NewClient ¶
func NewClient(config ClientConfig) (*Client, error)
NewClient creates a new secure winrm client for initiating connections with the winrm listener
func (*Client) Ping ¶
Ping executes a simple echo command on the remote, if the server dosen't respond to this echo command it will return ErrPing. If the payload is executed and the server response accordingly we return nil
type ClientConfig ¶
type ClientConfig struct { // User of the client connection // If you want the default user Administrator, leave this empty User string // Host where we want to connect Host string // Key Private RSA key Key []byte // Cert https client x509 cert Cert []byte // CACert of the host we wish to connect // This can be nil if Insecure is false CACert []byte // Timeout on how long we should wait until a connection is made. // If empty this will use the 60*time.Seconds winrm default value Timeout time.Duration // Insecure flag for checking the CACert or not. If this is true there should // be a valid CACert passed also. Insecure bool // Password callback for returning a password in different ways Password GetPasswd // Secure flag for specifying if the user wants https or http Secure bool }
ClientConfig used for setting up a secure https client connection
func (ClientConfig) Validate ¶
func (c ClientConfig) Validate() error
Validate checks all config options if they are invalid
type GetPasswd ¶
GetPasswd callback for different semantics that a client could use for secure authentication
type X509 ¶
type X509 struct {
// contains filtered or unexported fields
}
X509 type that defines windows remote manager credentials for client-server secure communication
func (*X509) ClientCert ¶
ClientCert returns the internal credential client x509 cert
func (*X509) LoadCACert ¶
LoadCACert reads ca cert into memory
func (*X509) LoadClientCert ¶
LoadClientCert generates client cert for x509 authentication if the directory files are not already there , if they are already there it will load them into memory