2007-01-31 00:08:52 +00:00
|
|
|
#
|
|
|
|
# Original version is Copyright (c) 2006 LMH <lmh[at]info-pull.com>
|
|
|
|
# Added to Metasploit under the terms of the Metasploit Framework License v1.2
|
|
|
|
# Additions Copyright (C) 2006-2007 Metasploit LLC
|
|
|
|
#
|
2006-09-28 05:27:20 +00:00
|
|
|
# Description: The main controller of msfweb v.3
|
2007-01-31 00:08:52 +00:00
|
|
|
#
|
2006-09-28 05:27:20 +00:00
|
|
|
|
2006-09-25 01:06:20 +00:00
|
|
|
class MsfController < ApplicationController
|
2006-09-28 05:27:20 +00:00
|
|
|
layout 'msfweb', :except => 'search'
|
2006-09-25 04:23:17 +00:00
|
|
|
|
2006-09-25 01:06:20 +00:00
|
|
|
def index
|
|
|
|
end
|
2006-09-28 05:27:20 +00:00
|
|
|
|
|
|
|
# Generic search function as suggested by HDM
|
|
|
|
def search
|
|
|
|
if params[:module_type]
|
|
|
|
@module_type = params[:module_type]
|
2006-10-16 03:23:39 +00:00
|
|
|
if params[:clean_list] and params[:clean_list].to_i == 1
|
|
|
|
@clean_list = true
|
|
|
|
else
|
|
|
|
@clean_list = false
|
|
|
|
end
|
2006-09-28 05:27:20 +00:00
|
|
|
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
|
2006-09-25 01:06:20 +00:00
|
|
|
|
|
|
|
end
|