From 7123cce773dd5e2ffdda29efc5e7bb2a67dd15a4 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Sun, 6 Jan 2008 20:55:07 +0000 Subject: [PATCH] Fixes #104 git-svn-id: file:///home/svn/framework3/trunk@5277 4d416f70-5f16-0410-b530-b9f4589650da --- .../app/controllers/exploits_controller.rb | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/data/msfweb/app/controllers/exploits_controller.rb b/data/msfweb/app/controllers/exploits_controller.rb index e002c3d24d..11eab7a9e1 100644 --- a/data/msfweb/app/controllers/exploits_controller.rb +++ b/data/msfweb/app/controllers/exploits_controller.rb @@ -37,21 +37,26 @@ def config @cur_step = params[:step] end - - if @cur_step == "exploit" - - # Always show the option page after an exploit is launched - @cur_step = "config" - - if ( params[:payload] and params[:payload] =~ /^\d+$/ ) + + if (params[:payload]) + + if (params[:payload] =~ /^\d+$/ ) @payload_ref = @tmod.compatible_payloads[params[:payload].to_i] else @tmod.compatible_payloads.each_with_index do |ref, i| + if(ref[0] == params[:payload]) @payload_ref = ref end end end + end + + + if @cur_step == "exploit" + + # Always show the option page after an exploit is launched + @cur_step = "config" unless @payload_ref render_text "Unknown payload specified or not supported." @@ -102,8 +107,6 @@ def config if @cur_step == "config" - @payload_ref = @tmod.compatible_payloads[params[:payload].to_i] - unless @payload_ref render_text "Unknown payload specified or not supported." end