Skip to content

Commit f843743

Browse files
committed
Adds fixes from @wchen-r7.
1 parent 017309d commit f843743

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/post/osx/gather/keylogger.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def initialize(info={})
5252
OptInt.new('SYNCWAIT',
5353
[ true, 'The time between transferring log chunks.', 10 ]
5454
),
55-
OptInt.new('LOGPORT',
55+
OptPort.new('LOGPORT',
5656
[ false, 'Local port opened for momentarily for log transfer', 22899 ]
5757
)
5858
]
@@ -73,7 +73,7 @@ def run_ruby_code
7373
print_status "Ruby process executing with pid #{rpid.to_i}"
7474
rpid.to_i
7575
else
76-
raise "Ruby keylogger command failed with error #{rpid}"
76+
fail_with(Exploit::Failure::Unknown, "Ruby keylogger command failed with error #{rpid}")
7777
end
7878
end
7979

@@ -84,6 +84,11 @@ def run
8484
return
8585
end
8686

87+
if datastore['DURATION'].to_i < 1
88+
print_error 'Invalid DURATION value.'
89+
return
90+
end
91+
8792
print_status "Executing ruby command to start keylogger process."
8893

8994
@port = datastore['LOGPORT'].to_i

0 commit comments

Comments
 (0)