Complete services GET

GSoC/Meterpreter_Web_Console
James Barnett 2018-02-20 14:41:49 -06:00
parent bbd25fc97b
commit 3c9092f9a6
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
2 changed files with 5 additions and 1 deletions

View File

@ -16,7 +16,7 @@ module ServiceServlet
def self.get_services
lambda {
begin
opts = parse_json_request(request, false)
opts = params.symbolize_keys
data = get_db().services(opts[:workspace],
opts[:only_up],
opts[:proto],

View File

@ -117,6 +117,10 @@ module Msf::DBManager::Service
# Returns a list of all services in the database
def services(wspace = workspace, only_up = false, proto = nil, addresses = nil, ports = nil, names = nil)
if wspace.kind_of? String
wspace = find_workspace(wspace)
end
::ActiveRecord::Base.connection_pool.with_connection {
conditions = {}
conditions[:state] = [Msf::ServiceState::Open] if only_up