From e82446a73da58ad140e8de0332b1c005db53f8d4 Mon Sep 17 00:00:00 2001 From: Jacob Baines Date: Wed, 30 Oct 2024 11:40:55 -0400 Subject: [PATCH] Add function fo resolving the underlying c2 of shelltunnel --- config/config.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/config/config.go b/config/config.go index 85a71b4..7234faf 100644 --- a/config/config.go +++ b/config/config.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/vulncheck-oss/go-exploit/c2" + "github.com/vulncheck-oss/go-exploit/c2/shelltunnel" "github.com/vulncheck-oss/go-exploit/output" ) @@ -310,3 +311,19 @@ func (conf *Config) GetBoolFlag(name string) bool { return *value } + +// Some C2 (ShellTunnel) don't actually care how the payload is generated, but +// the underlying C2 might be implied depending on how the individual exploit +// has been developed. It is certainly not a requirement to call this function +// but it can help simplify the handling of secure shell vs insecure +func (conf *Config) ResolveC2Payload() c2.Impl { + if conf.C2Type != c2.ShellTunnel { + return conf.C2Type + } + + if shelltunnel.GetInstance().SSLShellServer { + return c2.SSLShellServer + } + + return c2.SimpleShellServer +}