[点晴永久免费OA]Windows Server服务器IIS管理器被检测到会话cookie中缺少HttpOnly属性漏洞,如何解决?
				
									
					
					
						 | 
						
							
							admin 
							
							
								2022年9月26日 10:4
								本文热度 3883
							
							 
						 | 
					
					
				 
				通过配置出站规则getcookie添加HttpOnly
在网站根目录下找到文件“Web.config”,在其中添加如下出站规则:
- 
 - 
 - 
        <rule name="Add HttpOnly"> 
 - 
            <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" /> 
 - 
 - 
                <add input="{R:0}" pattern="; HttpOnly" negate="true" /> 
 - 
 - 
            <action type="Rewrite" value="{R:0}; HttpOnly" /> 
 - 
 - 
 - 
            <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" /> 
 - 
 - 
                <add input="{R:0}" pattern="; Secure" negate="true" /> 
 - 
 - 
            <action type="Rewrite" value="{R:0}; Secure" /> 
 - 
 - 
 - 
 
添加完成后图示

测试结果

搞定!
	
	
该文章在 2022/9/26 10:04:22 编辑过
 
 |  | 
全部评论1 | 
	 | 
	
		admin 
		2022年9月26日 10:28 
		
			rewrite放置位置参考(代码不是上面的,不要照抄!): 
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="root_location_rewrite" stopProcessing="true">
  		<match ignoreCase="false" url="."/>
  		<conditions logicalGrouping="MatchAll">
    		<add ignoreCase="false" input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
    		<add ignoreCase="false" input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/> 
  		</conditions>
  		<action appendQueryString="true" type="Rewrite" url="index.php?{QUERY_STRING}"/>
                </rule>
                <rule name="default_file_rewrite" stopProcessing="true">
  		<match ignoreCase="false" url="^$"/>
  		<action appendQueryString="true" type="Rewrite" url="index.php?{QUERY_STRING}"/>
  		</rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration> 该评论在 2022/9/26 10:37:31 编辑过 
		 
	 |