标签:版本信息、显示、隐藏、nginx、tomcat apache tengine
nginx版本信息查询及隐藏
Apache版本信息查询及隐藏
php版本信息查询及隐藏
tengine版本信息查询及隐藏
tomcat版本信息查询及隐藏
[root@zhuima_nginx ~]# nginx -vnginx version: nginx/1.6.0
[root@zhuima_nginx ~]# nginx -V nginx version: nginx/1.6.0 built by gcc 4.4.7 20120313 (Red Hat4.4.7-4) (GCC) TLS SNI support enabledconfigure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6
[root@zhuima_client ~]# curl -I HTTP/1.1 200 OKServer: nginx/1.6.0 Date: S at, 19 Jul 2014 02:18:54 GMTContent-Type: text/html Content-Length: 16412 Last-Modified: Mon, 07 Jul 2014 05:25:22 G MT Connection: keep-alive Vary: Accept-Encoding ETag: "53ba2f42-401c" Accept-Ranges: bytes
修改nginx配置文件,在全局配置中添加server_tokens off; 这一行
[root@zhuima_nginx ~]#
[root@zhuima_nginx ~]# sed -n ‘/server_tokens/p‘ /usr/local/nginx/conf/nginx.conf
server_tokens off; # 在nginx全局配置文件中添加这行即可
[root@zhuima_nginx ~]#
重启nginx服务然后客户端验证效果
[root@zhuima_client ~]# curl -I http://218.244.xxx.xxx
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 19 Jul 2014 02:33:11 GMT
Content-Type: text/html
Content-Length: 16412
Last-Modified: Mon, 07 Jul 2014 05:25:22 GMT
Connection: keep-alive
Vary: Accept-Encoding
ETag: "53ba2f42-401c"
Accept-Ranges: bytes
apache版本信息查询
[root@zhuima_httpd ~]# apachectl -v
Server version: Apache/2.2.15 (Unix)
Server built: Apr 3 2014 23:56:16
[root@zhuima_httpd ~]#
apache编译参数查询
[root@zhuima_httpd ~]# apachectl -V
Server version: Apache/2.2.15 (Unix)
Server built: Apr 3 2014 23:56:16
Server‘s Module Magic Number: 20051115:25
Server loaded: APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture: 64-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="run/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
[root@zhuima_httpd ~]#
客户端验证apahce的Response Headers头信息
[root@zhuima_client ~]# curl -I http://192.168.xxx.xxx
HTTP/1.1 403 Forbidden
Date: Sat, 19 Jul 2014 02:41:02 GMT
Server: Apache/2.2.15 (CentOS)
Accept-Ranges: bytes
Content-Length: 5039
Connection: close
Content-Type: text/html; charset=UTF-8
在Apache配置文件中添加ServerTokens ProductOnly
#ServerTokens OS # 注释掉改行
Servertokens off # 添加这行屏蔽apache版本信息
ServerSignature Off # 添加这行屏蔽系统信息
重启httpd服务之后客户端再次验证
[root@zhuima_client ~]# curl -I http://192.168.xxx.xxx
HTTP/1.1 403 Forbidden
Date: Sat, 19 Jul 2014 02:47:21 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 5039
Connection: close
Content-Type: text/html; charset=UTF-8
显示的信息有:
在tengine配置文件中添加下面三项即可
server_tag off;
server_info off;
server_tokens off;
重启tengine服务再次进行验证
tomcat版本信息查询(新接手环境的时候很有必要查看的)
[root@zhuima_tomcat ~]$ catalina.sh version
...............................
Server version: Apache Tomcat/7.0.42
Server built: Jul 2 2013 08:57:41
Server number: 7.0.42.0
OS Name: Linux
OS Version: 2.6.32-431.el6.x86_64
Architecture: amd64
JVM Version: 1.7.0_09-b05
JVM Vendor: Oracle Corporation
客户端验证tomcat版本信息
隐藏tomcat版本信息
新的环境中尽可能多用help指令查看老的环境的部署
操作之前尽可能做的备份,要不然你懂得后果的
最主要的还是要了解并掌握大多数常用服务,要不然也是干瞪眼
本篇文章纯属扯淡,没啥技术含量
打完收工
本文出自 “追马” 博客,请务必保留此出处http://lovelace.blog.51cto.com/1028430/1440212
查看nginx | apache | php | tengine | tomcat版本的信息以及如何隐藏版本信息
标签:版本信息、显示、隐藏、nginx、tomcat apache tengine
原文地址:http://lovelace.blog.51cto.com/1028430/1440212