我正在恢复一个服务器被黑客攻击,有一件事我不能修复:
当我ssh(或scp)到服务器,不pipe我给的密码,它让我login。我不太了解ssh协议,但我很确定它不应该这样做。
我检查了sshd_config文件,唯一的变化是我所做的(据我记忆)。
另一个想法是,我可能会在/ etc / passwd文件中丢失某些东西。 有没有人看过这个?
这听起来像是你的服务器上有一个修改的SSH二进制集,我会build议运行rkhunter和/或chkrootkit,如果有任何后门安装,如果有任何被发现,我会build议读取它们并清理它们。
还要检查你的根帐户历史logging,看看发生了什么,如果攻击者留下任何痕迹。
你也可以通过你的软件包pipe理器(rpm / apt-get或任何第三个软件包pipe理器)重新安装SSH软件包(或任何其他可能被利用的软件包),以便用默认的二进制代码replace二进制文件,重新运行rkhunter,看看有没有仍然是任何比赛。
最后,您可以检查哪些软件包修改了文件,这是基于RPM的系统的一个例子:
以下命令将列出RPM包的所有更改:
rpm -qa | xargs rpm --verify --nomtime | less
如果validation失败,则会显示哪部分失败:
c %config configuration file
d %doc documentation file
g %ghost file (ie the file contents are not included in the package payload).
l %license license file.
r %readme readme file.
S file Size differs
M Mode differs (includes permissions and file type)
5 MD5 sum differs
D Device major/minor number mismatch
L readLink(2) path mismatch
U User ownership differs
G Group ownership differs
T mTime differs
以上是来自RPM手册 – http://www.rpm.org/max-rpm/s1-rpm-verify-output.html
另一个解决scheme是在备份时间允许的情况下备份您的数据并重新安装系统,因为您现在似乎处于紧张的状态。