Nginx隐藏和伪造版本号
admin
2023-02-24 10:20:07
0

1、默认使用curl命令访问:

# curl -I http://172.17.0.5

Nginx隐藏和伪造版本号

2、修改nginx.conf配置文件,在http配置段中新增如下代码:

# vim /usr/local/nginx/conf/nginx.conf

server_tokens off;

Nginx隐藏和伪造版本号

3、修改fastcgi.conf配置文件,注释如下代码:

# vim /usr/local/nginx/conf/fastcgi.conf

fastcgi_param  SERVER_SOFTWARE  nginx/$nginx_version;

4、重载Nginx

# nginx -s reload

5、使用curl命令访问:

# curl -I http://172.17.0.5

Nginx隐藏和伪造版本号

6、伪造Nginx的名称和版本号:

# vim /usr/src/nginx-1.16.1/src/core/nginx.h,修改如下代码

#define NGINX_VERSION "1.16.1" --> #define NGINX_VERSION "2.3.2"

#define NGINX_VER "nginx/" NGINX_VERSION --> #define NGINX_VER "Tengine/" NGINX_VERSION

# cd /usr/src/nginx-1.16.1

# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-threads --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-stream_realip_module --with-stream_geoip_module --with-stream_ssl_preread_module --with-compat --with-pcre

# make && make install

# cd /usr/local/nginx/conf

# vim nginx.conf,删除之前新增的代码:server_tonkens off;

# nginx -s stop

# nginx

7、使用curl命令访问:

# curl -I http://172.17.0.5

Nginx隐藏和伪造版本号


相关内容

热门资讯

美媒:特朗普在结束伊朗战争问题... 据“国会山”网站5月6日报道,周二晚间,美国总统特朗普突然宣布终止旨在打破伊朗对霍尔木兹海峡掌控的军...
和创硅材料取得熔融石英制品擦洗... 国家知识产权局信息显示,东海县和创硅材料有限公司取得一项名为“一种熔融石英制品的擦洗脱泥装置”的专利...
美商务部长再就爱泼斯坦案接受国... 5月6日,美国商务部长卢特尼克“自愿”就其与爱泼斯坦的关系接受美国国会众议院监督与政府改革委员会的问...
“五一”小长假黄金零售市场新变... 【大河财立方 记者 孙凯杰】 “五一”小长假,黄金价格出现一波短暂调整,线下黄金零售市场热度如何?5...
以军3周来首次袭击黎巴嫩首都 据以色列总理内塔尼亚胡和国防部长卡茨当地时间5月6日晚发表的联合声明,以军当天对黎巴嫩首都贝鲁特南郊...
东莞移动:5G-A智擎护航, ... “五一”期间,松山湖草莓音乐节、广东国际汽车展示交易会·春季、2026茶园游会田园文化美食节、大岭山...
汉阳“知音数创”AI智能体创新... 4月30日,武汉市汉阳区数智产业推介会暨汉阳“知音数创”AI智能体创新大赛启动仪式在武汉基金产业基地...
伊朗最高领袖军事顾问:美国必须... 当地时间5月6日,伊朗最高领袖军事顾问穆赫辛·雷扎伊在接受采访时表示,伊朗不允许美国在不付出代价的情...
瑞士确诊、法国密接、西班牙待命... 综合法媒报道,国际探险邮轮“洪迪厄斯”号上的汉坦病毒事件,正从南美航程延伸至欧洲语境。最新进展显示,...
AMD锐龙X3D快到把游戏跑崩... 快科技5月6日消息,在Apex英雄最新Overclocked补丁中,修复了一个颇为尴尬的问题:AMD...