Sha256: ff420f2036086b8077d6745b8335924be17a6b5a8376265d6ebb4a994585ba5b

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env ruby

require 'bundler/setup'
require 'metasploit/aggregator'
require 'metasploit/aggregator/cable'
require 'metasploit/aggregator/logger'

admin_host = '127.0.0.1'
admin_port = 2447
# cert_file = './cert.pem'
# cert_string = File.new(cert_file).read
cert_string = nil

server = Metasploit::Aggregator::GrpcServer.new(admin_host, admin_port)
Logger.log "Starting administration service on #{admin_host}:#{admin_port}"

loop do
  command = $stdin.gets
  if command.chomp == 'exit'
    exit
  elsif command.chomp == 'pause'
    Logger.log "paused"
  elsif command.chomp == 'stop'
    server.stop
  elsif command.chomp == 'park'
    client.release_session($stdin.gets.chomp)
  elsif command.chomp == 'details'
    client = Metasploit::Aggregator::ServerProxy.new(admin_host, admin_port)
    sessions = client.sessions
    sessions.each_pair do |payload, console|
      details = client.session_details(payload)
      $stdout.puts payload
      details.each_pair do |key, attr|
        $stdout.print "\t"
        $stdout.print "#{key}:"
        $stdout.puts "#{attr}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metasploit-aggregator-0.2.1 bin/metasploit-aggregator
metasploit-aggregator-0.2.0 bin/metasploit-aggregator
metasploit-aggregator-0.1.3 bin/metasploit-aggregator