<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[Lighttpd、Nginx 、Apache 隐藏响应头信息的Server信息，apache和php的版本信息]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 07 Dec 2010 01:59:13 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	Lighttpd、Nginx 、Apache 隐藏响应头信息的Server信息，apache和php的版本信息<br/>web服务器的版本信息<br/><br/>一、隐藏Apache信息<br/>默认情况下，很多Apache安装时会显示版本号及操作系统版本，甚至会显示服务器上安装的是什么样的Apache模块。这些信息可以为黑客所用，并且黑客还可以从中得知你所配置的服务器上的很多设置都是默认状态。<br/><br/>这里有两条语句，需要添加到httpd.conf文件中：<br/><br/>ServerSignature Off<br/><br/>ServerTokens Prod<br/><br/>ServerSignature出现在Apache所产生的像404页面、目录列表等页面的底部。ServerTokens目录被用来判断Apache会在Server HTTP响应包的头部填充什么信息。如果把ServerTokens设为Prod，那么HTTP响应包头就会被设置成：<br/><br/>Server：Apache<br/><br/>二、隐藏PHP信息<br/>修改php.ini<br/><br/>将expose_php On<br/>改为<br/>expose_php Off<br/><br/><br/><br/><br/><br/>参考解决方案：<br/><br/>1. Lighttpd 1.4.20<br/>src/response.c:108 改为：<br/>buffer_append_string_len(b, CONST_STR_LEN(&quot;Server: jufukeji&quot;));<br/>输出 Header：<br/>HTTP/1.1 404 Not Found<br/>Content-Type: text/html<br/>Content-Length: 345<br/>Date: Mon, 12 Jan 2009 13:54:02 GMT<br/>Server: jufukeji<br/><br/>2. Nginx 0.7.30<br/>src/http/ngx_http_header_filter_module.c:48-49 改为：<br/>static char ngx_http_server_string[] = &quot;Server: jufukeji&quot; CRLF;<br/>static char ngx_http_server_full_string[] = &quot;Server: jufukeji&quot; CRLF;<br/>输出 Header：<br/>HTTP/1.1 200 OK<br/>Server: jufukeji<br/>Date: Mon, 12 Jan 2009 14:01:10 GMT<br/>Content-Type: text/html<br/>Content-Length: 151<br/>Last-Modified: Mon, 12 Jan 2009 14:00:56 GMT<br/>Connection: keep-alive<br/>Accept-Ranges: bytes<br/><br/>3. Cherokee 0.11.6<br/>cherokee/version.c:93 添加：<br/>ret = cherokee_buffer_add_str (buf, &quot;jufukeji&quot;);<br/>return ret;<br/>输出 Header：<br/>HTTP/1.1 200 OK<br/>Connection: Keep-Alive<br/>Keep-Alive: timeout=15<br/>Date: Mon, 12 Jan 2009 14:54:39 GMT<br/>Server: jufukeji<br/>ETag: 496b54af=703<br/>Last-Modified: Mon, 12 Jan 2009 14:33:19 GMT<br/>Content-Type: text/html<br/>Content-Length: 1795<br/><br/>4. Apache 2.2.11<br/>server/core.c:2784 添加：<br/>ap_add_version_component(pconf, &quot;jufukeji&quot;);<br/>return;<br/>输出 Header：<br/>HTTP/1.1 200 OK<br/>Date: Mon, 12 Jan 2009 14:28:10 GMT<br/>Server: jufukeji<br/>Last-Modified: Sat, 20 Nov 2004 20:16:24 GMT<br/>ETag: &quot;1920edd-2c-3e9564c23b600&quot;<br/>Accept-Ranges: bytes<br/>Content-Length: 44<br/>Content-Type: text/html<br/><br/>5. Squid 3.0 STABLE 11<br/>src/globals.cc:58 改为：<br/>const char *const full_appname_string = &quot;jufukeji&quot;;<br/>输出 Header：<br/>HTTP/1.0 400 Bad Request<br/>Server: jufukeji<br/>Mime-Version: 1.0<br/>Date: Mon, 12 Jan 2009 15:25:15 GMT<br/>Content-Type: text/html<br/>Content-Length: 1553<br/>Expires: Mon, 12 Jan 2009 15:25:15 GMT<br/>X-Squid-Error: ERR_INVALID_URL 0<br/>X-Cache: MISS from &#039;cache.hutuworm.org&#039;<br/>Via: 1.0 &#039;cache.hutuworm.org&#039; (jufukeji)<br/>Proxy-Connection: close<br/><br/>6. Tomcat 6.0.18<br/>java/org/apache/coyote/http11/Constants.java:56 和 java/org/apache/coyote/ajp/Constants.java:236 均改为：<br/>ByteChunk.convertToBytes(&quot;Server: jufukeji&quot; + CRLF);<br/>输出 Header：<br/>HTTP/1.1 200 OK<br/>Server: jufukeji<br/>ETag: W/&quot;7857-1216684872000&quot;<br/>Last-Modified: Tue, 22 Jul 2008 00:01:12 GMT<br/>Content-Type: text/html<br/>Content-Length: 7857<br/>Date: Mon, 12 Jan 2009 16:30:44 GMT<br/><br/>7. JBoss 5.0.0 GA<br/>a. tomcat/src/resources/web.xml:40 改为<br/>jufukeji<br/>b. 下载 JBoss Web Server 2.1.1.GA srctar （http://www.jboss.org/jbossweb/downloads/jboss-web/）<br/>java/org/apache/coyote/http11/Constants.java:56 和 java/org/apache/coyote/ajp/Constants.java:236 均改为：<br/>ByteChunk.convertToBytes(&quot;Server: jufukeji&quot; + CRLF);<br/>将编译所得 jbossweb.jar 覆盖 JBoss 编译输出文件：<br/>JBOSS_SRC/build/output/jboss-5.0.0.GA/server/all/deploy/jbossweb.sar/jbossweb.jar<br/>JBOSS_SRC/build/output/jboss-5.0.0.GA/server/standard/deploy/jbossweb.sar/jbossweb.jar<br/>JBOSS_SRC/build/output/jboss-5.0.0.GA/server/default/deploy/jbossweb.sar/jbossweb.jar<br/>JBOSS_SRC/build/output/jboss-5.0.0.GA/server/web/deploy/jbossweb.sar/jbossweb.jar<br/>输出 Header：<br/>HTTP/1.1 200 OK<br/>Server: jufukeji<br/>X-Powered-By: jufukeji<br/>Accept-Ranges: bytes<br/>ETag: W/&quot;1581-1231842222000&quot;<br/>Last-Modified: Tue, 13 Jan 2009 10:23:42 GMT<br/>Content-Type: text/html<br/>Content-Length: 1581<br/>Date: Tue, 13 Jan 2009 10:30:42 GM<br/>来源：http://thorlst.blog.163.com/blog/static/59275749201041214838661/
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] Lighttpd、Nginx 、Apache 隐藏响应头信息的Server信息，apache和php的版本信息]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>