Install and configure ufw
- Install the ufw package
apt install ufw
- Set the default ufw policies
ufw default deny incoming
ufw default allow outgoing
- Allow required traffic
Note
For the purpose of a basic Evilginx setup on a remote server we will allow ssh, dns, and https but add other services as necessary for your setup
ufw allow ssh
ufw allow 53
ufw allow https
- Enable the firewall
ufw enable
At this point your server has BASIC protections.