Metasploit meterpreter运行shell命令错误的解决办法 提示arguments (given 4, expected 5)

下载安装最新的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

 

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值