Support interactsh payloads in baseURL

dev
Ice3man543 2021-05-03 14:31:44 +05:30
parent 6a4f3e1336
commit 8394e696ca
1 changed files with 3 additions and 4 deletions

View File

@ -60,10 +60,6 @@ func (r *requestGenerator) Make(baseURL string, dynamicValues map[string]interfa
parsed.Path = strings.TrimSuffix(parsed.Path, "/") parsed.Path = strings.TrimSuffix(parsed.Path, "/")
} }
parsedString := parsed.String() parsedString := parsed.String()
if interactURL != "" {
parsedString = r.options.Interactsh.ReplaceMarkers(parsedString, interactURL)
}
values["BaseURL"] = parsedString values["BaseURL"] = parsedString
// If data contains \n it's a raw request, process it like raw. Else // 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 // 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) { func (r *requestGenerator) makeHTTPRequestFromModel(ctx context.Context, data string, values map[string]interface{}, interactURL string) (*generatedRequest, error) {
final := replacer.Replace(data, values) final := replacer.Replace(data, values)
if interactURL != "" {
final = r.options.Interactsh.ReplaceMarkers(final, interactURL)
}
// Build a request on the specified URL // Build a request on the specified URL
req, err := http.NewRequestWithContext(ctx, r.request.Method, final, nil) req, err := http.NewRequestWithContext(ctx, r.request.Method, final, nil)