444 字
2 分钟
Hiding the VIPER Panel with Cloudflare Argo

What is a Cloudflare Argo Tunnel Argo Tunnel provides a secure way to expose web servers to the Internet without opening firewall ports or configuring ACLs. Argo Tunnel also ensures that requests are routed through Cloudflare before reaching your origin web server, ensuring that attack traffic is stopped by Cloudflare’s WAF and Unmetered DDoS mitigation, and can be authenticated through Access if enabled on the account.

Why use Argo instead of a normal CDN? Because using a CDN requires opening port 60000 in the security group, and leaks the IP address of the C&C server, increasing the risk of being traced back. With ArgoTunnel, there’s no need to open the backend port. Plus you get an official Cloudflare certificate.

Also, Cloudflare now routes through the Hong Kong node by default, so access from mainland China isn’t slow either.

Why did I go this route? Actually, at first I just wanted to hide the panel, so I used the host to install nginx as a reverse proxy, but it was too much hassle. Eventually I remembered that Argo can avoid opening ports, bind a domain, and hide the address, so I jumped on Argo right away.

Configuring VIPER#

Because viper uses a self-signed certificate, forwarding directly to https://127.0.0.1:60000 won’t work—it will throw a certificate error. So first you need to enter the container to modify the nginx config, turn off SSL, and switch to http.

Terminal window
docker ps #Check container name
docker exec -i -t viper-c /bin/bash
#The following operations are inside the container
cd /root/viper/Docker/
nano viper.conf

Use Ctrl+Shift+_ to jump to line 7.

.......
server {
include /root/viper/Docker/nginxconfig/viper.conf;
ssl off; #Change this from on to off
ssl_certificate /root/viper/Docker/nginxconfig/server.crt;
.......

Finally, remember to reload nginx’s config so the changes take effect.

Terminal window
nginx -s reload
exit #Exit the container

Configuring Argo#

Installation#

Cloudflared is the software that connects your origin server to the Cloudflare Argo Server.

You can refer to the documentation here.

Official documentation Docs

Github Release Downloads

Configuring the Tunnel#

Terminal window
cloudflared tunnel login #First log in, and select the example.com domain
cloudflared tunnel create viper
cloudflared tunnel route dns viper vip #Through the vip tunnel, automatically add a CNAME record pointing to vip.example.com in Cloudflare

Verifying the Tunnel Configuration#

Start the tunnel to test it. If there are no problems, continue.

Terminal window
cloudflared tunnel --name viper --url http://127.0.0.1:60000

Then you can visit vip.example.com to check the result. If there are no problems, continue. Starting the tunnel this way is only a temporary measure, so we need to make it persistent.

Making Argo Persistent#

First run cloudflared tunnel list to note down the Tunnel ID.

Terminal window
sudo cloudflared service install
nano /etc/cloudflared/config.yml

Write it as follows, changing whatever needs changing

tunnel: <Tunnel-UUID>
credentials-file: /root/.cloudflared/<Tunnel-UUID>.json
ingress:
- hostname: vip.example.com
service: http://127.0.0.1:60000
- service: http_status:404

Restart the cloudflared service

Terminal window
sudo systemctl restart cloudflared && sudo systemctl enable cloudflared
Hiding the VIPER Panel with Cloudflare Argo
https://tski.uk/blog/en/viper-via-cloudflare-argo/
作者
Tokisaki Galaxy
发布于
2021-11-14
许可协议
CC BY