diff --git a/data/msfweb/app/views/exploits/list.rhtml b/data/msfweb/app/views/exploits/list.rhtml
index 70455f07f7..24c237d047 100644
--- a/data/msfweb/app/views/exploits/list.rhtml
+++ b/data/msfweb/app/views/exploits/list.rhtml
@@ -6,9 +6,11 @@
- <% @all_exploits.each do |m| %>
+ <% @all_exploits.each_index do |i|
+ m = @all_exploits[i]
+ %>
- <%= m.name %> |
+ <%= m.name %> |
<%= m.description %> |
<% end %>
diff --git a/data/msfweb/app/views/exploits/view.rhtml b/data/msfweb/app/views/exploits/view.rhtml
index 418be57953..b52d08ab9e 100644
--- a/data/msfweb/app/views/exploits/view.rhtml
+++ b/data/msfweb/app/views/exploits/view.rhtml
@@ -1,11 +1,7 @@
<%
- modinst = nil
- modname = params[:id].gsub(':', '/')
-
- @all_exploits.each do |m|
- modinst = m if m.refname == modname
- end
+ modidx = (params[:id] || 0).to_i
+ modinst = @all_exploits[modidx]
%>
diff --git a/data/msfweb/app/views/payloads/list.rhtml b/data/msfweb/app/views/payloads/list.rhtml
index 2e058c648a..6b82af3e4a 100644
--- a/data/msfweb/app/views/payloads/list.rhtml
+++ b/data/msfweb/app/views/payloads/list.rhtml
@@ -6,9 +6,11 @@
- <% @all_payloads.each do |m| %>
+ <% @all_payloads.each_index do |i|
+ m = @all_payloads[i]
+ %>
- <%= m.name %> |
+ <%= m.name %> |
<%= m.description %> |
<% end %>
diff --git a/data/msfweb/app/views/payloads/view.rhtml b/data/msfweb/app/views/payloads/view.rhtml
index 9f063062bc..7205e3136f 100644
--- a/data/msfweb/app/views/payloads/view.rhtml
+++ b/data/msfweb/app/views/payloads/view.rhtml
@@ -1,11 +1,7 @@
<%
- modinst = nil
- modname = params[:id].gsub(':', '/')
-
- @all_payloads.each do |m|
- modinst = m if m.refname == modname
- end
+ modidx = (params[:id] || 0).to_i
+ modinst = @all_payloads[modidx]
%>