Skip to content

Commit 812d917

Browse files
authored
Merge pull request #263 from vulncheck-oss/addResolve
Add function for resolving the underlying c2 of shelltunnel
2 parents 1a4f7f8 + e82446a commit 812d917

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

config/config.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strings"
77

88
"github.com/vulncheck-oss/go-exploit/c2"
9+
"github.com/vulncheck-oss/go-exploit/c2/shelltunnel"
910
"github.com/vulncheck-oss/go-exploit/output"
1011
)
1112

@@ -310,3 +311,19 @@ func (conf *Config) GetBoolFlag(name string) bool {
310311

311312
return *value
312313
}
314+
315+
// Some C2 (ShellTunnel) don't actually care how the payload is generated, but
316+
// the underlying C2 might be implied depending on how the individual exploit
317+
// has been developed. It is certainly not a requirement to call this function
318+
// but it can help simplify the handling of secure shell vs insecure
319+
func (conf *Config) ResolveC2Payload() c2.Impl {
320+
if conf.C2Type != c2.ShellTunnel {
321+
return conf.C2Type
322+
}
323+
324+
if shelltunnel.GetInstance().SSLShellServer {
325+
return c2.SSLShellServer
326+
}
327+
328+
return c2.SimpleShellServer
329+
}

0 commit comments

Comments
 (0)