一般情况下,软件的漏洞信息和特定版本,特定操作系统是相关的,因此,软件的版本号以及操作系统类型对攻击者来说是很有价值的。

在默认情况下,Tomcat会在返回信息中把自身的版本号,操作系统类型都显示出来,如下图:

这样做会造成潜在的安全风险,导致不必要的攻击行为。

在Ubuntu 14.04系统上隐藏Tomcat-7.0.52的版本号与操作系统类型的方法如下:

$ cd ~

$ mkdir catalina

$ cd catalina

$ cp /usr/share/tomcat7/lib/catalina.jar .

$ unzip catalina.jar

$ cd org/apache/catalina/util

$ vim ServerInfo.properties

1

2

3

4

5

6

7

8

9

10

11

12

13

$cd~

$mkdircatalina

$cdcatalina

$cp/usr/share/tomcat7/lib/catalina.jar.

$unzipcatalina.jar

$cdorg/apache/catalina/util

$vimServerInfo.properties

可以看到里面的内容如下:

# Licensed to the Apache Software Foundation (ASF) under one or more

# contributor license agreements. See the NOTICE file distributed with

# this work for additional information regarding copyright ownership.

# The ASF licenses this file to You under the Apache License, Version 2.0

# (the "License"); you may not use this file except in compliance with

# the License. You may obtain a copy of the License at

#

# http://www.apache.org/licenses/LICENSE-2.0

#

# Unless required by applicable law or agreed to in writing, software

# distributed under the License is distributed on an "AS IS" BASIS,

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

# See the License for the specific language governing permissions and

# limitations under the License.

server.info=Apache Tomcat/7.0.52 (Ubuntu)

server.number=7.0.52.0

server.built=Jun 30 2016 01:59:37

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

#LicensedtotheApacheSoftwareFoundation(ASF)underoneormore

#contributorlicenseagreements.SeetheNOTICEfiledistributedwith

#thisworkforadditionalinformationregardingcopyrightownership.

#TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0

#(the"License");youmaynotusethisfileexceptincompliancewith

#theLicense.YoumayobtainacopyoftheLicenseat

#

#http://www.apache.org/licenses/LICENSE-2.0

#

#Unlessrequiredbyapplicablelaworagreedtoinwriting,software

#distributedundertheLicenseisdistributedonan"AS IS"BASIS,

#WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.

#SeetheLicenseforthespecificlanguagegoverningpermissionsand

#limitationsundertheLicense.

server.info=ApacheTomcat/7.0.52(Ubuntu)

server.number=7.0.52.0

server.built=Jun30201601:59:37

直接注释掉里面的内容,如下:

# Licensed to the Apache Software Foundation (ASF) under one or more

# contributor license agreements. See the NOTICE file distributed with

# this work for additional information regarding copyright ownership.

# The ASF licenses this file to You under the Apache License, Version 2.0

# (the "License"); you may not use this file except in compliance with

# the License. You may obtain a copy of the License at

#

# http://www.apache.org/licenses/LICENSE-2.0

#

# Unless required by applicable law or agreed to in writing, software

# distributed under the License is distributed on an "AS IS" BASIS,

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

# See the License for the specific language governing permissions and

# limitations under the License.

# server.info=Apache Tomcat/7.0.52 (Ubuntu)

# server.number=7.0.52.0

# server.built=Jun 30 2016 01:59:37

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

#LicensedtotheApacheSoftwareFoundation(ASF)underoneormore

#contributorlicenseagreements.SeetheNOTICEfiledistributedwith

#thisworkforadditionalinformationregardingcopyrightownership.

#TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0

#(the"License");youmaynotusethisfileexceptincompliancewith

#theLicense.YoumayobtainacopyoftheLicenseat

#

#http://www.apache.org/licenses/LICENSE-2.0

#

#Unlessrequiredbyapplicablelaworagreedtoinwriting,software

#distributedundertheLicenseisdistributedonan"AS IS"BASIS,

#WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.

#SeetheLicenseforthespecificlanguagegoverningpermissionsand

#limitationsundertheLicense.

#server.info=ApacheTomcat/7.0.52(Ubuntu)

#server.number=7.0.52.0

#server.built=Jun30201601:59:37

修改完成后,把修改完成的数据存储到catalina.jar中。

$ cd ~

$ cd catalina

$ jar uvf catalina.jar org/apache/catalina/util/ServerInfo.properties

1

2

3

4

5

$cd~

$cdcatalina

$jaruvfcatalina.jarorg/apache/catalina/util/ServerInfo.properties

把修改后的catalina.jar放回到Tomcat的目录下面:

$ cd ~

$ cd catalina

$ sudo unlink /usr/share/tomcat7/lib/catalina.jar

$ sudo mv /usr/share/java/catalina.jar /usr/share/java/catalina.jar.old

$ sudo cp catalina.jar /usr/share/java/

$ sudo chmod +r /usr/share/java/catalina.jar

$ cd /usr/share/tomcat7/lib

$ sudo ln -s ../../java/catalina.jar catalina.jar

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

$cd~

$cdcatalina

$sudounlink/usr/share/tomcat7/lib/catalina.jar

$sudomv/usr/share/java/catalina.jar/usr/share/java/catalina.jar.old

$sudocpcatalina.jar/usr/share/java/

$sudochmod+r/usr/share/java/catalina.jar

$cd/usr/share/tomcat7/lib

$sudoln-s../../java/catalina.jarcatalina.jar

重启Tomcat的服务

$ sudo service tomcat7 restart

1

$sudoservicetomcat7restart

修改后的结果如下图所示,已经没有系统类型信息了,仅仅返回了一个404错误。

linux隐藏tomcat版本_Ubuntu 14.04隐藏Tomcat-7.0.52的版本号与操作系统类型相关推荐

  1. linux kde 桌面发行,KDE 桌面发行版本 Kubuntu 14.04 LTS

    我们一般都把注意力集中在 Ubuntu 官方默认版本,即正统版本,默认使用 Unity 桌面的版本身上,而忽略了其他桌面的版本,其实Ubuntu是一个庞大的家族,今天发布的包括麒麟在内就有5个. 其中 ...

  2. ubuntu 单显卡 风扇特别响_Ubuntu 14.04风扇不停转,风扇狂转 的解决办法,亲测有效。...

    Ubuntu 14.04风扇不停转,风扇狂转 的解决办法,亲测有效. 原文  http://ubuntuforums.org/showthread.php?t=2218367 楼主说:ubuntu 1 ...

  3. linux+4.4+android,Ubuntu 14.04 x64配置Android 4.4 kitkat编译环境的方法

    Ubuntu 14.04 x64配置Android 4.4 kitkat编译环境的方法跟Ubuntu 12.04 - 13.10 以及jellybean编译环境配置没多大区别, 顺便记录下而已: 64 ...

  4. linux 关闭桌面环境,Ubuntu 14.04上的Cinnamon桌面环境PPA被关闭

    今天Cinnamon桌面环境的开发者宣布关闭Cinnamon桌面环境的PPA,这意味着以后在Ubuntu上安装Cinnamon桌面环境将变得很难. 关于为什么要关闭PPA,Cinnamon PPA的维 ...

  5. ubuntu进去安全模式_ubuntu 14.04全攻略

    因为种种原因,需要重做系统. 之前的系统是ubuntu 14.04,搭建了java,php的开发环境,并有oracle,mysql的测试库,用的oracle 的vmbox虚拟机,ide用的是eclip ...

  6. linux安装特定版本软件,ubuntu16.04通过apt-get安装指定版本和查询指定软件有多少个版本...

    一.通过apt-get安装指定版本 apt-get install <>=<> 举例: apt-get install mysql-server=5.7.11-0ubuntu6 ...

  7. visual studio 最新稳定版本_Ubuntu 20.04 LTS 第一个小版本更新 20.04.1发布

    2020 年 08 月 06 日,Ubuntu 团队发布了长期支持版本 Ubuntu 20.04 TLS 的第一个小版本更新 - Ubuntu 20.04.1 TLS. 该版本像往常一样,该版本包含了 ...

  8. ubuntu linux kvm安装,基于Ubuntu 14.04 KVM拟化安装部署

    1. 宿主机环境(dell备份服务器) Ubuntu 14.04 LTS 64位 内存:16G 硬盘:2T 2. 确认CPU是否支持硬件虚拟化 root@linuxidc:~# egrep -o '( ...

  9. ubutun 更换网络源_Ubuntu 14.04用户修改更新源和替换软件源的方法

    给Ubuntu 14.04 LTS已经正式发布了,下面说下修改软件源.更新源的方法,一方面是升级出现问题,另一方面是官方的源对于国内用户来说比较慢,因为对unity桌面不熟悉,还是这里说一下.老鸟就不 ...

最新文章

  1. php 信号量 关闭,PHP信号量基本用法实例详解
  2. mysql和Oracle 备份表
  3. OpenCV跟踪支持的实例(附完整源代码)
  4. python的三元运算
  5. jdbc mysql驱动_MySQL JDBC驱动程序如何处理准备好的语句
  6. include.cpp(main函数的cpp文件)文件中包含另一个.cpp文件的错误及原因
  7. adsl 路由器默认密码
  8. 实验一 框架的选择及其原因
  9. eap方法 华为手机怎么连wifi_如何手动连接802.1x EAP证书加密WIFI
  10. 计算机硬件码修改软件,电脑机器码,教您电脑机器码修改软件
  11. XILINX DDR3 VIVADO(二)写模块
  12. Qt QString 增、删、改、查、格式化等常用方法总结
  13. 测试udp服务的端口是否可用
  14. 2018王鼎杯-fakebook-详细解说
  15. 不同页面 共享cookie及localStorage
  16. 西方文化笔记——CDUTYB版
  17. Pixhawk学习5.2——传感器标定之陀螺仪
  18. 2023年高新技术企业申报要点,建议收藏
  19. 3D画图软件测试自学,【2人回答】我想学习3D画图 请大家推荐几款好入门的软件-3D溜溜网...
  20. 拼多多无货源————新店的运营和上货助手

热门文章

  1. 贪婪洞窟2服务器维护,《贪婪洞窟2》11月30日更新维护多久 贪婪洞窟2更新维护公告...
  2. c语言scanf函数隐藏的缓冲区,零基础学C语言 笔记四 Scanf函数清除缓冲区
  3. vc6.0mfc中单选按钮如何分组_按钮系列02-搞定按钮和选框的14个秘诀
  4. mysql数据库基础简介_MySql数据库基础之数据库简介及安装
  5. 怎么看电脑的hdmi是输出还是输入_高清hdmi矩阵切换器4进4出音视频方案介绍景阳华泰科技...
  6. c 包含其他文件_C语言:全局变量在多个c文件中公用的方法!
  7. 【OpenCV 例程200篇】13. 图像的加法运算(cv2.add)
  8. SQL Server 2008R2安装详细教程(附安装包)
  9. 15-[JavaScript]-ECMAScript 1
  10. 接口_简单get接口_第一个接口