From 585fac045751fca2fbb10578642d401136a9af5c Mon Sep 17 00:00:00 2001 From: William Vu Date: Sun, 30 Apr 2017 03:43:51 -0500 Subject: [PATCH] Fix nil bug when creating nonexistent encoder Found by irthewinner on IRC. --- lib/msf/core/payload_generator.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/msf/core/payload_generator.rb b/lib/msf/core/payload_generator.rb index 02d3ebb248..c8a3e0629f 100644 --- a/lib/msf/core/payload_generator.rb +++ b/lib/msf/core/payload_generator.rb @@ -411,6 +411,10 @@ module Msf # Allow comma separated list of encoders so users can choose several encoder.split(',').each do |chosen_encoder| e = framework.encoders.create(chosen_encoder) + if e.nil? + cli_print "Skipping invalid encoder #{chosen_encoder}" + next + end e.datastore.import_options_from_hash(datastore) encoders << e if e end