File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
modules/payloads/stages/linux/x86 Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ def generate_windows_stub(process)
659
659
# This should be done by the reflective loader payloads
660
660
#else
661
661
# # Just patch the timeouts, which are consistent on each of the payloads.
662
- # Rex::Payloads::Meterpreter::Patch.patch_passive_service !(blob,
662
+ # Rex::Payloads::Meterpreter::Patch.patch_timeouts !(blob,
663
663
# :expiration => self.client.expiration,
664
664
# :comm_timeout => self.client.comm_timeout,
665
665
# :retry_total => self.client.retry_total,
@@ -675,6 +675,12 @@ def generate_linux_stub
675
675
f . read ( f . stat . size )
676
676
}
677
677
678
+ Rex ::Payloads ::Meterpreter ::Patch . patch_timeouts! ( blob ,
679
+ :expiration => self . client . expiration ,
680
+ :comm_timeout => self . client . comm_timeout ,
681
+ :retry_total => self . client . retry_total ,
682
+ :retry_wait => self . client . retry_wait )
683
+
678
684
blob
679
685
end
680
686
Original file line number Diff line number Diff line change 8
8
require 'msf/base/sessions/meterpreter_options'
9
9
require 'rex/elfparsey'
10
10
11
+ # Provides methods to patch options into the metsrv stager.
12
+ require 'rex/payloads/meterpreter/patch'
13
+
11
14
module Metasploit3
12
15
include Msf ::Sessions ::MeterpreterOptions
13
16
@@ -100,10 +103,16 @@ def generate_stage
100
103
#file = File.join(Msf::Config.data_directory, "msflinker_linux_x86.elf")
101
104
file = File . join ( Msf ::Config . data_directory , "meterpreter" , "msflinker_linux_x86.bin" )
102
105
103
- met = File . open ( file , "rb" ) { |f |
106
+ blob = File . open ( file , "rb" ) { |f |
104
107
f . read ( f . stat . size )
105
108
}
106
109
107
- return met
110
+ Rex ::Payloads ::Meterpreter ::Patch . patch_timeouts! ( blob ,
111
+ :expiration => datastore [ 'SessionExpirationTimeout' ] . to_i ,
112
+ :comm_timeout => datastore [ 'SessionCommunicationTimeout' ] . to_i ,
113
+ :retry_total => datastore [ 'SessionRetryTotal' ] . to_i ,
114
+ :retry_wait => datastore [ 'SessionRetryWait' ] . to_i )
115
+
116
+ return blob
108
117
end
109
118
end
You can’t perform that action at this time.
0 commit comments