diff options
author | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-04-16 12:11:58 -0500 |
---|---|---|
committer | Bryan McNulty <bryanmcnulty@protonmail.com> | 2025-04-16 12:11:58 -0500 |
commit | 55eb4275fb760ac7a3ce1444f5ae0ded9e2ff91c (patch) | |
tree | edf4ec3b814fb10ccdbf759a62819a865d3e8141 /internal/exec/exec.go | |
parent | a827b67d47cba7b02ea9599fe6bb88ffb3a6967d (diff) | |
download | goexec-55eb4275fb760ac7a3ce1444f5ae0ded9e2ff91c.tar.gz goexec-55eb4275fb760ac7a3ce1444f5ae0ded9e2ff91c.zip |
rewrote everything lol
Diffstat (limited to 'internal/exec/exec.go')
-rw-r--r-- | internal/exec/exec.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/internal/exec/exec.go b/internal/exec/exec.go deleted file mode 100644 index db83d91..0000000 --- a/internal/exec/exec.go +++ /dev/null @@ -1,54 +0,0 @@ -package exec - -import ( - "context" - "fmt" - "github.com/RedTeamPentesting/adauth" - "strings" -) - -const ( - ConnectionMethodDCE = "dcerpc" -) - -type ConnectionConfig struct { - ConnectionMethod string - ConnectionMethodConfig interface{} -} - -type CleanupConfig struct { - 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{} - ReturnOutput bool -} - -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` -} - -type Module interface { - Connect(context.Context, *adauth.Credential, *adauth.Target, *ConnectionConfig) error - Exec(context.Context, *ExecutionConfig) error - Cleanup(context.Context, *CleanupConfig) error -} - -func (cfg *ExecutionConfig) GetRawCommand() string { - executable := cfg.ExecutablePath - if strings.Contains(executable, " ") { - executable = fmt.Sprintf("%q", executable) - } - if cfg.ExecutableArgs != "" { - return executable + " " + cfg.ExecutableArgs - } - return executable -} |