Land #15493, Rails 6.1 upgrade

This commit is contained in:
adfoster-r7 2021-08-10 11:49:25 +01:00 committed by GitHub
commit fedcdc386b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
47 changed files with 392 additions and 381 deletions

View File

@ -1,10 +1,10 @@
PATH
remote: .
specs:
metasploit-framework (6.0.57)
actionpack (~> 5.2.2)
activerecord (~> 5.2.2)
activesupport (~> 5.2.2)
metasploit-framework (6.1.0)
actionpack (~> 6.0)
activerecord (~> 6.0)
activesupport (~> 6.0)
aws-sdk-ec2
aws-sdk-iam
aws-sdk-s3
@ -20,17 +20,17 @@ PATH
faraday
faye-websocket
filesize
hrr_rb_ssh (= 0.3.0.pre2)
hrr_rb_ssh-ed25519
http-cookie
irb
jsobfu
json
metasm
metasploit-concern (~> 3.0.0)
metasploit-credential (~> 4.0.0)
metasploit-model (~> 3.1.0)
metasploit-concern
metasploit-credential
metasploit-model
metasploit-payloads (= 2.0.50)
metasploit_data_models (~> 4.1.0)
metasploit_data_models
metasploit_payloads-mettle (= 1.0.10)
mqtt
msgpack
@ -94,34 +94,33 @@ GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.3.2)
actionview (= 6.1.3.2)
activesupport (= 6.1.3.2)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.6)
activesupport (= 5.2.6)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.1.3.2)
activesupport (= 6.1.3.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activemodel (5.2.6)
activesupport (= 5.2.6)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activesupport (5.2.6)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activemodel (6.1.3.2)
activesupport (= 6.1.3.2)
activerecord (6.1.3.2)
activemodel (= 6.1.3.2)
activesupport (= 6.1.3.2)
activesupport (6.1.3.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
afm (0.2.2)
arel (9.0.0)
arel-helpers (2.12.0)
activerecord (>= 3.1.0, < 7)
ast (2.4.2)
@ -207,8 +206,10 @@ GEM
filesize (0.2.0)
fivemat (1.3.7)
hashery (2.1.2)
hrr_rb_ssh (0.3.0.pre2)
hrr_rb_ssh (0.4.2)
hrr_rb_ssh-ed25519 (0.4.2)
ed25519 (~> 1.2)
hrr_rb_ssh (>= 0.4)
http-cookie (1.0.4)
domain_name (~> 0.5)
http_parser.rb (0.7.0)
@ -226,33 +227,33 @@ GEM
nokogiri (>= 1.5.9)
memory_profiler (1.0.0)
metasm (1.0.5)
metasploit-concern (3.0.2)
activemodel (~> 5.2.2)
activesupport (~> 5.2.2)
railties (~> 5.2.2)
metasploit-credential (4.0.5)
metasploit-concern (4.0.2)
activemodel (~> 6.0)
activesupport (~> 6.0)
railties (~> 6.0)
metasploit-credential (5.0.3)
metasploit-concern
metasploit-model
metasploit_data_models (>= 3.0.0)
metasploit_data_models (>= 5.0.0)
net-ssh
pg
railties
rex-socket
rubyntlm
rubyzip
metasploit-model (3.1.4)
activemodel (~> 5.2.2)
activesupport (~> 5.2.2)
railties (~> 5.2.2)
metasploit-model (4.0.2)
activemodel (~> 6.0)
activesupport (~> 6.0)
railties (~> 6.0)
metasploit-payloads (2.0.50)
metasploit_data_models (4.1.4)
activerecord (~> 5.2.2)
activesupport (~> 5.2.2)
metasploit_data_models (5.0.3)
activerecord (~> 6.0)
activesupport (~> 6.0)
arel-helpers
metasploit-concern
metasploit-model (>= 3.1)
pg
railties (~> 5.2.2)
railties (~> 6.0)
recog (~> 2.0)
webrick
metasploit_payloads-mettle (1.0.10)
@ -313,12 +314,12 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
railties (6.1.3.2)
actionpack (= 6.1.3.2)
activesupport (= 6.1.3.2)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
thor (~> 1.0)
rainbow (3.0.0)
rake (13.0.6)
rb-readline (0.5.5)
@ -447,12 +448,11 @@ GEM
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thor (1.1.0)
thread_safe (0.3.6)
tilt (2.0.10)
timecop (0.9.4)
ttfunk (1.7.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
tzinfo-data (1.2021.1)
tzinfo (>= 1.0.0)
unf (0.1.4)

View File

@ -1,3 +1,5 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
include ArelHelpers::ArelTable
include ArelHelpers::JoinAssociation
end

View File

@ -7,7 +7,7 @@ module Metasploit
def validate_each(record, attribute, value)
unless ::File.executable? value
record.errors[attribute] << (options[:message] || "is not a valid path to an executable file")
record.errors.add(attribute, (options[:message] || "is not a valid path to an executable file"))
end
end
end

View File

@ -7,7 +7,7 @@ module Metasploit
def validate_each(record, attribute, value)
unless value && ::File.file?(value)
record.errors[attribute] << (options[:message] || "is not a valid path to a regular file")
record.errors.add(attribute, (options[:message] || "is not a valid path to a regular file"))
end
end
end

View File

@ -36,6 +36,7 @@ module Metasploit
config.paths['log'] = "#{Msf::Config.log_directory}/#{Rails.env}.log"
config.paths['config/database'] = [Metasploit::Framework::Database.configurations_pathname.try(:to_path)]
config.autoloader = :zeitwerk
case Rails.env
when "development"
@ -51,4 +52,4 @@ end
# Silence warnings about this defaulting to true
I18n.enforce_available_locales = true
require 'msfenv'
require 'msfenv'

View File

@ -2,11 +2,11 @@
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

View File

@ -74,7 +74,7 @@ class Metasploit::Framework::Command::Base
end
def self.parsed_options_class_name
@parsed_options_class_name ||= "#{parent.parent}::ParsedOptions::#{name.demodulize}"
@parsed_options_class_name ||= "#{module_parent.module_parent}::ParsedOptions::#{name.demodulize}"
end
def self.start

View File

@ -3,7 +3,7 @@
module Metasploit
module Framework
module RailsVersionConstraint
RAILS_VERSION = '~> 5.2.2'
RAILS_VERSION = '~> 6.0'
end
end
end

View File

@ -30,7 +30,7 @@ module Metasploit
end
end
VERSION = "6.0.57"
VERSION = "6.1.0"
MAJOR, MINOR, PATCH = VERSION.split('.').map { |x| x.to_i }
PRERELEASE = 'dev'
HASH = get_hash

View File

@ -29,7 +29,7 @@ module Msf::DBManager::Adapter
def initialize_adapter
ApplicationRecord.default_timezone = :utc
if connection_established? && ApplicationRecord.connection_config[:adapter] == ADAPTER
if connection_established? && ApplicationRecord.connection_db_config.configuration_hash[:adapter] == ADAPTER
dlog("Already established connection to #{ADAPTER}, so reusing active connection.")
self.drivers << ADAPTER
self.driver = ADAPTER

View File

@ -34,7 +34,7 @@ module Msf::DBManager::Migration
ActiveRecord::Migration.verbose = verbose
ActiveRecord::Base.connection_pool.with_connection do
begin
context = ActiveRecord::MigrationContext.new(gather_engine_migration_paths)
context = ActiveRecord::MigrationContext.new(gather_engine_migration_paths, ActiveRecord::SchemaMigration)
if context.needs_migration?
ran = context.migrate
end

View File

@ -37,7 +37,7 @@ module Msf
OptString.new('Ssh::Version', [
true,
'The SSH version string to provide',
Rex::Proto::Ssh::Connection.default_options['local_version']
default_version_string
])
], Msf::Handler::ReverseSsh
)
@ -139,6 +139,17 @@ module Msf
datastore['WfsDelay'] > 4 ? datastore['WfsDelay'] : 5
end
attr_accessor :service # :nodoc:
private
def default_version_string
require 'rex/proto/ssh/connection'
Rex::Proto::Ssh::Connection.default_options['local_version']
rescue LoadError => e
print_error("This handler requires PTY access not available on all platforms.")
elog(e)
'SSH-2.0-OpenSSH_5.3p1'
end
end
end
end

View File

@ -52,7 +52,7 @@ module Msf::ModuleManager::Cache
log_message = log_lines.join("\n")
elog(log_message)
else
parent_path = class_or_module.parent.parent_path
parent_path = class_or_module.module_parent.parent_path
reference_name = options.fetch(:reference_name)
type = options.fetch(:type)

View File

@ -20,7 +20,7 @@ module Msf::ModuleManager::Reloading
self.inv_aliases.delete metasploit_class.fullname
end
namespace_module = metasploit_class.parent
namespace_module = metasploit_class.module_parent
loader = namespace_module.loader
loader.reload_module(mod)
end

View File

@ -279,7 +279,7 @@ class Msf::Modules::Loader::Base
original_metasploit_class = original_metasploit_class_or_instance
end
namespace_module = original_metasploit_class.parent
namespace_module = original_metasploit_class.module_parent
parent_path = namespace_module.parent_path
type = original_metasploit_class.type
@ -535,7 +535,7 @@ class Msf::Modules::Loader::Base
relative_name = namespace_module_names.last
if previous_namespace_module
parent_module = previous_namespace_module.parent
parent_module = previous_namespace_module.module_parent
# remove_const is private, so use send to bypass
parent_module.send(:remove_const, relative_name)
end
@ -544,7 +544,7 @@ class Msf::Modules::Loader::Base
# Get the parent module from the created module so that
# restore_namespace_module can remove namespace_module's constant if
# needed.
parent_module = namespace_module.parent
parent_module = namespace_module.module_parent
begin
loaded = block.call(namespace_module)

View File

@ -1,7 +1,9 @@
require 'warden'
module Msf::WebServices::Authentication
module Strategies
Warden::Strategies.add(:api_token, Msf::WebServices::Authentication::Strategies::ApiToken)
Warden::Strategies.add(:admin_api_token, Msf::WebServices::Authentication::Strategies::AdminApiToken)
Warden::Strategies.add(:password, Msf::WebServices::Authentication::Strategies::UserPassword)
end
end
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module AuthApiDoc
module Msf::WebServices::Documentation::Api::V1::AuthApiDoc
include Swagger::Blocks
MESSAGE_DESC = 'The status of the authentication request.'
@ -42,14 +42,14 @@ module AuthApiDoc
end
response 401 do
key :description, 'Invalid username or password. ' + RootApiDoc::DEFAULT_RESPONSE_401
key :description, 'Invalid username or password. ' + Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,7 +1,7 @@
require 'swagger/blocks'
# TODO: Complete this documentation when the credential model is fully implemented in the API.
module CredentialApiDoc
module Msf::WebServices::Documentation::Api::V1::CredentialApiDoc
include Swagger::Blocks
ORIGIN_ID_DESC = 'The ID of the origin record associated with this credential.'
@ -74,13 +74,13 @@ module CredentialApiDoc
# Swagger documentation for Credential model
swagger_schema :Credential do
key :required, [:origin_id]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :origin_id, type: :integer, format: :int32, description: ORIGIN_ID_DESC
property :origin_type, type: :string, description: ORIGIN_TYPE_DESC, enum: ORIGIN_TYPE_CLASS_ENUM
property :private_id, type: :integer, format: :int32, description: PRIVATE_ID_DESC
property :public_id, type: :integer, format: :int32, description: PUBLIC_ID_DESC
property :realm_id, type: :integer, format: :int32, description: REALM_ID_DESC
property :workspace_id, type: :integer, format: :int32, required: true, description: RootApiDoc::WORKSPACE_ID_DESC
property :workspace_id, type: :integer, format: :int32, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_ID_DESC
property :logins_count, type: :integer, format: :int32, description: LOGINS_COUNT_DESC
property :logins do
key :type, :array
@ -90,36 +90,36 @@ module CredentialApiDoc
end
property :public, '$ref': :Public
property :private, '$ref': :Private
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_schema :Public do
key :required, [:username, :type]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :username, type: :string, description: USERNAME_DESC, example: USERNAME_EXAMPLE
property :type, type: :string, description: PUBLIC_TYPE_DESC, enum: PUBLIC_TYPE_ENUM
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_schema :Private do
key :required, [:data, :type]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :data, type: :string, description: DATA_DESC, example: DATA_EXAMPLE
property :type, type: :string, description: PRIVATE_TYPE_DESC, enum: PRIVATE_TYPE_CLASS_ENUM
property :jtr_format, type: :string, description: JTR_FORMAT_DESC, example: JTR_FORMAT_EXAMPLE
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_schema :Realm do
key :required, [:key, :value]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :key, type: :string, description: KEY_DESC, example: KEY_EXAMPLE
property :value, type: :string, description: VALUE_DESC, example: VALUE_EXAMPLE
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/credentials' do
@ -182,14 +182,14 @@ module CredentialApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -207,7 +207,7 @@ module CredentialApiDoc
key :description, 'The attributes to assign to the credential.'
key :required, true
schema do
property :workspace_id, type: :integer, format: :int32, required: true, description: RootApiDoc::WORKSPACE_ID_DESC
property :workspace_id, type: :integer, format: :int32, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_ID_DESC
property :username, type: :string, description: USERNAME_DESC, example: USERNAME_EXAMPLE
property :private_data, type: :string, description: DATA_DESC, example: DATA_EXAMPLE
property :private_type, type: :string, description: PRIVATE_TYPE_DESC, enum: PRIVATE_TYPE_ENUM
@ -227,7 +227,7 @@ module CredentialApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Credential
@ -236,14 +236,14 @@ module CredentialApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -268,14 +268,14 @@ module CredentialApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -312,14 +312,14 @@ module CredentialApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -344,7 +344,7 @@ module CredentialApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Credential
@ -353,14 +353,14 @@ module CredentialApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module DbExportApiDoc
module Msf::WebServices::Documentation::Api::V1::DbExportApiDoc
include Swagger::Blocks
swagger_path '/api/v1/db-export' do
@ -37,14 +37,14 @@ module DbExportApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module EventApiDoc
module Msf::WebServices::Documentation::Api::V1::EventApiDoc
include Swagger::Blocks
NAME_DESC = 'The name of the event.'
@ -15,15 +15,15 @@ module EventApiDoc
# Swagger documentation for Event model
swagger_schema :Event do
key :required, [:name]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :workspace_id, type: :integer, format: :int32, description: RootApiDoc::WORKSPACE_ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :workspace_id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_ID_DESC
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
property :critical, type: :boolean, description: CRITICAL_DESC
property :seen, type: :string, description: SEEN_DESC
property :username, type: :string, description: USERNAME_DESC
property :info, type: :string, description: INFO_DESC, example: INFO_EXAMPLE
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
end
swagger_path '/api/v1/events' do
@ -37,8 +37,8 @@ module EventApiDoc
parameter do
key :name, :limit
key :in, :query
key :description, RootApiDoc::LIMIT_DESC
key :example, RootApiDoc::LIMIT_DEFAULT
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::LIMIT_DESC
key :example, Msf::WebServices::Documentation::Api::V1::RootApiDoc::LIMIT_DEFAULT
key :type, :integer
key :format, :int32
key :required, false
@ -47,8 +47,8 @@ module EventApiDoc
parameter do
key :name, :offset
key :in, :query
key :description, RootApiDoc::OFFSET_DESC
key :example, RootApiDoc::OFFSET_DEFAULT
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::OFFSET_DESC
key :example, Msf::WebServices::Documentation::Api::V1::RootApiDoc::OFFSET_DEFAULT
key :type, :integer
key :format, :int32
key :required, false
@ -57,10 +57,10 @@ module EventApiDoc
parameter do
key :name, :order
key :in, :query
key :description, RootApiDoc::ORDER_DESC
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::ORDER_DESC
key :type, :string
key :required, false
key :enum, RootApiDoc::ORDER_ENUM
key :enum, Msf::WebServices::Documentation::Api::V1::RootApiDoc::ORDER_ENUM
end
response 200 do
@ -76,14 +76,14 @@ module EventApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -101,9 +101,9 @@ module EventApiDoc
key :description, 'The attributes to assign to the event.'
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_DESC, example: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
property :host, type: :string, format: :ipv4, description: HOST_DESC, example: RootApiDoc::HOST_EXAMPLE
property :host, type: :string, format: :ipv4, description: HOST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::HOST_EXAMPLE
property :critical, type: :boolean, description: CRITICAL_DESC
property :username, type: :string, description: USERNAME_DESC
property :info, type: :string, description: INFO_DESC, example: INFO_EXAMPLE
@ -111,7 +111,7 @@ module EventApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Event
@ -120,14 +120,14 @@ module EventApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -160,14 +160,14 @@ module EventApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module ExploitApiDoc
module Msf::WebServices::Documentation::Api::V1::ExploitApiDoc
include Swagger::Blocks
swagger_schema :Exploit do
@ -56,7 +56,7 @@ module ExploitApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Exploit
@ -65,14 +65,14 @@ module ExploitApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module HostApiDoc
module Msf::WebServices::Documentation::Api::V1::HostApiDoc
include Swagger::Blocks
HOST_DESC = 'The IP address of the host.'
@ -62,7 +62,7 @@ module HostApiDoc
# Swagger documentation for Host model
swagger_schema :Host do
key :required, [:address, :name]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :address, type: :string, description: HOST_DESC, example: HOST_EXAMPLE
property :mac, type: :string, description: MAC_DESC, example: MAC_EXAMPLE
property :comm, type: :string, description: COMM_DESC
@ -75,7 +75,7 @@ module HostApiDoc
property :os_family, type: :string, description: OS_FAMILY_DESC, example: OS_FAMILY_EXAMPLE
property :arch, type: :string, description: ARCH_DESC, enum: ARCH_ENUM
property :detected_arch, type: :string, description: DETECTED_ARCH_DESC
property :workspace_id, type: :integer, format: :int32, description: RootApiDoc::WORKSPACE_ID_DESC
property :workspace_id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_ID_DESC
property :purpose, type: :string, description: PURPOSE_DESC
property :info, type: :string, description: INFO_DESC
property :comments, type: :string, description: COMMENTS_DESC
@ -87,8 +87,8 @@ module HostApiDoc
property :host_detail_count, type: :integer, format: :int32, description: HOST_DETAIL_COUNT_DESC
property :exploit_attempt_count, type: :integer, format: :int32, description: EXPLOIT_ATTEMPT_COUNT_DESC
property :cred_count, type: :integer, format: :int32, description: CRED_COUNT_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/hosts' do
@ -114,14 +114,14 @@ module HostApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -139,7 +139,7 @@ module HostApiDoc
key :description, 'The attributes to assign to the host.'
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :string, format: :ipv4, required: true, description: HOST_DESC, example: HOST_EXAMPLE
property :mac, type: :string, description: MAC_DESC, example: MAC_EXAMPLE
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
@ -167,7 +167,7 @@ module HostApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Host
@ -176,14 +176,14 @@ module HostApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -210,14 +210,14 @@ module HostApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -250,14 +250,14 @@ module HostApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -291,14 +291,14 @@ module HostApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module LoginApiDoc
module Msf::WebServices::Documentation::Api::V1::LoginApiDoc
include Swagger::Blocks
CORE_ID_DESC = 'The ID of the Metasploit::Credential::Core object this login is associated with.'
@ -33,14 +33,14 @@ module LoginApiDoc
# Swagger documentation for Login model
swagger_schema :Login do
key :required, [:address, :name]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :core_id, type: :integer, format: :int32, required: true, description: CORE_ID_DESC
property :service_id, type: :integer, format: :int32, required: true, description: SERVICE_ID_DESC
property :access_level, type: :string, description: ACCESS_LEVEL_DESC, example: ACCESS_LEVEL_EXAMPLE
property :status, type: :string, description: STATUS_DESC, required: true, enum: STATUS_ENUM
property :last_attempted_at, type: :string, format: :date_time, description: LAST_ATTEMPTED_AT_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/logins' do
@ -62,14 +62,14 @@ module LoginApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -87,7 +87,7 @@ module LoginApiDoc
key :description, 'The attributes to assign to the login.'
key :required, true
schema do
property :workspace_id, type: :integer, format: :int32, required: true, description: RootApiDoc::WORKSPACE_ID_DESC
property :workspace_id, type: :integer, format: :int32, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_ID_DESC
property :core, '$ref' => :Credential, required: true, description: CORE_DESC
property :last_attempted_at, type: :string, format: :date_time, required: true, description: LAST_ATTEMPTED_AT_DESC
property :address, type: :string, format: :ipv4, required: true, description: ADDRESS_DESC, example: ADDRESS_EXAMPLE
@ -100,7 +100,7 @@ module LoginApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Login
@ -109,14 +109,14 @@ module LoginApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -143,7 +143,7 @@ module LoginApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
@ -177,14 +177,14 @@ module LoginApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -209,7 +209,7 @@ module LoginApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Login
@ -218,14 +218,14 @@ module LoginApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module LootApiDoc
module Msf::WebServices::Documentation::Api::V1::LootApiDoc
include Swagger::Blocks
HOST_ID_DESC = 'The ID of the host record this loot is associated with.'
@ -26,8 +26,8 @@ module LootApiDoc
# Swagger documentation for loot model
swagger_schema :Loot do
key :required, [:name, :ltype, :path]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :workspace_id, type: :integer, format: :int32, description: RootApiDoc::WORKSPACE_ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :workspace_id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_ID_DESC
property :host_id, type: :integer, format: :int32, description: HOST_ID_DESC
property :service_id, type: :integer, format: :int32, description: SERVICE_ID_DESC
property :ltype, type: :string, description: LTYPE_DESC, example: LTYPE_EXAMPLE
@ -37,8 +37,8 @@ module LootApiDoc
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
property :info, type: :string, description: INFO_DESC
property :module_run_id, type: :integer, format: :int32, description: MODULE_RUN_ID_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/loots' do
@ -62,14 +62,14 @@ module LootApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -87,8 +87,8 @@ module LootApiDoc
key :description, 'The attributes to assign to the loot.'
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_DESC, example: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :string, format: :ipv4, description: HOST_DESC, example: RootApiDoc::HOST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :string, format: :ipv4, description: HOST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::HOST_EXAMPLE
property :service, '$ref': :Service
property :ltype, type: :string, description: LTYPE_DESC, example: LTYPE_EXAMPLE, required: true
property :path, type: :string, description: CREATE_PATH_DESC, example: CREATE_PATH_EXAMPLE, required: true
@ -100,7 +100,7 @@ module LootApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Loot
@ -109,14 +109,14 @@ module LootApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -143,14 +143,14 @@ module LootApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -183,14 +183,14 @@ module LootApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -210,7 +210,7 @@ module LootApiDoc
key :description, 'The updated attributes to overwrite to the loot.'
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_DESC, example: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host_id, type: :integer, format: :int32, description: HOST_ID_DESC
property :service_id, type: :integer, format: :int32, description: SERVICE_ID_DESC
property :ltype, type: :string, description: LTYPE_DESC, example: LTYPE_EXAMPLE, required: true
@ -222,7 +222,7 @@ module LootApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Loot
@ -231,14 +231,14 @@ module LootApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module ModuleSearchApiDoc
module Msf::WebServices::Documentation::Api::V1::ModuleSearchApiDoc
include Swagger::Blocks
AKA_DESC = 'Filter modules with a matching AKA name.'
@ -168,14 +168,14 @@ module ModuleSearchApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module MsfApiDoc
module Msf::WebServices::Documentation::Api::V1::MsfApiDoc
include Swagger::Blocks
swagger_path '/api/v1/msf/version' do
@ -19,14 +19,14 @@ module MsfApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module NmapApiDoc
module Msf::WebServices::Documentation::Api::V1::NmapApiDoc
include Swagger::Blocks
swagger_path '/api/v1/nmaps' do
@ -14,7 +14,7 @@ module NmapApiDoc
key :name, :body
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :filename, type: :string, required: true, description: 'The name of the file you are uploading.'
property :data, type: :string, required: true, description: 'The Base64 encoded contents of the Nmap XML file.'
end
@ -30,14 +30,14 @@ module NmapApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module NoteApiDoc
module Msf::WebServices::Documentation::Api::V1::NoteApiDoc
include Swagger::Blocks
NTYPE_DESC = 'The type of note this is.'
@ -16,17 +16,17 @@ module NoteApiDoc
# Swagger documentation for notes model
swagger_schema :Note do
key :required, [:ntype]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :ntype, type: :string, description: NTYPE_DESC, example: NTYPE_EXAMPLE
property :workspace_id, type: :integer, format: :int32, description: RootApiDoc::WORKSPACE_ID_DESC
property :workspace_id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_ID_DESC
property :host_id, type: :integer, format: :int32, description: HOST_ID_DESC
property :service_id, type: :integer, format: :int32, description: SERVICE_ID_DESC
property :vuln_id, type: :integer, format: :int32, description: VULN_ID_DESC
property :critical, type: :boolean, description: CRITICAL_DESC
property :seen, type: :boolean, description: SEEN_DESC
property :data, type: :string, description: DATA_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/notes' do
@ -50,14 +50,14 @@ module NoteApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -76,8 +76,8 @@ module NoteApiDoc
key :required, true
schema do
property :ntype, type: :string, description: NTYPE_DESC, example: NTYPE_EXAMPLE, required: true
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_DESC, example: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :integer, format: :ipv4, description: HOST_DESC, example: RootApiDoc::HOST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :integer, format: :ipv4, description: HOST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::HOST_EXAMPLE
property :critical, type: :boolean, description: CRITICAL_DESC
property :seen, type: :boolean, description: SEEN_DESC
property :data, type: :string, description: DATA_DESC
@ -85,7 +85,7 @@ module NoteApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Note
@ -94,14 +94,14 @@ module NoteApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -128,14 +128,14 @@ module NoteApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -168,14 +168,14 @@ module NoteApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -200,7 +200,7 @@ module NoteApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Note
@ -209,14 +209,14 @@ module NoteApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module PayloadApiDoc
module Msf::WebServices::Documentation::Api::V1::PayloadApiDoc
include Swagger::Blocks
NAME_DESC = 'A name for the payload.'
@ -24,8 +24,8 @@ module PayloadApiDoc
# Swagger documentation for payloads model
swagger_schema :Payload do
key :required, [:ntype]
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :name, type: :string, description: NAME_DESC
property :uuid, type: :string, description: UUID_DESC, example: UUID_EXAMPLE
property :timestamp, type: :integer, description: TIMESTAMP_DESC, example: TIMESTAMP_EXAMPLE
@ -36,8 +36,8 @@ module PayloadApiDoc
property :raw_payload, type: :string, description: RAW_PAYLOAD_DESC
property :raw_payload_hash, type: :string, description: RAW_PAYLOAD_HASH_DESC
property :build_opts, type: :string, description: BUILD_OPTS_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/payloads' do
@ -61,14 +61,14 @@ module PayloadApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -101,7 +101,7 @@ module PayloadApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Payload
@ -110,14 +110,14 @@ module PayloadApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -144,14 +144,14 @@ module PayloadApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -184,14 +184,14 @@ module PayloadApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -216,7 +216,7 @@ module PayloadApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Payload
@ -225,14 +225,14 @@ module PayloadApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module RootApiDoc
module Msf::WebServices::Documentation::Api::V1::RootApiDoc
include Swagger::Blocks
ID_DESC = 'The primary key used to identify this object in the database.'

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module ServiceApiDoc
module Msf::WebServices::Documentation::Api::V1::ServiceApiDoc
include Swagger::Blocks
HOST_DESC = 'The host where this service is running.'
@ -19,15 +19,15 @@ module ServiceApiDoc
# Swagger documentation for Service model
swagger_schema :Service do
key :required, [:id, :port, :proto]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :host_id, type: :integer, format: :int32, description: HOST_ID_DESC
property :port, type: :string, description: PORT_DESC, example: PORT_EXAMPLE
property :proto, type: :string, description: PROTO_DESC, enum: PROTO_ENUM
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
property :info, type: :string, description: INFO_DESC, example: INFO_EXAMPLE
property :state, type: :string, description: STATE_DESC, enum: STATE_ENUM
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/services' do
@ -51,14 +51,14 @@ module ServiceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -76,8 +76,8 @@ module ServiceApiDoc
key :description, 'The attributes to assign to the service.'
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_DESC, example: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :string, format: :ipv4, required: true, description: HOST_DESC, example: RootApiDoc::HOST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :string, format: :ipv4, required: true, description: HOST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::HOST_EXAMPLE
property :port, type: :string, required: true, description: PORT_DESC, example: PORT_EXAMPLE
property :proto, type: :string, required: true, description: PROTO_DESC, enum: PROTO_ENUM
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
@ -87,7 +87,7 @@ module ServiceApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Service
@ -96,14 +96,14 @@ module ServiceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -130,14 +130,14 @@ module ServiceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -171,14 +171,14 @@ module ServiceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -203,7 +203,7 @@ module ServiceApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Service
@ -212,14 +212,14 @@ module ServiceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module SessionApiDoc
module Msf::WebServices::Documentation::Api::V1::SessionApiDoc
include Swagger::Blocks
# Swagger documentation for sessions model
@ -42,14 +42,14 @@ module SessionApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -76,7 +76,7 @@ module SessionApiDoc
# end
#
# response 200 do
# key :description, RootApiDoc::DEFAULT_RESPONSE_200
# key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
# schema do
# key :type, :object
# key :'$ref', :Session
@ -110,14 +110,14 @@ module SessionApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module SessionEventApiDoc
module Msf::WebServices::Documentation::Api::V1::SessionEventApiDoc
include Swagger::Blocks
SESSION_ID_DESC = 'The ID of the session record that caused this event.'
@ -16,14 +16,14 @@ module SessionEventApiDoc
# Swagger documentation for session events model
swagger_schema :SessionEvent do
key :required, [:etype, :session_id]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :session_id, type: :integer, format: :int32, description: SESSION_ID_DESC
property :etype, type: :string, description: ETYPE_DESC, enum: ETYPE_ENUM
property :command, type: :string, description: COMMAND_DESC
property :output, type: :string, description: OUTPUT_DESC
property :local_path, type: :string, description: LOCAL_PATH_DESC, example: LOCAL_PATH_EXAMPLE
property :remote_path, type: :string, description: REMOTE_PATH_DESC, example: REMOTE_PATH_EXAMPLE
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
end
swagger_path '/api/v1/session-events' do
@ -35,8 +35,8 @@ module SessionEventApiDoc
parameter do
key :name, :limit
key :in, :query
key :description, RootApiDoc::LIMIT_DESC
key :example, RootApiDoc::LIMIT_DEFAULT
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::LIMIT_DESC
key :example, Msf::WebServices::Documentation::Api::V1::RootApiDoc::LIMIT_DEFAULT
key :type, :integer
key :format, :int32
key :required, false
@ -45,8 +45,8 @@ module SessionEventApiDoc
parameter do
key :name, :offset
key :in, :query
key :description, RootApiDoc::OFFSET_DESC
key :example, RootApiDoc::OFFSET_DEFAULT
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::OFFSET_DESC
key :example, Msf::WebServices::Documentation::Api::V1::RootApiDoc::OFFSET_DEFAULT
key :type, :integer
key :format, :int32
key :required, false
@ -55,10 +55,10 @@ module SessionEventApiDoc
parameter do
key :name, :order
key :in, :query
key :description, RootApiDoc::ORDER_DESC
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::ORDER_DESC
key :type, :string
key :required, false
key :enum, RootApiDoc::ORDER_ENUM
key :enum, Msf::WebServices::Documentation::Api::V1::RootApiDoc::ORDER_ENUM
end
response 200 do
@ -74,14 +74,14 @@ module SessionEventApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -109,7 +109,7 @@ module SessionEventApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :SessionEvent
@ -118,14 +118,14 @@ module SessionEventApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -158,14 +158,14 @@ module SessionEventApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module UserApiDoc
module Msf::WebServices::Documentation::Api::V1::UserApiDoc
include Swagger::Blocks
USERNAME_DESC = 'The username of the user.'
@ -29,13 +29,13 @@ module UserApiDoc
# Swagger documentation for User model
swagger_schema :User do
key :required, [:username, :password]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :username, type: :string, description: USERNAME_DESC, example: USERNAME_EXAMPLE
property :crypted_password, type: :string, description: CRYPTED_PASSWORD_DESC, example: CRYPTED_PASSWORD_EXAMPLE
property :password_salt, type: :string, description: PASSWORD_SALT_DESC
property :persistence_token, type: :string, description: PERSISTENCE_TOKEN_DESC, example: PERSISTENCE_TOKEN_EXAMPLE
property :created_at, type: :string, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
property :fullname, type: :string, description: FULLNAME_DESC, example: FULLNAME_EXAMPLE
property :email, type: :string, description: EMAIL_DESC, example: EMAIL_EXAMPLE
property :phone, type: :string, description: PHONE_DESC, example: PHONE_EXAMPLE
@ -63,14 +63,14 @@ module UserApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -99,7 +99,7 @@ module UserApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :type, :array
@ -111,14 +111,14 @@ module UserApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module VulnApiDoc
module Msf::WebServices::Documentation::Api::V1::VulnApiDoc
include Swagger::Blocks
HOST_ID_DESC = 'The ID of host record associated with this vuln.'
@ -22,7 +22,7 @@ module VulnApiDoc
# Swagger documentation for vulns model
swagger_schema :Vuln do
key :required, [:host_id, :name]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :host_id, type: :integer, format: :int32, description: HOST_ID_DESC
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
property :info, type: :string, description: INFO_DESC, example: INFO_EXAMPLE
@ -37,17 +37,17 @@ module VulnApiDoc
key :'$ref', :Ref
end
end
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_schema :Ref do
key :required, [:name]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :ref_id, type: :integer, format: :int32, description: REF_ID_DESC
property :name, type: :string, required: true, description: REF_NAME_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/vulns' do
@ -71,14 +71,14 @@ module VulnApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -96,8 +96,8 @@ module VulnApiDoc
key :description, 'The attributes to assign to the vuln.'
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_DESC, example: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :string, format: :ipv4, required: true, description: HOST_DESC, example: RootApiDoc::HOST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :host, type: :string, format: :ipv4, required: true, description: HOST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::HOST_EXAMPLE
property :name, type: :string, description: NAME_DESC, example: NAME_EXAMPLE
property :info, type: :string, description: INFO_DESC, example: INFO_EXAMPLE
property :refs do
@ -121,14 +121,14 @@ module VulnApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -155,14 +155,14 @@ module VulnApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -195,14 +195,14 @@ module VulnApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -236,14 +236,14 @@ module VulnApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module VulnAttemptApiDoc
module Msf::WebServices::Documentation::Api::V1::VulnAttemptApiDoc
include Swagger::Blocks
VULN_ID_DESC = 'The ID of the vuln record associated with this vuln attempt was exploiting.'
@ -18,7 +18,7 @@ module VulnAttemptApiDoc
# Swagger documentation for vuln_attempts model
swagger_schema :VulnAttempt do
key :required, [:vuln_id]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :vuln_id, type: :integer, format: :int32, description: VULN_ID_DESC
property :session_id, type: :integer, format: :int32, description: SESSION_ID_DESC
property :loot_id, type: :integer, format: :int32, description: LOOT_ID_DESC
@ -51,14 +51,14 @@ module VulnAttemptApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -76,7 +76,7 @@ module VulnAttemptApiDoc
key :description, 'The attributes to assign to the vuln attempt.'
key :required, true
schema do
property :workspace, type: :string, required: true, description: RootApiDoc::WORKSPACE_POST_DESC, example: RootApiDoc::WORKSPACE_POST_EXAMPLE
property :workspace, type: :string, required: true, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_DESC, example: Msf::WebServices::Documentation::Api::V1::RootApiDoc::WORKSPACE_POST_EXAMPLE
property :vuln_id, type: :integer, format: :int32, description: VULN_ID_DESC
property :attempted_at, type: :string, format: :date_time, description: ATTEMPTED_AT_DESC
property :exploited, type: :boolean, description: EXPLOITED_DESC
@ -88,7 +88,7 @@ module VulnAttemptApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :VulnAttempt
@ -97,14 +97,14 @@ module VulnAttemptApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -137,14 +137,14 @@ module VulnAttemptApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,6 +1,6 @@
require 'swagger/blocks'
module WorkspaceApiDoc
module Msf::WebServices::Documentation::Api::V1::WorkspaceApiDoc
include Swagger::Blocks
NAME_DESC = 'The name of the workspace. This is the unique identifier for determining which workspace is being accessed.'
@ -14,15 +14,15 @@ module WorkspaceApiDoc
# Swagger documentation for workspaces model
swagger_schema :Workspace do
key :required, [:name]
property :id, type: :integer, format: :int32, description: RootApiDoc::ID_DESC
property :id, type: :integer, format: :int32, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::ID_DESC
property :name, type: :string, description: NAME_DESC
property :boundary, type: :string, description: BOUNDARY_DESC, example: BOUNDARY_EXAMPLE
property :description, type: :string, description: DESCRIPTION_DESC
property :owner_id, type: :integer, format: :int32, description: OWNER_ID_DESC
property :limit_to_network, type: :boolean, description: LIMIT_TO_NETWORK_DESC
property :import_fingerprint, type: :boolean, description: IMPORT_FINGERPRINT_DESC
property :created_at, type: :string, format: :date_time, description: RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: RootApiDoc::UPDATED_AT_DESC
property :created_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::CREATED_AT_DESC
property :updated_at, type: :string, format: :date_time, description: Msf::WebServices::Documentation::Api::V1::RootApiDoc::UPDATED_AT_DESC
end
swagger_path '/api/v1/workspaces' do
@ -44,14 +44,14 @@ module WorkspaceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -74,7 +74,7 @@ module WorkspaceApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Workspace
@ -83,14 +83,14 @@ module WorkspaceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -117,14 +117,14 @@ module WorkspaceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -157,14 +157,14 @@ module WorkspaceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end
@ -189,7 +189,7 @@ module WorkspaceApiDoc
end
response 200 do
key :description, RootApiDoc::DEFAULT_RESPONSE_200
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_200
schema do
property :data do
key :'$ref', :Workspace
@ -198,14 +198,14 @@ module WorkspaceApiDoc
end
response 401 do
key :description, RootApiDoc::DEFAULT_RESPONSE_401
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_401
schema do
key :'$ref', :AuthErrorModel
end
end
response 500 do
key :description, RootApiDoc::DEFAULT_RESPONSE_500
key :description, Msf::WebServices::Documentation::Api::V1::RootApiDoc::DEFAULT_RESPONSE_500
schema do
key :'$ref', :ErrorModel
end

View File

@ -1,26 +1,4 @@
require 'swagger/blocks'
load 'documentation/api/v1/root_api_doc.rb'
load 'documentation/api/v1/auth_api_doc.rb'
load 'documentation/api/v1/credential_api_doc.rb'
load 'documentation/api/v1/db_export_api_doc.rb'
load 'documentation/api/v1/event_api_doc.rb'
load 'documentation/api/v1/exploit_api_doc.rb'
load 'documentation/api/v1/host_api_doc.rb'
load 'documentation/api/v1/login_api_doc.rb'
load 'documentation/api/v1/loot_api_doc.rb'
load 'documentation/api/v1/module_search_api_doc.rb'
load 'documentation/api/v1/msf_api_doc.rb'
load 'documentation/api/v1/nmap_api_doc.rb'
load 'documentation/api/v1/note_api_doc.rb'
load 'documentation/api/v1/payload_api_doc.rb'
load 'documentation/api/v1/service_api_doc.rb'
load 'documentation/api/v1/session_api_doc.rb'
load 'documentation/api/v1/session_event_api_doc.rb'
load 'documentation/api/v1/user_api_doc.rb'
load 'documentation/api/v1/vuln_api_doc.rb'
load 'documentation/api/v1/vuln_attempt_api_doc.rb'
load 'documentation/api/v1/workspace_api_doc.rb'
module Msf::WebServices::ApiDocsServlet
include Swagger::Blocks
@ -45,27 +23,27 @@ module Msf::WebServices::ApiDocsServlet
def self.get_api_docs
lambda {
swaggered_classes = [
RootApiDoc,
AuthApiDoc,
CredentialApiDoc,
DbExportApiDoc,
EventApiDoc,
ExploitApiDoc,
HostApiDoc,
LoginApiDoc,
LootApiDoc,
ModuleSearchApiDoc,
MsfApiDoc,
NmapApiDoc,
NoteApiDoc,
PayloadApiDoc,
ServiceApiDoc,
SessionApiDoc,
SessionEventApiDoc,
UserApiDoc,
VulnApiDoc,
VulnAttemptApiDoc,
WorkspaceApiDoc
Msf::WebServices::Documentation::Api::V1::RootApiDoc,
Msf::WebServices::Documentation::Api::V1::AuthApiDoc,
Msf::WebServices::Documentation::Api::V1::CredentialApiDoc,
Msf::WebServices::Documentation::Api::V1::DbExportApiDoc,
Msf::WebServices::Documentation::Api::V1::EventApiDoc,
Msf::WebServices::Documentation::Api::V1::ExploitApiDoc,
Msf::WebServices::Documentation::Api::V1::HostApiDoc,
Msf::WebServices::Documentation::Api::V1::LoginApiDoc,
Msf::WebServices::Documentation::Api::V1::LootApiDoc,
Msf::WebServices::Documentation::Api::V1::ModuleSearchApiDoc,
Msf::WebServices::Documentation::Api::V1::MsfApiDoc,
Msf::WebServices::Documentation::Api::V1::NmapApiDoc,
Msf::WebServices::Documentation::Api::V1::NoteApiDoc,
Msf::WebServices::Documentation::Api::V1::PayloadApiDoc,
Msf::WebServices::Documentation::Api::V1::ServiceApiDoc,
Msf::WebServices::Documentation::Api::V1::SessionApiDoc,
Msf::WebServices::Documentation::Api::V1::SessionEventApiDoc,
Msf::WebServices::Documentation::Api::V1::UserApiDoc,
Msf::WebServices::Documentation::Api::V1::VulnApiDoc,
Msf::WebServices::Documentation::Api::V1::VulnAttemptApiDoc,
Msf::WebServices::Documentation::Api::V1::WorkspaceApiDoc
].freeze
json = Swagger::Blocks.build_root_json(swaggered_classes)
set_json_response(json, [])

View File

@ -61,7 +61,8 @@ class MsfAutoload
"#{__dir__}/msf/base.rb",
"#{__dir__}/rex/post/",
"#{__dir__}/rex/post.rb",
"#{__dir__}/rex/proto/ssh/hrr_rb_ssh.rb"
"#{__dir__}/rex/proto/ssh/hrr_rb_ssh.rb",
"#{__dir__}/rex/proto/ssh/connection.rb"
]
end
@ -295,7 +296,6 @@ class MsfAutoload
[
{ path: "#{__dir__}/msf/", namespace: Msf },
{ path: "#{__dir__}/rex/", namespace: Rex },
{ path: "#{__dir__}/../app/validators/" },
]
end

View File

@ -14,6 +14,10 @@ module ServerClient
# Initialize a new connection instance.
#
def init_cli(server, do_not_start = false)
# Ssh relies on PTY not available on Windows, limiting the `require` here
# ensures eager_load patterns from zeitwerk will not attempt to load `hrr_rb_ssh`
# during startup.
require 'connection'
@server = server
@connection = Rex::Proto::Ssh::Connection.new(
self, server.server_options.merge(ssh_server: server), server.context
@ -21,6 +25,8 @@ module ServerClient
@connection_thread = Rex::ThreadFactory.spawn("SshConnectionMonitor-#{self}", false) {
self.connection.start
} unless do_not_start
rescue LoadError => e
wlog(e)
end
def close
@ -44,7 +50,7 @@ class Server
# hostname.
#
def initialize(port = 22, listen_host = '0.0.0.0', context = {}, comm = nil,
ssh_opts = Ssh::Connection.default_options, cc_cb = nil, cd_cb = nil)
ssh_opts = default_options, cc_cb = nil, cd_cb = nil)
self.listen_host = listen_host
self.listen_port = port
@ -193,6 +199,17 @@ protected
end
end
private
# Ssh relies on PTY not available on Windows, limiting the `require` here
# ensures eager_load patterns from zeitwerk will not attempt to load `hrr_rb_ssh`
# during startup.
def default_options
require 'connection'
Ssh::Connection.default_options
rescue LoadError => e
wlog(e)
end
end
end

View File

@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
# only do a git ls-files if the .git folder exists and we have a git binary in PATH
if File.directory?(File.join(File.dirname(__FILE__), ".git")) && Msf::Util::Helper.which("git")
spec.files = `git ls-files`.split($/).reject { |file|
file =~ /^documentation|^external/
file =~ /^external/
}
end
spec.bindir = '.'
@ -61,14 +61,14 @@ Gem::Specification.new do |spec|
# Metasm compiler/decompiler/assembler
spec.add_runtime_dependency 'metasm'
# Metasploit::Concern hooks
spec.add_runtime_dependency 'metasploit-concern', '~> 3.0.0'
spec.add_runtime_dependency 'metasploit-concern'
# Metasploit::Credential database models
spec.add_runtime_dependency 'metasploit-credential', '~> 4.0.0'
spec.add_runtime_dependency 'metasploit-credential'
# Database models shared between framework and Pro.
spec.add_runtime_dependency 'metasploit_data_models', '~> 4.1.0'
spec.add_runtime_dependency 'metasploit_data_models'
# Things that would normally be part of the database model, but which
# are needed when there's no database
spec.add_runtime_dependency 'metasploit-model', '~> 3.1.0'
spec.add_runtime_dependency 'metasploit-model'
# Needed for Meterpreter
spec.add_runtime_dependency 'metasploit-payloads', '2.0.50'
# Needed for the next-generation POSIX Meterpreter
@ -205,8 +205,8 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency 'faker'
# Pinned as a dependency of i18n to the last working version
spec.add_runtime_dependency 'concurrent-ruby','1.0.5'
# SSH server library
spec.add_runtime_dependency 'hrr_rb_ssh', '0.3.0.pre2'
# SSH server library with ed25519
spec.add_runtime_dependency 'hrr_rb_ssh-ed25519'
# Needed for irb internal command
spec.add_runtime_dependency 'irb'
# Lock reline version until Fiddle concerns are addressed

View File

@ -32,7 +32,7 @@ class MetasploitModule < Msf::Auxiliary
end
def handle_aws_errors(e)
if e.class.parents.include?(Aws)
if e.class.module_parents.include?(Aws)
fail_with(Failure::UnexpectedReply, e.message)
else
raise e

View File

@ -30,7 +30,7 @@ class MetasploitModule < Msf::Auxiliary
end
def handle_aws_errors(e)
if e.class.parents.include?(Aws)
if e.class.module_parents.include?(Aws)
fail_with(Failure::UnexpectedReply, e.message)
else
raise e

View File

@ -31,7 +31,7 @@ class MetasploitModule < Msf::Auxiliary
end
def handle_aws_errors(e)
if e.class.parents.include?(Aws)
if e.class.module_parents.include?(Aws)
fail_with(Failure::UnexpectedReply, e.message)
else
raise e

View File

@ -33,7 +33,7 @@ RSpec.shared_examples_for 'Msf::DBManager::Migration' do
it 'should return an ActiveRecord::MigrationContext with known migrations' do
migrations_paths = [File.expand_path("../../../../../file_fixtures/migrate", __dir__)]
expect(ActiveRecord::Migrator).to receive(:migrations_paths).and_return(migrations_paths).exactly(3).times
expect(ActiveRecord::Migrator).to receive(:migrations_paths).and_return(migrations_paths).exactly(2).times
result = migrate
expect(result.size).to eq 1
expect(result[0].name).to eq "TestDbMigration"
@ -55,7 +55,7 @@ RSpec.shared_examples_for 'Msf::DBManager::Migration' do
end
before(:example) do
mockContext = ActiveRecord::MigrationContext.new(nil)
mockContext = ActiveRecord::MigrationContext.new(nil, ActiveRecord::SchemaMigration)
expect(ActiveRecord::MigrationContext).to receive(:new).and_return(mockContext)
expect(mockContext).to receive(:needs_migration?).and_return(true)
expect(mockContext).to receive(:migrate).and_raise(standard_error)

View File

@ -83,7 +83,7 @@ RSpec.shared_examples_for 'Msf::ModuleManager::Cache' do
end
let(:class_or_module) do
double('Class<Msf::Module> or Module', :parent => namespace_module)
double('Class<Msf::Module> or Module', :module_parent => namespace_module)
end
let(:namespace_module) do

View File

@ -209,7 +209,7 @@ RSpec.shared_examples_for 'Msf::ModuleManager::Loading' do
end
before(:example) do
allow(klass).to receive(:parent).and_return(namespace_module)
allow(klass).to receive(:module_parent).and_return(namespace_module)
end
it "should add module to type's module_set" do