25.04.2017, 16:26
You cannot prevent it, you can only hope to mitigate the effects. If you're on Linux and you haven't configured iptables then you should do so immediately. By default all ports are open, which is not what you want. You want to create a few "accept" rules on the input chain and drop anything you don't need. The first rule should allow everything on the lo0 interface (localhost traffic), the second rule should allow established or related traffic (state), the following rules should allow the traffic to the "service" ports. So 7777 for your server and 22 for SSH. The last rule should drop all the traffic that didn't match any of the previous rules. Careful though: if you make a mistake you may lock yourself out and if you don't have VNC then you're screwed until your server restarts (rules, by default, are not persistent).