您当前的位置:网站首页>碎碎语>Nginx是如何隐藏和伪造版本号
Nginx是如何隐藏和伪造版本号
2023年02月02日
投稿作者:admin
围观人数:240
Nginx是如何隐藏和伪造版本号
1、默认使用curl命令访问:
#curl-Ihttp://172.17.0.5
2、修改nginx.conf配置文件,在http配置段中新增如下代码:
#vim/usr/local/nginx/conf/nginx.confserver_tokensoff;
3、修改fastcgi.conf配置文件,注释如下代码:
#vim/usr/local/nginx/conf/fastcgi.conffastcgi_paramSERVER_SOFTWAREnginx/$nginx_version;
4、重载Nginx:
#nginx-sreload
5、使用curl命令访问:
#curl-Ihttp://172.17.0.5
6、伪造Nginx的名称和版本号:
#vim/usr/src/nginx-1.16.1/src/core/nginx.h,修改如下代码#defineNGINX_VERSION"1.16.1"-->#defineNGINX_VERSION"2.3.2"#defineNGINX_VER"nginx/"NGINX_VERSION-->#defineNGINX_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&&makeinstall#cd/usr/local/nginx/conf#vimnginx.conf,删除之前新增的代码:server_tonkensoff;#nginx-sstop#nginx
7、使用curl命令访问:
#curl-Ihttp://172.17.0.5
总结
以上所述是小编给大家介绍的Nginx是如何隐藏和伪造版本号,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对17站长网的支持!
标签
版权说明
免责声明:本文文章内容由技术导航发布,但不代表本站的观点和立场,具体内容可自行甄别.