温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Nginx如何隐藏和伪造版本号

发布时间:2021-08-21 11:06:16 来源:亿速云 阅读:159 作者:小新 栏目:服务器

这篇文章给大家分享的是有关Nginx如何隐藏和伪造版本号的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

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如何隐藏和伪造版本号

感谢各位的阅读!关于“Nginx如何隐藏和伪造版本号”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI