Nginx反向代理小记-附域名劫持案例

反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个反向代理服务器。

这里我们以Nginx为例,这里我的环境是ubuntu 16

修改配置文件进行代理(/etc/nginx/sites-available/default)

这里的目的是访问www.jumbojumbo.com实际上看到的是www.czjsy.com

我们测试下,可以看到没问题

现在我们想要替换其中的内容怎么办,添加如下参数

目的是把05001161替换成jumbo

添加完参数我们重启nginx会失败

通过上面的提示发现是我们的sub(s)_filter模块未安装,所以我们需要安装此模块

https://github.com/yaoweibin/ngx_http_substitutions_filter_module

./configure --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads --add-module=/usr/local/nginx-1.10.3/ngx_http_substitutions_filter_module

./configure –with-cc-opt=’-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2′ –with-ld-opt=’-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now’ –prefix=/usr/share/nginx –conf-path=/etc/nginx/nginx.conf –http-log-path=/var/log/nginx/access.log –error-log-path=/var/log/nginx/error.log –lock-path=/var/lock/nginx.lock –pid-path=/run/nginx.pid –http-client-body-temp-path=/var/lib/nginx/body –http-fastcgi-temp-path=/var/lib/nginx/fastcgi –http-proxy-temp-path=/var/lib/nginx/proxy –http-scgi-temp-path=/var/lib/nginx/scgi –http-uwsgi-temp-path=/var/lib/nginx/uwsgi –with-debug –with-pcre-jit –with-ipv6 –with-http_ssl_module –with-http_stub_status_module –with-http_realip_module –with-http_auth_request_module –with-http_addition_module –with-http_dav_module –with-http_geoip_module –with-http_gunzip_module –with-http_gzip_static_module –with-http_image_filter_module –with-http_v2_module –with-http_sub_module –with-http_xslt_module –with-stream –with-stream_ssl_module –with-mail –with-mail_ssl_module –with-threads –add-module=/usr/local/nginx-1.10.3/ngx_http_substitutions_filter_module

再次重启nginx即可

通过我们上面反向代理的介绍和整个实操,我们可以想到以下几点邪恶的想法:

1、替换关键词插入恶意js

2、抓包获取用户传入的所有内容,包括账号密码等。

未经允许不得转载(声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:net-net@foxmail.com进行举报,并提供相关证据,工作人员会在10个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。):策信智库资讯网 » Nginx反向代理小记-附域名劫持案例

赞 (0)
indian school girls porn videos tubexo.mobi school girls xvideo broken marriage vow march 22 full episode thepinoytv.net abot kamay na pangarap episode today افلام سكس هندي arabicpornmovies.com بنات محجبات سكس شاب ينكح اخته arabianporns.com قصص سكس سعودي سكس في الطيارة muarab.net سكس عربى واجنبى girls fucking videos freshpornclips.mobi xxx free download سكس بكارة porndot.info موقع افلام اباحية bengali sexy sex teenpornvideo.mobi chella kutty كسه 24pornos.com سكس قرد مع بنت punjabi randi sex nudevista.pro mia khalifa naked ashima bhalla bigassporntrends.com www.indianxx nude b grade indiananalfuck.com you pron xxx hinde vedio tubeofporn.mobi iwink tv kolkata girls need sex pornhindimovies.com indian xxx vidio saxy bf download pornborn.mobi co xxx