diff options
author | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-03-07 08:52:48 -0600 |
---|---|---|
committer | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-03-07 08:52:48 -0600 |
commit | e87dd341dde93c289b6774f636e6767476b84a79 (patch) | |
tree | 3181b18f79b587bd04d98ed886f3505f37faeb2d /internal/exec/exec.go | |
parent | a5c860b8ab24c198b7390fbde90044754e35c1c5 (diff) | |
download | goexec-e87dd341dde93c289b6774f636e6767476b84a79.tar.gz goexec-e87dd341dde93c289b6774f636e6767476b84a79.zip |
Added wmiexec module + updated TODO
Diffstat (limited to 'internal/exec/exec.go')
-rw-r--r-- | internal/exec/exec.go | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/internal/exec/exec.go b/internal/exec/exec.go index 16fa543..a89cf7b 100644 --- a/internal/exec/exec.go +++ b/internal/exec/exec.go @@ -1,44 +1,45 @@ package exec import ( - "context" - "github.com/RedTeamPentesting/adauth" + "context" + "github.com/RedTeamPentesting/adauth" ) +type ConnectionConfig struct { + ConnectionMethod string + ConnectionMethodConfig interface{} +} + type CleanupConfig struct { - CleanupMethod string - CleanupMethodConfig interface{} + CleanupMethod string + CleanupMethodConfig interface{} } type ExecutionConfig struct { - ExecutableName string // ExecutableName represents the name of the executable; i.e. "notepad.exe", "calc" - ExecutablePath string // ExecutablePath represents the full path to the executable; i.e. `C:\Windows\explorer.exe` - ExecutableArgs string // ExecutableArgs represents the arguments to be passed to the executable during execution; i.e. "/C whoami" - - ExecutionMethod string // ExecutionMethod represents the specific execution strategy used by the module. - ExecutionMethodConfig interface{} - ExecutionOutput string // not implemented - ExecutionOutputConfig interface{} // not implemented + ExecutableName string // ExecutableName represents the name of the executable; i.e. "notepad.exe", "calc" + ExecutablePath string // ExecutablePath represents the full path to the executable; i.e. `C:\Windows\explorer.exe` + ExecutableArgs string // ExecutableArgs represents the arguments to be passed to the executable during execution; i.e. "/C whoami" + + ExecutionMethod string // ExecutionMethod represents the specific execution strategy used by the module. + ExecutionMethodConfig interface{} + //ExecutionOutput string // not implemented + //ExecutionOutputConfig interface{} // not implemented } type ShellConfig struct { - ShellName string // ShellName specifies the name of the shell executable; i.e. "cmd.exe", "powershell" - ShellPath string // ShellPath is the full Windows path to the shell executable; i.e. `C:\Windows\System32\cmd.exe` + ShellName string // ShellName specifies the name of the shell executable; i.e. "cmd.exe", "powershell" + ShellPath string // ShellPath is the full Windows path to the shell executable; i.e. `C:\Windows\System32\cmd.exe` } type Module interface { - // Exec performs a single execution task without the need to call Init. - Exec(context.Context, *adauth.Credential, *adauth.Target, *ExecutionConfig) error - Cleanup(context.Context, *adauth.Credential, *adauth.Target, *CleanupConfig) error - - // Init assigns the provided TODO - //Init(ctx context.Context, creds *adauth.Credential, target *adauth.Target) - //Shell(ctx context.Context, input chan *ExecutionConfig, output chan []byte) + Connect(context.Context, *adauth.Credential, *adauth.Target, *ConnectionConfig) error + Exec(context.Context, *ExecutionConfig) error + Cleanup(context.Context, *CleanupConfig) error } func (cfg *ExecutionConfig) GetRawCommand() string { - if cfg.ExecutableArgs != "" { - return cfg.ExecutablePath + " " + cfg.ExecutableArgs - } - return cfg.ExecutablePath + if cfg.ExecutableArgs != "" { + return cfg.ExecutablePath + " " + cfg.ExecutableArgs + } + return cfg.ExecutablePath } |