我们的网站服务器最近经常被黑客攻击,我可以保护它
它是什么样的服务器? (Windows / Unix?)它是远程托pipe? 它运行的是什么应用程序? 你使用愚蠢的密码? 你在使用防火墙吗?
现在接近足够的信息,甚至开始帮助你!
找一个合格的pipe理员。 雇用,那是。
解雇你的无能的开发者并雇用合格的开发者。
支付某人为你做。
我可以给出三点build议:1.尽可能使用非标准端口。 使ssh使用端口3456和远程桌面使用4567例如。 2.使用长密码。 3.让一个程序监听端口80或端口21等标准端口。当某人连接到该端口时,logging该IP地址并将其从整个服务器中禁用。
下面是一个监听80端口的树莓派PHP网页的例子,并且禁止任何使用iptables连接到它的人:
要从php运行iptables,请将以下内容添加到/ etc / sudoers www-data ALL =(ALL)NOPASSWD:/ sbin / iptables
<?php // Get the ip address of the client. $remote_addr = $_SERVER['REMOTE_ADDR']; // Ban them. if (is_ip($remote_addr)) { ban_ip($remote_addr); // Save the banned IP address. $logfile = '/run/shm/banned.txt'; file_put_contents($logfile,$remote_addr."\n",FILE_APPEND); } // Returns true if $ip is a valid ip address. function is_ip($ip) { $count = strlen($ip); $valid = '0123456789.:'; for($loop=0;$loop<$count;$loop++) { if (strpos($valid,substr($ip,$loop,1))===false) { return false; } } return true; } // Bans an ip address. function ban_ip($ip) { $cmd = 'sudo /sbin/iptables -A INPUT -s ' . $ip . ' -j DROP'; exec($cmd); return; } ?>