从 Metasploit 控制台运行后search name:SSH
,控制台自行关闭。现在,每当我尝试在 Metasploit 中运行最基本的命令时,我都会收到内存不足错误,如下所示:
RHOST 95.138.166.176
/usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``': Cannot allocate memory - stty 4500:5:bf:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 (Errno::ENOMEM)
from /usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/gems/activesupport-4.0.13/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
from /usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/gems/rb-readline-r7-0.5.2.0/lib/rbreadline.rb:7069:in `block in rl_deprep_terminal'
from /usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/gems/rb-readline-r7-0.5.2.0/lib/rbreadline.rb:6912:in `retry_if_interrupted'
from /usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/gems/rb-readline-r7-0.5.2.0/lib/rbreadline.rb:7068:in `rl_deprep_terminal'
from /usr/share/metasploit-framework/vendor/bundle/ruby/2.2.0/gems/rb-readline-r7-0.5.2.0/lib/rbreadline.rb:1512:in `rl_cleanup_after_signal'
from /usr/share/metasploit-framework/lib/rex/ui/text/input/readline.rb:134:in `rescue in readline_with_output'
from /usr/share/metasploit-framework/lib/rex/ui/text/input/readline.rb:131:in `readline_with_output'
from /usr/share/metasploit-framework/lib/rex/ui/text/input/readline.rb:86:in `pgets'
from /usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:187:in `run'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
from /usr/bin/msfconsole:48:in `<main>'
free -h
输出以下内容:
total used free shared buff/cache available
Mem: 2.0G 1.7G 42M 15M 222M 228M
Swap: 1.3G 1.3G 164K
但我如何进一步分解它,看看究竟是什么在使用所有这些内存?我目前只打开了四个终端窗口和一个浏览器,关闭浏览器窗口中的选项卡似乎没有任何改善。
答案1
Ran:ps aux --sort -rss
这向我展示了导致问题的原因。尽管虚拟机被列为单个进程很烦人,因为它占用了超过 90% 的 CPU 使用率。