使用Acunetix掃描我的Web應用程序後,結果顯示9個「在重定向頁面中找到HTML表單」的實例。 HTTP標題的重現性試驗攻擊如下:網站安全測試顯示Response.Redirect易受攻擊
Request
GET /entities/add HTTP/1.1
Pragma: no-cache
Referer: https://test.mysite.com/entities/view
Acunetix-Aspect: enabled
Acunetix-Aspect-Password: 082119f75623eb7abd7bf357698ff66c
Acunetix-Aspect-Queries: filelist;aspectalerts
Cookie: __AntiXsrfToken=97c0a6bb164d4121b07327df405f9db4; mysitecookie=
Host: test.mysite.com
Connection: Keep-alive
Accept-Encoding: gzip,deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Acunetix-Product: WVS/8.0 (Acunetix Web Vulnerability Scanner - NORMAL)
Acunetix-Scanning-agreement: Third Party Scanning PROHIBITED
Acunetix-User-agreement: http://www.acunetix.com/wvs/disc.htm
Accept: */*
Response
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=utf-8
Location: /login
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
Set-Cookie: mysitecookie=; expires=Mon, 11-Oct-1999 22:00:00 GMT; path=/; HttpOnly
X-Powered-By: ASP.NET
Date: Tue, 24 Sep 2013 10:38:12 GMT
Content-Length: 9447
響應的Location: /login
部分使我相信,如果我最終將用戶重定向到登錄頁面後的反應時,該漏洞就會被接通。所以我改變了這種代碼的所有實例:
protected void Page_Load(object sender, EventArgs e)
{
if (!HttpContext.Current.User.Identity.IsAuthenticated)
{
Response.Redirect("/login");
}
else
{
// etc
}
}
到:
protected void Page_Load(object sender, EventArgs e)
{
if (!HttpContext.Current.User.Identity.IsAuthenticated)
{
Response.Redirect("/login", true);
}
else
{
// etc
}
}
可能是什麼原因,它仍然顯示爲弱勢?
Acunetix有很多文檔。不要問這裏的人,你爲什麼不讀Acunetix文檔? http://www.acunetix.com/blog/web-security-zone/html-form-found-in-redirect-page/描述你的特定場景。這裏的理論問題是,您可能已經將* actual *頁面*與*一起重定向到登錄頁面。 – bzlm