Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用ASP.NET表单身份验证,如果新的身份验证cookie被盗,它是否可以在其他PC上使用?_C#_Asp.net_Vb.net_Security - Fatal编程技术网

C# 使用ASP.NET表单身份验证,如果新的身份验证cookie被盗,它是否可以在其他PC上使用?

C# 使用ASP.NET表单身份验证,如果新的身份验证cookie被盗,它是否可以在其他PC上使用?,c#,asp.net,vb.net,security,C#,Asp.net,Vb.net,Security,如果攻击者将SetAuthCookie调用中放置的身份验证cookie从受害者PC复制到他们的PC上,是否会认为攻击者已通过web应用程序的身份验证 public static void SetAuthCookie( string userName, bool createPersistentCookie ) 使用标准表单身份验证FormsAuthentication.SetAuthCookie和参数createPersistentCookie=false 假设这适用于web配

如果攻击者将SetAuthCookie调用中放置的身份验证cookie从受害者PC复制到他们的PC上,是否会认为攻击者已通过web应用程序的身份验证

public static void SetAuthCookie(
    string userName,
    bool createPersistentCookie
)
使用标准表单身份验证FormsAuthentication.SetAuthCookie和参数createPersistentCookie=false

假设这适用于web配置设置

<authentication mode="Forms">
    <forms name="MyWebApp" path="/" loginUrl="~/Default.aspx"
     timeout="30" defaultUrl="~/Default.aspx" protection="All"
     requireSSL="true" />       
</authentication>

是;ASP.Net未在身份验证Cookie中包含IP地址。(这甚至对共享WiFi或代理都没有帮助)

但是,由于您拥有
requireSSL=“true”
,攻击者(原则上)将无法获取该cookie。(除非他们可以访问服务器或客户机,在这种情况下,您会遇到更大的问题)

这就是为什么您应该始终使用SSL