在安装软件前,我们需要隐藏软件的版本号及版本其他信息,这样就大大提高了安全指数。
只隐藏版本号:
我们在主配置文件里:httpd.conf
[root@bqh-119 ~]# curl -i bbs.bqh123.com HTTP/1.1 200 OK Date: Tue, 16 Jul 2019 14:45:30 GMT Server: Apache/2.2.27 (Unix) DAV/2 #不隐藏的情况下,显示版本号及版本信息 Last-Modified: Sun, 14 Jul 2019 11:06:54 GMT ETag: "dff71-16-58da224263365" Accept-Ranges: bytes Content-Length: 22 Content-Type: text/html http://bbs.bqh123.com [root@bqh-119 ~]# echo -e "ServerTokens Prod ServerSignature Off" >>/application/apache/conf/httpd.conf [root@bqh-119 ~]# tail -2 /application/apache/conf/httpd.conf ServerTokens Prod ServerSignature Off [root@bqh-119 ~]# /application/apache/bin/apachectl -t Syntax OK [root@bqh-119 ~]# /application/apache/bin/apachectl graceful [root@bqh-119 ~]# curl -i bbs.bqh123.com HTTP/1.1 200 OK Date: Tue, 16 Jul 2019 15:19:04 GMT Server: Apache #版本号木有了 Last-Modified: Sun, 14 Jul 2019 11:06:54 GMT ETag: "dff71-16-58da224263365" Accept-Ranges: bytes Content-Length: 22 Content-Type: text/html http://bbs.bqh123.com
隐藏系统及版本信息:
编辑源文件中:
- vim apache2.2.27/include/ap_release.h
- vim httpd-2.2.27/os/unix/os.h
可以把里面的信息改成你想要的系统或版本
注:是在编译软件之前的操作!!!