Files
metasploit-gs/lib/msf/core/exploit/fileformat.rb
T
Ruslaideemin cd64e3593c Fix UltraISO file creation
This makes file creation where datastore['FILENAME'] is not used when
a different filename is required, and ends up creating files in the
wrong place.
2013-06-09 12:37:34 +10:00

42 lines
813 B
Ruby

# -*- coding: binary -*-
###
#
# This module exposes a simple method to create a file.
#
###
module Msf
module Exploit::FILEFORMAT
include Msf::Auxiliary::Report
def initialize(info = {})
super
register_options(
[
OptString.new('FILENAME', [ false, 'The file name.', nil]),
], Msf::Exploit::FILEFORMAT
)
register_advanced_options(
[
OptBool.new('DisablePayloadHandler', [ false, "Disable the handler code for the selected payload", true ])
], Msf::Exploit::FILEFORMAT
)
end
def file_format_filename
datastore['FILENAME']
end
def file_create(data, filename = nil)
fname = filename || file_format_filename
ltype = "exploit.fileformat.#{self.shortname}"
full_path = store_local(ltype, nil, data, fname)
print_good "#{fname} stored at #{full_path}"
end
end
end