Beef和Nginx安装过程这里就不再说明了
相关链接:Beef官方安装教程
xss连接地址改成要绑定的域名
sudo vim /beef/config.yaml
# HTTP server
http:
host: "0.0.0.0" # Beef地址
port: "3000" # Beef端口
public: "example.com" # xss后门回连地址
public_port: "" # xss后门回连端口(默认80)
sudo vim /etc/nginx/nginx.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name example.com; # 绑定域名
# 将Beef代理到 在127.0.0.1:3000上监听的服务
location / {
proxy_pass http://127.0.0.1:3000;
}
}
sudo nginx -t
sudo nginx -s reload
./beef
这里设置成https以后,nginx也需要配置成https!
sudo vim /beef/config.yaml
# HTTP server
http:
https:
enable: true
key: "/etc/letsencrypt/live/example.com/privkey.pem"
cert: "/etc/letsencrypt/live/example.com/fullchain.pem"
原文:https://www.cnblogs.com/waw/p/12024730.html