From 6720a57659c3397ed3d16b35463158b822b19165 Mon Sep 17 00:00:00 2001 From: wchen-r7 Date: Thu, 23 Jul 2015 01:34:44 -0500 Subject: [PATCH] Fix #5761, pass the correct arch and platform for exe generation Fix #5761 --- lib/msf/core/exploit/cmdstager.rb | 3 ++- modules/exploits/linux/http/fritzbox_echo_exec.rb | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/msf/core/exploit/cmdstager.rb b/lib/msf/core/exploit/cmdstager.rb index 865122bfb4..79998c7728 100644 --- a/lib/msf/core/exploit/cmdstager.rb +++ b/lib/msf/core/exploit/cmdstager.rb @@ -112,7 +112,8 @@ module Exploit::CmdStager def generate_cmdstager(opts = {}, pl = nil) select_cmdstager(opts) - self.exe = generate_payload_exe(:code => pl) + exe_opts = { code: pl }.merge!(opts) + self.exe = generate_payload_exe(exe_opts) if exe.nil? raise ArgumentError, 'The executable could not be generated' diff --git a/modules/exploits/linux/http/fritzbox_echo_exec.rb b/modules/exploits/linux/http/fritzbox_echo_exec.rb index 277b464beb..1d7fffe69d 100644 --- a/modules/exploits/linux/http/fritzbox_echo_exec.rb +++ b/modules/exploits/linux/http/fritzbox_echo_exec.rb @@ -108,10 +108,11 @@ class Metasploit3 < Msf::Exploit::Remote end print_status("#{peer} - Exploiting...") - execute_cmdstager( - :flavor => :echo, - :linemax => 92 + flavor: :echo, + linemax: 92, + platform: target.platform, + arch: target.arch ) end end