RSS   



  可打印版本 | 推薦給朋友 | 訂閱主題 | 收藏主題 | 純文字版  


 


 
主題: [轉貼]如何不讓 apache 洩漏你 server 的資訊?   字型大小:||| 
swchen
鐵驢友〔中級〕
等級: 5等級: 5


今日心情

 . 積分: 57
 . 精華: 1
 . 文章: 205
 . 收花: 260 支
 . 送花: 455 支
 . 比例: 1.75
 . 在線: 1102 小時
 . 瀏覽: 10520 頁
 . 註冊: 8007
 . 失蹤: 1
#1 : 2005-11-23 10:53 AM     只看本作者 引言回覆

版主 MU : 感謝您的無私分享

評分:+3   
1. 在 httpd.conf 任意位置加入一行
代碼:
ServerTokens Prod

註:ServerTokens 的參數有 Min[imal], OS, Prod[uctOnly], Full 四種

2. 重新啟動 apache 就可以了


以下是在 httpd.conf 中的設定值,及 Apache 在 header 的回應

ServerTokens Full
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12 OpenSSL/0.9.6b PHP/4.1.2

ServerTokens OS
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux)

ServerTokens Min
Server: Apache/1.3.27

ServerTokens Prod
Server: Apache

所以設定成 ServerTokens Prod 應該是比較好的選擇


參考
http://www.apacheref.com/ref/http_core/ServerTokens.html

Apache Reference: http_core, ServerTokens

ServerTokens
Control Tokens Displayed in HTTP Server Header Field
Syntax: ServerTokens A
Example: ServerTokens min
Since: Apache 1.3

This directive controls whether the HTTP Server response header field, which is sent back to clients, includes a description of the generic operating system type of the server (if type is ``os'') as well as information about compiled-in modules (if type is ``full''). With a type of ``min'', only the server version is included. This setting applies to the entire server, and it cannot be enabled or disabled on a per- virtual-host basis.


建議再加上 ServerSignature Email
或 ServerSignature Off

*ServerSignature On
用法:ServerSignature 選項
(可用的選項有︰On,Off 以及 Email)

ServerSignature 指令用來選擇,當 Apache/2 遇到如錯誤訊息等情形而產生一份
告知使用者目前情形的網頁時,是否要附加上一些提示使用者的資訊。
如果設定為 "Off",就是除了內定告知使用者的資訊以外,不再附加其他資訊。
如果設定為 "On",則表示在該網頁加上 ServerName 指令所指定的伺服器名稱;
如果設定為 "Email",則在該告知網頁上,附加 ServerAdmin 後面所指定的電子郵件位址。

如果有使用 php 的話
建議再修改 php.ini
改 expose_php (預設是 On)
expose_php = Off

; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header). It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
;expose_php = On



[如果你喜歡本文章,就按本文章之鮮花~送花給作者吧,你的支持就是別人的動力來源]
本文連接  
檢閱個人資料  發私人訊息  Blog  快速回覆 新增/修改 爬文標記
Vic
開墾隊隊長.苦力
等級: 32等級: 32等級: 32等級: 32等級: 32等級: 32等級: 32等級: 32
老得不能再稱小的熊

十週年紀念徽章(五級)   終生苦力熊勳章  

今日心情

 . 積分: 9409
 . 精華: 28
 . 文章: 9949
 . 收花: 79214 支
 . 送花: 10986 支
 . 比例: 0.14
 . 在線: 2902 小時
 . 瀏覽: 187021 頁
 . 註冊: 8019
 . 失蹤: 28
 . 大熊國
#2 : 2005-11-24 03:50 PM     只看本作者 引言回覆

呵呵~ 我知道有些apache server 故意將自己ServerTokens 改成 IIS


[如果你喜歡本文章,就按本文章之鮮花~送花給作者吧,你的支持就是別人的動力來源]
本文連接  
檢閱個人資料  訪問主頁  發私人訊息  Blog  快速回覆 新增/修改 爬文標記
innova
銀驢友〔高級〕
等級: 14等級: 14等級: 14等級: 14


十週年紀念徽章(五級)  

今日心情

 . 積分: 916
 . 文章: 2714
 . 收花: 7188 支
 . 送花: 1461 支
 . 比例: 0.2
 . 在線: 2182 小時
 . 瀏覽: 15182 頁
 . 註冊: 6973
 . 失蹤: 4
 . 火星
#3 : 2006-2-5 01:46 PM     只看本作者 引言回覆

sendmail 有辦法如法泡製嗎?


引用:
# telnet 210.22.188.87 25
Trying 210.22.188.87...
Connected to quantacn.com (210.22.188.87).
Escape character is '^]'.
220 ironport-c30.QUANTACN.com ESMTP
help
214-The following commands are recognized
214-    auth    data    ehlo    helo
214-    help    mail    noop    quit
214     rcpt    rset    vrfy
quit
221 ironport-c30.QUANTACN.com
Connection closed by foreign host.

# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.myhost.com.tw ESMTP Sendmail 8.13.4/8.13.4; Sun, 5 Feb 2006 12:08:50 +0800
Connection closed by foreign host.



[如果你喜歡本文章,就按本文章之鮮花~送花給作者吧,你的支持就是別人的動力來源]
本文連接  
檢閱個人資料  訪問主頁  發私人訊息  Blog  快速回覆 新增/修改 爬文標記

   

快速回覆
表情符號

更多 Smilies

字型大小 : |||      [完成後可按 Ctrl+Enter 發佈]        

溫馨提示:本區開放遊客瀏覽。
選項:
關閉 URL 識別    關閉 表情符號    關閉 Discuz! 代碼    使用個人簽名    接收新回覆信件通知
發表時自動複製內容   [立即複製] (IE only)


 



所在時區為 GMT+8, 現在時間是 2024-5-5 06:00 PM
清除 Cookies - 連絡我們 - TWed2k © 2001-2046 - 純文字版 - 說明
Discuz! 0.1 | Processed in 0.021411 second(s), 7 queries , Qzip disabled