Files
metasploit-gs/lib/msf/core/exploit/fileformat.rb
T
HD Moore a8c9397419 Patch frmo antoine
git-svn-id: file:///home/svn/framework3/trunk@5994 4d416f70-5f16-0410-b530-b9f4589650da
2008-12-03 15:47:10 +00:00

32 lines
657 B
Ruby

###
#
# This module exposes a simple method to create a file.
#
###
module Msf
module Exploit::FILEFORMAT
def initialize(info = {})
super
register_options(
[
OptString.new('FILENAME', [ true, 'The file name.', 'MSF']),
OptString.new('OUTPUTPATH', [ true, 'The location of the file.', File.join(Msf::Config.install_root, 'data', 'exploits')]),
], Msf::Exploit::FILEFORMAT
)
def file_create(data)
fd = File.new("#{datastore['OUTPUTPATH']}/#{datastore['FILENAME']}","wb")
fd.puts data
fd.close
print_status("File '#{datastore['FILENAME']}' is located in '#{datastore['OUTPUTPATH']}' ...")
end
end
end
end