Skip to content

Commit d82bfb0

Browse files
committed
Reorder params, fix up the transport termination
1 parent c41f4bd commit d82bfb0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/rex/payloads/meterpreter/config.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ def transport_block(opts)
6666

6767
# if the transport URI is for a HTTP payload we need to add a stack
6868
# of other stuff
69-
pack = 'VVVA*'
69+
pack = 'A*VVV'
7070
transport_data = [
71+
to_wchar_t(url, URL_SIZE), # transport URL
7172
opts[:comm_timeout], # communications timeout
7273
opts[:retry_total], # retry total time
73-
opts[:retry_wait], # retry wait time
74-
to_wchar_t(url, URL_SIZE) # transport URL
74+
opts[:retry_wait] # retry wait time
7575
]
7676

7777
if url.start_with?('http')
@@ -116,10 +116,11 @@ def config_block
116116
config << transport_block(t)
117117
end
118118

119-
# terminate the transports with a single NULL byte
120-
config << "\x00"
119+
# terminate the transports with NULL (wchar)
120+
config << "\x00\x00"
121121

122-
# configure the extensions
122+
# configure the extensions - this will have to change when posix comes
123+
# into play.
123124
file_extension = 'x86.dll'
124125
file_extension = 'x64.dll' unless is_x86?
125126

0 commit comments

Comments
 (0)