a8c9397419
git-svn-id: file:///home/svn/framework3/trunk@5994 4d416f70-5f16-0410-b530-b9f4589650da
32 lines
657 B
Ruby
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
|