QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 6790|回复: 0
打印 上一主题 下一主题

如何叫你的apache不回显版本

[复制链接]
字体大小: 正常 放大
韩冰        

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2004-10-5 18:21 |只看该作者 |倒序浏览
|招呼Ta 关注Ta

作者:Yiming Gong3 A7 ~% I) s3 ]7 B http://security.zz.ha.cn

" A# d. p: w \4 z2 H: ?; N3 i

默认情况下apache是会给client端回显版本号码的,可以测试如下,在client端使用nc联接起着apache的目的主机80端口,发送错误的get请求

) N, Q4 }% f$ k7 q

yiming# nc security.zz.ha.cn 803 q5 T, ^3 H9 i9 V* I, x% Z) U get index.lakdsjf5 t& f. z& H+ Y2 X: _# M9 M) v% K! D <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">" j# a5 Z3 C1 i) | <html><head>, M3 }& [' ^0 v <title>400 Bad Request</title> , j' J, X& f1 d7 U# E+ i</head><body> & N0 V2 q' A; _6 ]& r' c' N<h1>Bad Request</h1> * l6 Z u7 n; {6 u' _4 \- c% t<p>Your browser sent a request that this server could not understand.<br /> & Z( L. l4 [& Q! |6 S</p>& Z, s. o* [7 c' w `' x8 s' d <hr /> r9 M5 ~; L% U( q$ E <address>Apache/x.y.z Server at security.zz.ha.cn Port 80</address> 4 A; }% q& ^3 c6 {</body></html>

9 o. @# x. P: r9 z, @; w

- ~2 }9 ~8 A. G3 `- I5 b$ K. V我们看到上面显示了apache的版本号(:) 俺隐去了真实版本),这可不太好,能修改一下么? . R$ x* R/ o5 W" l: u答案是肯定的! 9 _) B3 b. @9 f, U! Z* i改动apache的配置文件,找到ServerTokens和ServerSignature两个directive,修改默认属性: 6 _; e( G& T3 k7 \7 j* ]; Q: K- w. W如下

! d8 Q# U: q' w$ O

# and compiled in modules. 6 d. T T1 j( j0 D/ S#: m7 F7 T7 }1 x8 @; ]( T) W # ServerTokens 1 {8 x' Q/ X; c" A3 T. U) _# This directive configures what you return as the Server HTTP response+ q- `: J, R6 l+ d! M, A # Header. The default is 'Full' which sends information about the OS-Type 9 m( p7 \6 ~6 }9 i# and compiled in modules., r1 M) _8 G( m" y8 o' h, d # Set to one of: Full | OS | Minor | Minimal | Major | Prod3 [# T, S* b6 f # where Full conveys the most information, and Prod the least. & O. W/ w& Z: |4 B' f. o#* `4 A, q$ x8 n( e3 Z) t* G( I #ServerTokens Full 1 y7 S2 V4 l- M$ hServerTokens Prod

9 _, x; p+ t W/ U' w. c

#( {' s6 R7 x! k* H0 G9 H # Optionally add a line containing the server version and virtual host / f G- ^1 @4 z q5 `# name to server-generated pages (internal error documents, FTP directory 1 n! S B1 F, g2 ]! C# listings, mod_status and mod_info output etc., but not CGI generated + h! P" W& e- H4 [* K3 N# m& K9 [# documents or custom error documents).. O3 M3 Y; Y( m # Set to "EMail" to also include a mailt link to the ServerAdmin. ' ]2 E0 Z) ]% E( B# h( g% P+ O# Set to one of: On | Off | EMail 6 S: w% X6 h' k2 \! C6 u# ' B1 ^. @+ q/ |! WServerSignature On& p2 L& _' u7 Z1 O6 U ServerSignature Off

z; D& x) ~) t

修改后重起apache,再看看, " o4 i5 h9 z; j" h7 u! G$ S6 ?yiming# nc security.zz.ha.cn 80 : ~2 b u) W+ Jget index.lakdsjf u3 T+ h/ n) |- m <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">" T% e' l% c+ R0 i <html><head> + H% n& y( x# c0 @+ I<title>400 Bad Request</title> / ?5 a6 c6 X) q) A9 i</head><body>; P# f6 @ d! t( V3 ^ <h1>Bad Request</h1>. W7 G: Q+ P5 o) z# n: Q B <p>Your browser sent a request that this server could not understand.<br /> 1 h) r& v# _0 k0 i: P</p> 0 o1 d/ E2 M3 m- j: y+ t</body></html>

! D9 H; V9 I% _

0 e7 m& O- l5 q" ?: t" H

zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信
您需要登录后才可以回帖 登录 | 注册地址

qq
收缩
  • 电话咨询

  • 04714969085
fastpost

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2026-6-11 03:17 , Processed in 0.857018 second(s), 52 queries .

回顶部