From 8394e696ca34cba12a10f2199c4a48922094f0e6 Mon Sep 17 00:00:00 2001 From: Ice3man543 Date: Mon, 3 May 2021 14:31:44 +0530 Subject: [PATCH] Support interactsh payloads in baseURL --- v2/pkg/protocols/http/build_request.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/v2/pkg/protocols/http/build_request.go b/v2/pkg/protocols/http/build_request.go index c040e6dd..8b082378 100644 --- a/v2/pkg/protocols/http/build_request.go +++ b/v2/pkg/protocols/http/build_request.go @@ -60,10 +60,6 @@ func (r *requestGenerator) Make(baseURL string, dynamicValues map[string]interfa parsed.Path = strings.TrimSuffix(parsed.Path, "/") } parsedString := parsed.String() - - if interactURL != "" { - parsedString = r.options.Interactsh.ReplaceMarkers(parsedString, interactURL) - } values["BaseURL"] = parsedString // If data contains \n it's a raw request, process it like raw. Else @@ -102,6 +98,9 @@ func baseURLWithTemplatePrefs(data string, parsed *url.URL) (string, *url.URL) { // MakeHTTPRequestFromModel creates a *http.Request from a request template func (r *requestGenerator) makeHTTPRequestFromModel(ctx context.Context, data string, values map[string]interface{}, interactURL string) (*generatedRequest, error) { final := replacer.Replace(data, values) + if interactURL != "" { + final = r.options.Interactsh.ReplaceMarkers(final, interactURL) + } // Build a request on the specified URL req, err := http.NewRequestWithContext(ctx, r.request.Method, final, nil)