client side for in-mem stuff

git-svn-id: file:///home/svn/incoming/trunk@2809 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Spoon M 2005-07-22 03:38:37 +00:00
parent 8e0efb818d
commit 4490a2a91f
1 changed files with 19 additions and 7 deletions

View File

@ -112,13 +112,6 @@ class Process < Rex::Post::Process
request = Packet.create_request('stdapi_sys_process_execute')
flags = 0
request.add_tlv(TLV_TYPE_PROCESS_PATH, path);
# If process arguments were supplied
if (arguments != nil)
request.add_tlv(TLV_TYPE_PROCESS_ARGUMENTS, arguments);
end
# If we were supplied optional arguments...
if (opts != nil)
if (opts['Hidden'])
@ -130,6 +123,25 @@ class Process < Rex::Post::Process
if (opts['Suspended'])
flags |= PROCESS_EXECUTE_FLAG_SUSPENDED
end
inmem = opts['InMemory']
if inmem
# add the file contents into the tlv
f = File.new(path, 'r')
request.add_tlv(TLV_TYPE_VALUE_DATA, f.read)
f.close
# replace the path with the "dummy"
path = inmem.kind_of?(String) ? inmem : 'cmd'
end
end
request.add_tlv(TLV_TYPE_PROCESS_PATH, path);
# If process arguments were supplied
if (arguments != nil)
request.add_tlv(TLV_TYPE_PROCESS_ARGUMENTS, arguments);
end
request.add_tlv(TLV_TYPE_PROCESS_FLAGS, flags);