下载安装最新的metasploit在meterpreter中运行shell命令总是不能成功,出现以下错误:
meterpreter > shell
[-] Failed to spawn shell with thread impersonation. Retrying without it.
[-] Error running command shell: ArgumentError wrong number of arguments (given 4, expected 5)
版本:metasploit v5.0.80-dev
经过研究发现github上部分rb脚本更新,而extensions中脚本未对应的修改引起的
解决办法:
修改
/opt/metasploit-framework/embedded/framework/lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb
将181行从streampool中new增加一个参数nil,新版的参数是5个,保存即可
# If we were creating a channel out of this
if (channel_id != nil)
channel = Rex::Post::Meterpreter::Channels::Pools::StreamPool.new(client,
channel_id, "stdapi_process", CHANNEL_FLAG_SYNCHRONOUS, nil)
end