@@ -315,6 +315,19 @@ func (request *Request) ExecuteWithResults(target *contextargs.Context, dynamicV
315
315
values := generators .MergeMaps (payloadValues , hostnameVariables , request .options .Constants , templateCtx .GetAll ())
316
316
variablesMap := request .options .Variables .Evaluate (values )
317
317
payloadValues = generators .MergeMaps (variablesMap , payloadValues , request .options .Constants , hostnameVariables )
318
+
319
+ var interactshURLs []string
320
+ if request .options .Interactsh != nil {
321
+ for payloadName , payloadValue := range payloadValues {
322
+ var urls []string
323
+ payloadValue , urls = request .options .Interactsh .Replace (types .ToString (payloadValue ), interactshURLs )
324
+ if len (urls ) > 0 {
325
+ interactshURLs = append (interactshURLs , urls ... )
326
+ payloadValues [payloadName ] = payloadValue
327
+ }
328
+ }
329
+ }
330
+
318
331
// export all variables to template context
319
332
templateCtx .Merge (payloadValues )
320
333
@@ -404,7 +417,7 @@ func (request *Request) ExecuteWithResults(target *contextargs.Context, dynamicV
404
417
request .options .Progress .IncrementMatched ()
405
418
}
406
419
callback (result )
407
- }, requestOptions ); err != nil {
420
+ }, requestOptions , interactshURLs ); err != nil {
408
421
if errkit .IsNetworkPermanentErr (err ) {
409
422
// gologger.Verbose().Msgf("Could not execute request: %s\n", err)
410
423
return err
@@ -417,7 +430,7 @@ func (request *Request) ExecuteWithResults(target *contextargs.Context, dynamicV
417
430
}
418
431
}
419
432
}
420
- return request .executeRequestWithPayloads (hostPort , input , hostname , nil , payloadValues , callback , requestOptions )
433
+ return request .executeRequestWithPayloads (hostPort , input , hostname , nil , payloadValues , callback , requestOptions , interactshURLs )
421
434
}
422
435
423
436
func (request * Request ) executeRequestParallel (ctxParent context.Context , hostPort , hostname string , input * contextargs.Context , payloadValues map [string ]interface {}, callback protocols.OutputEventCallback ) {
@@ -469,7 +482,7 @@ func (request *Request) executeRequestParallel(ctxParent context.Context, hostPo
469
482
gotmatches .Store (true )
470
483
}
471
484
callback (result )
472
- }, requestOptions ); err != nil {
485
+ }, requestOptions , [] string {} ); err != nil {
473
486
if errkit .IsNetworkPermanentErr (err ) {
474
487
cancel (err )
475
488
return
@@ -490,7 +503,7 @@ func (request *Request) executeRequestParallel(ctxParent context.Context, hostPo
490
503
}
491
504
}
492
505
493
- func (request * Request ) executeRequestWithPayloads (hostPort string , input * contextargs.Context , _ string , payload map [string ]interface {}, previous output.InternalEvent , callback protocols.OutputEventCallback , requestOptions * protocols.ExecutorOptions ) error {
506
+ func (request * Request ) executeRequestWithPayloads (hostPort string , input * contextargs.Context , _ string , payload map [string ]interface {}, previous output.InternalEvent , callback protocols.OutputEventCallback , requestOptions * protocols.ExecutorOptions , interactshURLs [] string ) error {
494
507
payloadValues := generators .MergeMaps (payload , previous )
495
508
argsCopy , err := request .getArgsCopy (input , payloadValues , requestOptions , false )
496
509
if err != nil {
@@ -502,7 +515,6 @@ func (request *Request) executeRequestWithPayloads(hostPort string, input *conte
502
515
argsCopy .TemplateCtx = map [string ]interface {}{}
503
516
}
504
517
505
- var interactshURLs []string
506
518
if request .options .Interactsh != nil {
507
519
if argsCopy .Args != nil {
508
520
for k , v := range argsCopy .Args {
0 commit comments