Beef 和 Nginx 安装过程这里就不再说明了
相关链接: Beef 官方安装教程
1. 修改 Beef 的 config.YAML 配置文件
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)
2. Nginx 配置域名并代理到 Beef
- 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;
- }
- }
3. 检查 nginx 配置文件并重启
- sudo nginx -t
- sudo nginx -s reload
4. 启动 Beef
./beef
5. 域名解析 A 记录到公网 IP
6.Beef 配置 https(这一步可以跳过)
这里设置成 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"
7. 访问域名, 完成!
来源: http://www.bubuko.com/infodetail-3327030.html