Files
metasploit-gs/data/msfweb/app/controllers/msf_controller.rb
T
lmh 7cda7a29ed Implemented clean lists for the search results (stripped down, etc). Changed start page of IDE.
git-svn-id: file:///home/svn/framework3/trunk@4031 4d416f70-5f16-0410-b530-b9f4589650da
2006-10-16 03:23:39 +00:00

43 lines
1.1 KiB
Ruby

# Author: L.M.H <lmh@info-pull.com>
# Description: The main controller of msfweb v.3
class MsfController < ApplicationController
layout 'msfweb', :except => 'search'
def index
end
# Generic search function as suggested by HDM
def search
if params[:module_type]
@module_type = params[:module_type]
if params[:clean_list] and params[:clean_list].to_i == 1
@clean_list = true
else
@clean_list = false
end
if params[:terms]
case @module_type
when 'exploits'
@results = search_modules(Exploit.find_all(), params[:terms])
when 'auxiliaries'
@results = search_modules(Auxiliary.find_all(), params[:terms])
when 'payloads'
@results = search_modules(Payload.find_all(), params[:terms])
when 'nops'
@results = search_modules(Nop.find_all(), params[:terms])
when 'encoders'
@results = search_modules(Encoder.find_all(), params[:terms])
else
render_text "Module type unknown."
end
else
render_text "No search terms provided."
end
else
render_text "Module type not specified."
end
end
end