Files
metasploit-gs/lib/msf/core/post/common.rb
T
Carlos Perez a237122869 for Java version of Meterpreter options can not be included with the command, they have to be given apart updating mixin for this behavior
git-svn-id: file:///home/svn/framework3/trunk@11581 4d416f70-5f16-0410-b530-b9f4589650da
2011-01-15 05:08:42 +00:00

22 lines
493 B
Ruby

module Msf
class Post
module Common
# Execute given command as hidden and channelized, output of command given as a multiline string.
# For certain versions of Meterpreter options can not be included in the cmd var
def cmd_exec(cmd,opts = nil)
session.response_timeout=120
cmd = session.sys.process.execute(cmd, opts, {'Hidden' => true, 'Channelized' => true})
o = ""
while(d = cmd.channel.read)
o << d
break if d == ""
end
cmd.channel.close
return o
end
end
end
end