File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
ui/console/command_dispatcher Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,18 @@ def get_loaded_extension_commands(extension_name)
100
100
commands
101
101
end
102
102
103
+ def get_transport_timeouts
104
+ request = Packet . create_request ( 'core_transport_get_timeouts' )
105
+ response = client . send_request ( request )
106
+
107
+ {
108
+ :session_exp => response . get_tlv_value ( TLV_TYPE_TRANS_SESSION_EXP ) ,
109
+ :comm_timeout => response . get_tlv_value ( TLV_TYPE_TRANS_COMM_TIMEOUT ) ,
110
+ :retry_total => response . get_tlv_value ( TLV_TYPE_TRANS_RETRY_TOTAL ) ,
111
+ :retry_wait => response . get_tlv_value ( TLV_TYPE_TRANS_RETRY_WAIT )
112
+ }
113
+ end
114
+
103
115
#
104
116
# Loads a library on the remote meterpreter instance. This method
105
117
# supports loading both extension and non-extension libraries and
Original file line number Diff line number Diff line change 1
1
# -*- coding: binary -*-
2
2
require 'set'
3
+ require 'dotiw'
3
4
require 'rex/post/meterpreter'
4
5
require 'rex/parser/arguments'
5
6
@@ -58,6 +59,7 @@ def commands
58
59
"run" => "Executes a meterpreter script or Post module" ,
59
60
"bgrun" => "Executes a meterpreter script as a background thread" ,
60
61
"bgkill" => "Kills a background meterpreter script" ,
62
+ "get_timeouts" => "Kills a background meterpreter script" ,
61
63
"bglist" => "Lists running background scripts" ,
62
64
"write" => "Writes data to a channel" ,
63
65
"enable_unicode_encoding" => "Enables encoding of unicode strings" ,
@@ -322,6 +324,14 @@ def cmd_irb(*args)
322
324
Rex ::Ui ::Text ::IrbShell . new ( binding ) . run
323
325
end
324
326
327
+ def cmd_get_timeouts ( *args )
328
+ timeouts = client . core . get_transport_timeouts
329
+ print_line ( "Session Expiry : @ #{ ( Time . now + timeouts [ :session_exp ] ) . strftime ( '%Y-%m-%d %H:%M:%S' ) } " )
330
+ print_line ( "Comm Timeout : #{ timeouts [ :comm_timeout ] } seconds" )
331
+ print_line ( "Retry Total Time: #{ timeouts [ :retry_total ] } seconds" )
332
+ print_line ( "Retry Wait Time : #{ timeouts [ :retry_wait ] } seconds" )
333
+ end
334
+
325
335
#
326
336
# Get the machine ID of the target
327
337
#
You can’t perform that action at this time.
0 commit comments