From e2f3cbe1aa132f0e4087672c6a0cc5bc8a83177e Mon Sep 17 00:00:00 2001 From: HD Moore Date: Sun, 6 Jan 2008 20:47:26 +0000 Subject: [PATCH] See #104 git-svn-id: file:///home/svn/framework3/trunk@5275 4d416f70-5f16-0410-b530-b9f4589650da --- data/msfweb/app/controllers/exploits_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/data/msfweb/app/controllers/exploits_controller.rb b/data/msfweb/app/controllers/exploits_controller.rb index c3f17c9285..e002c3d24d 100644 --- a/data/msfweb/app/controllers/exploits_controller.rb +++ b/data/msfweb/app/controllers/exploits_controller.rb @@ -43,7 +43,15 @@ def config # Always show the option page after an exploit is launched @cur_step = "config" - @payload_ref = @tmod.compatible_payloads[params[:payload].to_i] + if ( params[:payload] and 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 unless @payload_ref render_text "Unknown payload specified or not supported."