From 2769d66bfcfe5d57cb4c59469e4ee031aac38ce0 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Mon, 5 Oct 2015 15:13:11 -0500 Subject: [PATCH] Check if the payload has a include_send_uuid method before calling it Otherwise we get an undefined method exception and the payload fails to stage. Fixes #6040 --- lib/msf/core/payload/stager.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/msf/core/payload/stager.rb b/lib/msf/core/payload/stager.rb index 9d61ab3dce..cf3e51a709 100644 --- a/lib/msf/core/payload/stager.rb +++ b/lib/msf/core/payload/stager.rb @@ -45,7 +45,7 @@ module Msf::Payload::Stager proto = 'http' end send("transport_config_#{direction}_#{proto}", opts) - end + end # # Sets the payload type to a stager. @@ -159,10 +159,12 @@ module Msf::Payload::Stager if (stage_over_connection?) opts = {} - if include_send_uuid - uuid_raw = conn.get_once(16, 1) - if uuid_raw - opts[:uuid] = Msf::Payload::UUID.new({raw: uuid_raw}) + if respond_to? :include_send_uuid + if include_send_uuid + uuid_raw = conn.get_once(16, 1) + if uuid_raw + opts[:uuid] = Msf::Payload::UUID.new({raw: uuid_raw}) + end end end