Documentation
¶
Index ¶
- Constants
- func CaptureAttribute(body io.Reader, tag, attr string) (string, error)
- func CaptureErrorMessages(errorMessage string) (string, error)
- func CaptureStreams(body io.Reader, stdout, stderr io.Writer) (string, bool, error)
- func CaptureText(body io.Reader, tag string) (string, error)
- func Endpoint(ipAddress, username, password string, auth Authentication, ...) getEndpointDetails
- func IsSecure(b bool) winrmSettingsOption
- func Locale(locale string) winrmSettingsOption
- func MaxEnvelopeSize(size string) winrmSettingsOption
- func OperationTimeout(operationTimeout int) winrmSettingsOption
- func Port(num int) winrmSettingsOption
- func Timeout(timeout int) winrmSettingsOption
- type Authentication
- type PayloadBuilder
- type RequestType
- type WinRMClient
Constants ¶
View Source
const ( Create = 1 << iota Execute Send Receive Delete )
View Source
const ( WINRM_HTTP_PORT = 5985 CHUNK = 512 SCRIPTSEPARATOR = "\n" )
Variables ¶
This section is empty.
Functions ¶
func CaptureErrorMessages ¶
func CaptureStreams ¶
func MaxEnvelopeSize ¶
func MaxEnvelopeSize(size string) winrmSettingsOption
func OperationTimeout ¶
func OperationTimeout(operationTimeout int) winrmSettingsOption
Types ¶
type Authentication ¶
type Authentication int
const ( Basic Authentication = 1 << iota NTLM Kerberos )
type PayloadBuilder ¶
type PayloadBuilder struct { // Format - https://{{ipaddress_or_fqdn}}:{{portno}}/wsman Url string OperationTimeout string Locale string MessageId string ShellId string CommandId string Command string Input string MaxEnvelopeSize string OpType RequestType }
Data structure to build the xml payloads from templates
func (*PayloadBuilder) GenerateBody ¶
func (p *PayloadBuilder) GenerateBody() string
func (*PayloadBuilder) GenerateOptionSet ¶
func (p *PayloadBuilder) GenerateOptionSet() string
func (*PayloadBuilder) GenerateSelectorSet ¶
func (p *PayloadBuilder) GenerateSelectorSet() string
func (*PayloadBuilder) GetAction ¶
func (p *PayloadBuilder) GetAction() string
type RequestType ¶
type RequestType int
type WinRMClient ¶
type WinRMClient struct {
// contains filtered or unexported fields
}
WinRM client used for executing scripts TODO: Add support for NTLM and Kerberos, Only basic is supported for now TODO: Add support for certificate verification while initiating connections
func NewWinRMClient ¶
func NewWinRMClient(details getEndpointDetails, options ...winrmSettingsOption) *WinRMClient
Creates a new WinRM client
func (*WinRMClient) ExecuteCommand ¶
func (w *WinRMClient) ExecuteCommand(cmd string) (string, int, error)
ExecuteCommand - Executes the command on the target
Click to show internal directories.
Click to hide internal directories.