Add example usage to Msf::Exploit::Remote::SMBFileServer documentation

bug/bundler_fix
Matthew Hall 2014-03-12 17:07:27 +00:00
parent cec817902f
commit 9e2a483977
1 changed files with 20 additions and 0 deletions

View File

@ -795,6 +795,7 @@ end
# from a network share.
#
# Author: Matthew Hall <hallm [at] sec-1.com>
#
##
module Exploit::Remote::SMBFileServer
@ -812,6 +813,10 @@ module Exploit::Remote::SMBFileServer
@server = nil
end
# Clean up
#
# This will stop the SMB file server instance when handler is called
# @return [void]
def cleanup
begin
super
@ -820,6 +825,8 @@ module Exploit::Remote::SMBFileServer
end
end
##
#
# Start the SMBFileServer
#
# @param unc [String] The UNC path to expose by the server:
@ -830,6 +837,19 @@ module Exploit::Remote::SMBFileServer
# ie. myfile.extension
# @return [void]
# @raise [RuntimeError]
#
# Example Usage:
# include Msf::Exploit::Remote::SMBFileServer
# exe = generate_payload_dll
# @exe_file = rand_text_alpha(7) + ".dll"
# @share = rand_text_alpha(5)
# my_host = datastore['SRVHOST']
# @unc = "\\\\#{my_host}\\#{@share}\\#{@exe_file}"
# start_smb_server(@unc, exe, @exe_file)
# // Inject DLL
# handler
#
##
def start_smb_server(unc, contents, exe_file)
@server.stop if @server
vprint_status("Starting SMB Server on " + datastore['SRVHOST'].to_s + ":" + datastore['SRVPORT'].to_s)