Skip to content

Commit 5964d36

Browse files
committed
Fix a syntax error
Also uses a prettier syntax for setting the filename (ternary operators are hard to read).
1 parent 95b0d4e commit 5964d36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/exploits/windows/smb/psexec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def initialize(info = {})
8383
[
8484
OptBool.new('DB_REPORT_AUTH', [true, "Report an auth_note upon a successful connection", true]),
8585
OptBool.new('MOF_UPLOAD_METHOD', [true, "Use WBEM instead of RPC, ADMIN$ share will be mandatory. ( Not compatible with Vista+ )", false]),
86-
OptString.new('SERVICE_FILENAME', [false, "Filename to to be used on target for the service binary",nil)
86+
OptString.new('SERVICE_FILENAME', [false, "Filename to to be used on target for the service binary",nil])
8787
], self.class)
8888
end
8989

@@ -125,7 +125,7 @@ def exploit
125125
report_auth_info(report_hash)
126126
end
127127

128-
filename = datastore['SERVICE_FILENAME'] ? datastore['SERVICE_FILENAME'] : rand_text_alpha(8) + ".exe"
128+
filename = datastore['SERVICE_FILENAME'] || "#{rand_text_alpha(8)}.exe"
129129

130130
if datastore['MOF_UPLOAD_METHOD']
131131
# payload as exe

0 commit comments

Comments
 (0)