0
我喜欢这个网站,它通过其他人的问题帮助了我很多,现在我加入了,所以我可以帮助对方。在运行meterpreter的ruby脚本时出错
我在这里有一个问题。 在虚拟机中运行meterpreter(来自metasploit套件)时,我尝试了一个脚本来传递受感染计算机中的所有端口,并在本地计算机中创建一个虚拟接口。但我得到错误
Undefined method: each
。
虽然要去代码:
def discovery()
ip_port = []
# Alive hosts discovery
temphosts = []
hosts = []
## oldstdout = $stdout ## Trick for capturing stdout
$stdout = StringIO.new
client.run_cmd('run landiscovery')
temphosts = $stdout.string
$stdout = oldstdout
print_status "Alive Hosts:"
temphosts.each do |x|
if x.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/)
y = x.chomp
hosts << y
print " - #{y}\n"
end
end
end
我认为这是某种相关的行我与##
包围。它必须是nil
因此temphosts
也是nil
我也得到每个错误。
有人能指点我吗?
非常感谢。
PS:脚本,如果有人有兴趣在这里:http://tools.pentester.es/multirelay
再次感谢!
谢谢muriel!这工作。 – user1283604 2011-04-12 19:49:36