Skip to content

Commit 2d1bc9b

Browse files
committed
Land rapid7#4346 - Msfvenom should pass the datastore to encoders too
2 parents 776bad9 + d74a8f6 commit 2d1bc9b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/msf/core/payload_generator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,12 +309,14 @@ def get_encoders
309309
# Allow comma seperated list of encoders so users can choose several
310310
encoder.split(',').each do |chosen_encoder|
311311
e = framework.encoders.create(chosen_encoder)
312+
e.datastore.import_options_from_hash(datastore)
312313
encoders << e if e
313314
end
314315
encoders.sort_by { |my_encoder| my_encoder.rank }.reverse
315316
elsif badchars.present?
316317
framework.encoders.each_module_ranked('Arch' => [arch], 'Platform' => platform_list) do |name, mod|
317318
e = framework.encoders.create(name)
319+
e.datastore.import_options_from_hash(datastore)
318320
encoders << e if e
319321
end
320322
encoders.sort_by { |my_encoder| my_encoder.rank }.reverse

0 commit comments

Comments
 (0)