@@ -98,6 +98,8 @@ type Config struct {
98
98
DoVersionCheck bool
99
99
// indicates if we run the exploit
100
100
DoExploit bool
101
+ // automatically start the c2 or not
102
+ C2AutoStart bool
101
103
// the user requested c2 to use
102
104
C2Type c2.Impl
103
105
// C2 server timeout
@@ -171,6 +173,7 @@ func NewRemoteExploit(implemented ImplementedFeatures, extype ExploitType, suppo
171
173
newConf .Vendor = vendor
172
174
newConf .Products = product
173
175
newConf .Product = fmt .Sprintf ("%s %s" , vendor , strings .Join (product , "/" ))
176
+ newConf .C2AutoStart = true
174
177
newConf .CPE = cpe
175
178
newConf .CVE = cve
176
179
newConf .Protocol = protocol
@@ -191,6 +194,7 @@ func NewLocalExploit(implemented ImplementedFeatures, extype ExploitType, suppor
191
194
newConf .Vendor = vendor
192
195
newConf .Products = product
193
196
newConf .Product = fmt .Sprintf ("%s %s" , vendor , strings .Join (product , "/" ))
197
+ newConf .C2AutoStart = true
194
198
newConf .CPE = cpe
195
199
newConf .CVE = cve
196
200
@@ -312,6 +316,16 @@ func (conf *Config) GetBoolFlag(name string) bool {
312
316
return * value
313
317
}
314
318
319
+ // Disable automatic start of c2 servers. Manually starting is required after
320
+ // this function is called. This is useful when you have an exploit that
321
+ // may have multiple stages and you are guaranteed to not need the C2
322
+ // setup. An example is an exploit that needs to retrieve a CAPTCHA may not
323
+ // want to start up the C2 until the first stage is retrieved and the
324
+ // CAPTCHA is solved.
325
+ func (conf * Config ) DisableC2Start () {
326
+ conf .C2AutoStart = false
327
+ }
328
+
315
329
// Some C2 (ShellTunnel) don't actually care how the payload is generated, but
316
330
// the underlying C2 might be implied depending on how the individual exploit
317
331
// has been developed. It is certainly not a requirement to call this function
0 commit comments