首页 / NGINX / Nginx隐藏和伪造版本号
Nginx隐藏和伪造版本号
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Nginx隐藏和伪造版本号,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1638字,纯文字阅读大概需要3分钟。
内容图文
![Nginx隐藏和伪造版本号](/upload/InfoBanner/zyjiaocheng/945/92f6dfc377c549a790fa8fcb0762fe36.jpg)
1、默认使用curl命令访问:
# curl -I http://172.17.0.5
2、修改nginx.conf配置文件,在http配置段中新增如下代码:
# vim /usr/local/nginx/conf/nginx.conf
server_tokens off;
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
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隐藏和伪造版本号全部内容,希望文章能够帮你解决Nginx隐藏和伪造版本号所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。