scripts

package
v0.0.0-...-620c023 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenUID

func GenUID() (uid string)

func GetJsonStruct

func GetJsonStruct(input string) (winlocal WinLocal, winremote WinRemote, web Web, linlocal LinuxLocal, linremote LinuxRemote, compileandrun CompileAndRun)

GetJsonStruct extracts options from kdz script, and matches script type with appropriate struct. This was tricky without generics

func ScriptCompileAndRun

func ScriptCompileAndRun(scropts interface{}, input ...string)

ScriptCompileAndRun temporarily compiles script to tmp/UID.go, uses go run to execute, then clears the go source from tmp dir

func ScriptList

func ScriptList(input ...string)

ScriptList lists scripts, can be modified with a filter

func ScriptRun

func ScriptRun(scropts interface{}, input ...string)

ScriptRun runs scripts

func ScriptSend

func ScriptSend(scriptname, NodeID string, scropts interface{})

ScriptSend populates a script with a given struct and sends it to a node for processing

func ScriptSendandReturn

func ScriptSendandReturn(scriptname, NodeID string, scropts interface{})

ScriptSendandReturn populates a script with a given struct and sends it to a node for processing

Types

type CompileAndRun

type CompileAndRun struct {
	Use       bool   `json:"Use"`
	NodeID    string `json:"NodeID"`
	Username  string `json:"Username"`
	Password  string `json:"Password"`
	Domain    string `json:"Domain"`
	Cmd       string `json:"Cmd"`
	Lhost     string `json:"Lhost"`
	Lport     string `json:"Lport"`
	Rhost     string `json:"Rhost"`
	Rport     string `json:"Rport"`
	Hostname  string `json:"Hostname"`
	Directory string `json:"Directory"`
	Filename  string `json:"Filename"`
}

CompileAndRun holds options for scripts that dont play well with yaegi

type LinuxLocal

type LinuxLocal struct {
	Use       bool   `json:"Use"`
	NodeID    string `json:"NodeID"`
	Username  string `json:"Username"`
	Password  string `json:"Password"`
	Cmd       string `json:"Cmd"`
	Lhost     string `json:"Lhost"`
	Lport     string `json:"Lport"`
	Rhost     string `json:"Rhost"`
	Rport     string `json:"Rport"`
	Hostname  string `json:"Hostname"`
	Directory string `json:"Directory"`
	Filename  string `json:"Filename"`
}

LinuxLocal holds options for local linux scripts

type LinuxRemote

type LinuxRemote struct {
	Use       bool   `json:"Use"`
	NodeID    string `json:"NodeID"`
	Username  string `json:"Username"`
	Password  string `json:"Password"`
	Cmd       string `json:"Cmd"`
	Lhost     string `json:"Lhost"`
	Lport     string `json:"Lport"`
	Rhost     string `json:"Rhost"`
	Rport     string `json:"Rport"`
	Hostname  string `json:"Hostname"`
	Directory string `json:"Directory"`
	Filename  string `json:"Filename"`
}

LinuxRemote holds options for remote linux scripts

type ScriptOps

type ScriptOps struct {
	LHOST, RHOST, CMD, LPORT, RPORT string
}

ScriptOps will hold all the options for our scripts

type Web

type Web struct {
	Use       bool   `json:"Use"`
	NodeID    string `json:"NodeID"`
	Username  string `json:"Username"`
	Password  string `json:"Password"`
	URL       string `json:"Domain"`
	Cmd       string `json:"Cmd"`
	Lhost     string `json:"Lhost"`
	Lport     string `json:"Lport"`
	Rhost     string `json:"Rhost"`
	Rport     string `json:"Rport"`
	Hostname  string `json:"Hostname"`
	Directory string `json:"Directory"`
	Filename  string `json:"Filename"`
}

Web holds options for web scripts

type WinLocal

type WinLocal struct {
	Use       bool   `json:"Use"`
	NodeID    string `json:"NodeID"`
	Username  string `json:"Username"`
	Password  string `json:"Password"`
	Domain    string `json:"Domain"`
	Cmd       string `json:"Cmd"`
	Lhost     string `json:"Lhost"`
	Lport     string `json:"Lport"`
	Rhost     string `json:"Rhost"`
	Rport     string `json:"Rport"`
	Hostname  string `json:"Hostname"`
	Directory string `json:"Directory"`
	Filename  string `json:"Filename"`
}

WinLocal holds options for local windows scripts

type WinRemote

type WinRemote struct {
	Use       bool   `json:"Use"`
	NodeID    string `json:"NodeID"`
	Username  string `json:"Username"`
	Password  string `json:"Password"`
	Domain    string `json:"Domain"`
	Cmd       string `json:"Cmd"`
	Lhost     string `json:"Lhost"`
	Lport     string `json:"Lport"`
	Rhost     string `json:"Rhost"`
	Rport     string `json:"Rport"`
	Hostname  string `json:"Hostname"`
	Directory string `json:"Directory"`
	Filename  string `json:"Filename"`
}

WinRemote holds options for remote windows scripts

Jump to

Keyboard shortcuts

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