2013-03-14 20:46:18 +00:00
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# 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).
#
2014-09-04 18:06:34 +00:00
# It's strongly recommended that you check this file into your version control system.
2013-03-14 20:46:18 +00:00
2015-05-21 18:39:25 +00:00
ActiveRecord :: Schema . define ( version : 20150514182921 ) do
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
# These are extensions that must be enabled in order to support this database
enable_extension " plpgsql "
create_table " api_keys " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . text " token "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
end
2015-04-06 16:59:38 +00:00
create_table " automatic_exploitation_match_results " , force : true do | t |
t . integer " match_id "
t . integer " run_id "
t . string " state " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2015-04-06 16:59:38 +00:00
end
add_index " automatic_exploitation_match_results " , [ " match_id " ] , name : " index_automatic_exploitation_match_results_on_match_id " , using : :btree
add_index " automatic_exploitation_match_results " , [ " run_id " ] , name : " index_automatic_exploitation_match_results_on_run_id " , using : :btree
create_table " automatic_exploitation_match_sets " , force : true do | t |
t . integer " workspace_id "
t . integer " user_id "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2015-04-06 16:59:38 +00:00
end
add_index " automatic_exploitation_match_sets " , [ " user_id " ] , name : " index_automatic_exploitation_match_sets_on_user_id " , using : :btree
add_index " automatic_exploitation_match_sets " , [ " workspace_id " ] , name : " index_automatic_exploitation_match_sets_on_workspace_id " , using : :btree
create_table " automatic_exploitation_matches " , force : true do | t |
t . integer " module_detail_id "
t . string " state "
t . integer " nexpose_data_vulnerability_definition_id "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2015-04-06 16:59:38 +00:00
t . integer " match_set_id "
t . string " matchable_type "
t . integer " matchable_id "
t . text " module_fullname "
end
add_index " automatic_exploitation_matches " , [ " module_detail_id " ] , name : " index_automatic_exploitation_matches_on_module_detail_id " , using : :btree
add_index " automatic_exploitation_matches " , [ " module_fullname " ] , name : " index_automatic_exploitation_matches_on_module_fullname " , using : :btree
create_table " automatic_exploitation_runs " , force : true do | t |
t . integer " workspace_id "
t . integer " user_id "
t . integer " match_set_id "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2015-04-06 16:59:38 +00:00
end
add_index " automatic_exploitation_runs " , [ " match_set_id " ] , name : " index_automatic_exploitation_runs_on_match_set_id " , using : :btree
add_index " automatic_exploitation_runs " , [ " user_id " ] , name : " index_automatic_exploitation_runs_on_user_id " , using : :btree
add_index " automatic_exploitation_runs " , [ " workspace_id " ] , name : " index_automatic_exploitation_runs_on_workspace_id " , using : :btree
2014-09-04 18:06:34 +00:00
create_table " clients " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . datetime " created_at "
2014-09-04 18:06:34 +00:00
t . string " ua_string " , limit : 1024 , null : false
t . string " ua_name " , limit : 64
t . string " ua_ver " , limit : 32
2013-03-14 20:46:18 +00:00
t . datetime " updated_at "
end
2014-09-04 18:06:34 +00:00
create_table " credential_cores_tasks " , id : false , force : true do | t |
2014-07-07 14:41:46 +00:00
t . integer " core_id "
t . integer " task_id "
end
2014-09-04 18:06:34 +00:00
create_table " credential_logins_tasks " , id : false , force : true do | t |
2014-07-07 14:41:46 +00:00
t . integer " login_id "
t . integer " task_id "
end
2014-09-04 18:06:34 +00:00
create_table " creds " , force : true do | t |
t . integer " service_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . string " user " , limit : 2048
t . string " pass " , limit : 4096
t . boolean " active " , default : true
t . string " proof " , limit : 4096
t . string " ptype " , limit : 256
2013-03-14 20:46:18 +00:00
t . integer " source_id "
t . string " source_type "
end
2014-09-04 18:06:34 +00:00
create_table " events " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " workspace_id "
t . integer " host_id "
t . datetime " created_at "
t . string " name "
t . datetime " updated_at "
t . boolean " critical "
t . boolean " seen "
t . string " username "
t . text " info "
end
2014-09-04 18:06:34 +00:00
create_table " exploit_attempts " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . integer " service_id "
t . integer " vuln_id "
t . datetime " attempted_at "
t . boolean " exploited "
t . string " fail_reason "
t . string " username "
t . text " module "
t . integer " session_id "
t . integer " loot_id "
t . integer " port "
t . string " proto "
t . text " fail_detail "
end
2014-09-04 18:06:34 +00:00
create_table " exploited_hosts " , force : true do | t |
t . integer " host_id " , null : false
2013-03-14 20:46:18 +00:00
t . integer " service_id "
2014-09-04 18:06:34 +00:00
t . string " session_uuid " , limit : 8
t . string " name " , limit : 2048
t . string " payload " , limit : 2048
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " host_details " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . integer " nx_console_id "
t . integer " nx_device_id "
t . string " src "
t . string " nx_site_name "
t . string " nx_site_importance "
t . string " nx_scan_template "
t . float " nx_risk_score "
end
2014-09-04 18:06:34 +00:00
create_table " hosts " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . datetime " created_at "
2014-09-04 18:06:34 +00:00
t . inet " address " , null : false
2013-03-14 20:46:18 +00:00
t . string " mac "
t . string " comm "
t . string " name "
t . string " state "
t . string " os_name "
t . string " os_flavor "
t . string " os_sp "
t . string " os_lang "
t . string " arch "
2014-09-04 18:06:34 +00:00
t . integer " workspace_id " , null : false
2013-03-14 20:46:18 +00:00
t . datetime " updated_at "
t . text " purpose "
2014-09-04 18:06:34 +00:00
t . string " info " , limit : 65536
2013-03-14 20:46:18 +00:00
t . text " comments "
t . text " scope "
t . text " virtual_host "
2014-09-04 18:06:34 +00:00
t . integer " note_count " , default : 0
t . integer " vuln_count " , default : 0
t . integer " service_count " , default : 0
t . integer " host_detail_count " , default : 0
t . integer " exploit_attempt_count " , default : 0
t . integer " cred_count " , default : 0
2014-09-18 17:35:09 +00:00
t . string " detected_arch "
2014-09-04 18:06:34 +00:00
end
add_index " hosts " , [ " name " ] , name : " index_hosts_on_name " , using : :btree
add_index " hosts " , [ " os_flavor " ] , name : " index_hosts_on_os_flavor " , using : :btree
add_index " hosts " , [ " os_name " ] , name : " index_hosts_on_os_name " , using : :btree
add_index " hosts " , [ " purpose " ] , name : " index_hosts_on_purpose " , using : :btree
add_index " hosts " , [ " state " ] , name : " index_hosts_on_state " , using : :btree
add_index " hosts " , [ " workspace_id " , " address " ] , name : " index_hosts_on_workspace_id_and_address " , unique : true , using : :btree
create_table " hosts_tags " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . integer " tag_id "
end
2014-09-04 18:06:34 +00:00
create_table " listeners " , force : true do | t |
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . integer " workspace_id " , default : 1 , null : false
2013-03-14 20:46:18 +00:00
t . integer " task_id "
2014-09-04 18:06:34 +00:00
t . boolean " enabled " , default : true
2013-03-14 20:46:18 +00:00
t . text " owner "
t . text " payload "
t . text " address "
t . integer " port "
t . binary " options "
t . text " macro "
end
2014-09-04 18:06:34 +00:00
create_table " loots " , force : true do | t |
2015-04-06 16:59:38 +00:00
t . integer " workspace_id " , default : 1 , null : false
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . integer " service_id "
2015-04-06 16:59:38 +00:00
t . string " ltype " , limit : 512
t . string " path " , limit : 1024
2013-03-14 20:46:18 +00:00
t . text " data "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
t . string " content_type "
t . text " name "
t . text " info "
2015-04-06 16:59:38 +00:00
t . integer " module_run_id "
2013-03-14 20:46:18 +00:00
end
2015-04-06 16:59:38 +00:00
add_index " loots " , [ " module_run_id " ] , name : " index_loots_on_module_run_id " , using : :btree
2014-09-04 18:06:34 +00:00
create_table " macros " , force : true do | t |
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
t . text " owner "
t . text " name "
t . text " description "
t . binary " actions "
t . binary " prefs "
end
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_cores " , force : true do | t |
t . integer " origin_id " , null : false
t . string " origin_type " , null : false
2014-05-12 20:03:51 +00:00
t . integer " private_id "
t . integer " public_id "
t . integer " realm_id "
2014-09-04 18:06:34 +00:00
t . integer " workspace_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . integer " logins_count " , default : 0
end
add_index " metasploit_credential_cores " , [ " origin_type " , " origin_id " ] , name : " index_metasploit_credential_cores_on_origin_type_and_origin_id " , using : :btree
add_index " metasploit_credential_cores " , [ " private_id " ] , name : " index_metasploit_credential_cores_on_private_id " , using : :btree
add_index " metasploit_credential_cores " , [ " public_id " ] , name : " index_metasploit_credential_cores_on_public_id " , using : :btree
add_index " metasploit_credential_cores " , [ " realm_id " ] , name : " index_metasploit_credential_cores_on_realm_id " , using : :btree
add_index " metasploit_credential_cores " , [ " workspace_id " , " private_id " ] , name : " unique_private_metasploit_credential_cores " , unique : true , where : " (((realm_id IS NULL) AND (public_id IS NULL)) AND (private_id IS NOT NULL)) " , using : :btree
add_index " metasploit_credential_cores " , [ " workspace_id " , " public_id " , " private_id " ] , name : " unique_realmless_metasploit_credential_cores " , unique : true , where : " (((realm_id IS NULL) AND (public_id IS NOT NULL)) AND (private_id IS NOT NULL)) " , using : :btree
add_index " metasploit_credential_cores " , [ " workspace_id " , " public_id " ] , name : " unique_public_metasploit_credential_cores " , unique : true , where : " (((realm_id IS NULL) AND (public_id IS NOT NULL)) AND (private_id IS NULL)) " , using : :btree
add_index " metasploit_credential_cores " , [ " workspace_id " , " realm_id " , " private_id " ] , name : " unique_publicless_metasploit_credential_cores " , unique : true , where : " (((realm_id IS NOT NULL) AND (public_id IS NULL)) AND (private_id IS NOT NULL)) " , using : :btree
add_index " metasploit_credential_cores " , [ " workspace_id " , " realm_id " , " public_id " , " private_id " ] , name : " unique_complete_metasploit_credential_cores " , unique : true , where : " (((realm_id IS NOT NULL) AND (public_id IS NOT NULL)) AND (private_id IS NOT NULL)) " , using : :btree
add_index " metasploit_credential_cores " , [ " workspace_id " , " realm_id " , " public_id " ] , name : " unique_privateless_metasploit_credential_cores " , unique : true , where : " (((realm_id IS NOT NULL) AND (public_id IS NOT NULL)) AND (private_id IS NULL)) " , using : :btree
add_index " metasploit_credential_cores " , [ " workspace_id " ] , name : " index_metasploit_credential_cores_on_workspace_id " , using : :btree
create_table " metasploit_credential_logins " , force : true do | t |
t . integer " core_id " , null : false
t . integer " service_id " , null : false
2014-05-12 20:03:51 +00:00
t . string " access_level "
2014-09-04 18:06:34 +00:00
t . string " status " , null : false
2014-05-12 20:03:51 +00:00
t . datetime " last_attempted_at "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_logins " , [ " core_id " , " service_id " ] , name : " index_metasploit_credential_logins_on_core_id_and_service_id " , unique : true , using : :btree
add_index " metasploit_credential_logins " , [ " service_id " , " core_id " ] , name : " index_metasploit_credential_logins_on_service_id_and_core_id " , unique : true , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_origin_cracked_passwords " , force : true do | t |
t . integer " metasploit_credential_core_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-06-11 15:57:13 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_origin_cracked_passwords " , [ " metasploit_credential_core_id " ] , name : " originating_credential_cores " , using : :btree
2014-06-11 15:57:13 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_origin_imports " , force : true do | t |
t . text " filename " , null : false
2014-07-07 14:41:46 +00:00
t . integer " task_id "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_origin_imports " , [ " task_id " ] , name : " index_metasploit_credential_origin_imports_on_task_id " , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_origin_manuals " , force : true do | t |
t . integer " user_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_origin_manuals " , [ " user_id " ] , name : " index_metasploit_credential_origin_manuals_on_user_id " , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_origin_services " , force : true do | t |
t . integer " service_id " , null : false
t . text " module_full_name " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_origin_services " , [ " service_id " , " module_full_name " ] , name : " unique_metasploit_credential_origin_services " , unique : true , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_origin_sessions " , force : true do | t |
t . text " post_reference_name " , null : false
t . integer " session_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_origin_sessions " , [ " session_id " , " post_reference_name " ] , name : " unique_metasploit_credential_origin_sessions " , unique : true , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_privates " , force : true do | t |
t . string " type " , null : false
t . text " data " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-06-11 15:57:13 +00:00
t . string " jtr_format "
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_privates " , [ " type " , " data " ] , name : " index_metasploit_credential_privates_on_type_and_data " , unique : true , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_publics " , force : true do | t |
t . string " username " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2015-01-08 19:12:27 +00:00
t . string " type " , null : false
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_publics " , [ " username " ] , name : " index_metasploit_credential_publics_on_username " , unique : true , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " metasploit_credential_realms " , force : true do | t |
t . string " key " , null : false
t . string " value " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-05-12 20:03:51 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " metasploit_credential_realms " , [ " key " , " value " ] , name : " index_metasploit_credential_realms_on_key_and_value " , unique : true , using : :btree
2014-05-12 20:03:51 +00:00
2014-09-04 18:06:34 +00:00
create_table " mod_refs " , force : true do | t |
t . string " module " , limit : 1024
t . string " mtype " , limit : 128
2013-03-14 20:46:18 +00:00
t . text " ref "
end
2014-09-04 18:06:34 +00:00
create_table " module_actions " , force : true do | t |
2013-04-26 18:14:38 +00:00
t . integer " detail_id "
2013-03-14 20:46:18 +00:00
t . text " name "
end
2015-03-18 21:21:03 +00:00
add_index " module_actions " , [ " detail_id " ] , name : " index_module_actions_on_detail_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " module_archs " , force : true do | t |
2013-04-26 18:14:38 +00:00
t . integer " detail_id "
2013-03-14 20:46:18 +00:00
t . text " name "
end
2015-03-18 21:21:03 +00:00
add_index " module_archs " , [ " detail_id " ] , name : " index_module_archs_on_detail_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " module_authors " , force : true do | t |
2013-04-26 18:14:38 +00:00
t . integer " detail_id "
2013-03-14 20:46:18 +00:00
t . text " name "
t . text " email "
end
2015-03-18 21:21:03 +00:00
add_index " module_authors " , [ " detail_id " ] , name : " index_module_authors_on_detail_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " module_details " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . datetime " mtime "
t . text " file "
t . string " mtype "
t . text " refname "
t . text " fullname "
t . text " name "
t . integer " rank "
t . text " description "
t . string " license "
t . boolean " privileged "
t . datetime " disclosure_date "
t . integer " default_target "
t . text " default_action "
t . string " stance "
t . boolean " ready "
end
2014-09-04 18:06:34 +00:00
add_index " module_details " , [ " description " ] , name : " index_module_details_on_description " , using : :btree
add_index " module_details " , [ " mtype " ] , name : " index_module_details_on_mtype " , using : :btree
add_index " module_details " , [ " name " ] , name : " index_module_details_on_name " , using : :btree
add_index " module_details " , [ " refname " ] , name : " index_module_details_on_refname " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " module_mixins " , force : true do | t |
2013-04-26 18:14:38 +00:00
t . integer " detail_id "
2013-03-14 20:46:18 +00:00
t . text " name "
end
2015-03-18 21:21:03 +00:00
add_index " module_mixins " , [ " detail_id " ] , name : " index_module_mixins_on_detail_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " module_platforms " , force : true do | t |
2013-04-26 18:14:38 +00:00
t . integer " detail_id "
2013-03-14 20:46:18 +00:00
t . text " name "
end
2015-03-18 21:21:03 +00:00
add_index " module_platforms " , [ " detail_id " ] , name : " index_module_platforms_on_detail_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " module_refs " , force : true do | t |
2013-04-26 18:14:38 +00:00
t . integer " detail_id "
2013-03-14 20:46:18 +00:00
t . text " name "
end
2015-03-18 21:21:03 +00:00
add_index " module_refs " , [ " detail_id " ] , name : " index_module_refs_on_detail_id " , using : :btree
2014-09-04 18:06:34 +00:00
add_index " module_refs " , [ " name " ] , name : " index_module_refs_on_name " , using : :btree
2013-03-14 20:46:18 +00:00
2015-04-06 16:59:38 +00:00
create_table " module_runs " , force : true do | t |
t . datetime " attempted_at "
t . text " fail_detail "
t . string " fail_reason "
t . text " module_fullname "
t . integer " port "
t . string " proto "
t . integer " session_id "
t . string " status "
t . integer " trackable_id "
t . string " trackable_type "
t . integer " user_id "
t . string " username "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2015-04-06 16:59:38 +00:00
end
add_index " module_runs " , [ " session_id " ] , name : " index_module_runs_on_session_id " , using : :btree
add_index " module_runs " , [ " user_id " ] , name : " index_module_runs_on_user_id " , using : :btree
2014-09-04 18:06:34 +00:00
create_table " module_targets " , force : true do | t |
2013-04-26 18:14:38 +00:00
t . integer " detail_id "
2013-03-14 20:46:18 +00:00
t . integer " index "
t . text " name "
end
2015-03-18 21:21:03 +00:00
add_index " module_targets " , [ " detail_id " ] , name : " index_module_targets_on_detail_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " nexpose_consoles " , force : true do | t |
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . boolean " enabled " , default : true
2013-03-14 20:46:18 +00:00
t . text " owner "
t . text " address "
2014-09-04 18:06:34 +00:00
t . integer " port " , default : 3780
2013-03-14 20:46:18 +00:00
t . text " username "
t . text " password "
t . text " status "
t . text " version "
t . text " cert "
t . binary " cached_sites "
t . text " name "
end
2014-09-04 18:06:34 +00:00
create_table " notes " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . datetime " created_at "
2014-09-04 18:06:34 +00:00
t . string " ntype " , limit : 512
t . integer " workspace_id " , default : 1 , null : false
2013-03-14 20:46:18 +00:00
t . integer " service_id "
t . integer " host_id "
t . datetime " updated_at "
t . boolean " critical "
t . boolean " seen "
t . text " data "
2015-03-16 20:47:11 +00:00
t . integer " vuln_id "
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " notes " , [ " ntype " ] , name : " index_notes_on_ntype " , using : :btree
2015-03-16 20:47:11 +00:00
add_index " notes " , [ " vuln_id " ] , name : " index_notes_on_vuln_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " profiles " , force : true do | t |
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . boolean " active " , default : true
2013-03-14 20:46:18 +00:00
t . text " name "
t . text " owner "
t . binary " settings "
end
2014-09-04 18:06:34 +00:00
create_table " refs " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " ref_id "
t . datetime " created_at "
2014-09-04 18:06:34 +00:00
t . string " name " , limit : 512
2013-03-14 20:46:18 +00:00
t . datetime " updated_at "
end
2014-09-04 18:06:34 +00:00
add_index " refs " , [ " name " ] , name : " index_refs_on_name " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " report_templates " , force : true do | t |
t . integer " workspace_id " , default : 1 , null : false
2013-03-14 20:46:18 +00:00
t . string " created_by "
2014-09-04 18:06:34 +00:00
t . string " path " , limit : 1024
2014-05-30 18:07:11 +00:00
t . text " name "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " reports " , force : true do | t |
t . integer " workspace_id " , default : 1 , null : false
2013-03-14 20:46:18 +00:00
t . string " created_by "
2014-05-30 18:07:11 +00:00
t . string " rtype "
2014-09-04 18:06:34 +00:00
t . string " path " , limit : 1024
2013-03-14 20:46:18 +00:00
t . text " options "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-05-30 18:07:11 +00:00
t . datetime " downloaded_at "
t . integer " task_id "
2014-09-04 18:06:34 +00:00
t . string " name " , limit : 63
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " routes " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " session_id "
t . string " subnet "
t . string " netmask "
end
2014-09-04 18:06:34 +00:00
create_table " services " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . datetime " created_at "
2014-09-04 18:06:34 +00:00
t . integer " port " , null : false
t . string " proto " , limit : 16 , null : false
2013-03-14 20:46:18 +00:00
t . string " state "
t . string " name "
t . datetime " updated_at "
t . text " info "
end
2015-03-16 20:47:11 +00:00
add_index " services " , [ " host_id " , " port " , " proto " ] , name : " index_services_on_host_id_and_port_and_proto " , unique : true , using : :btree
2014-09-04 18:06:34 +00:00
add_index " services " , [ " name " ] , name : " index_services_on_name " , using : :btree
add_index " services " , [ " port " ] , name : " index_services_on_port " , using : :btree
add_index " services " , [ " proto " ] , name : " index_services_on_proto " , using : :btree
add_index " services " , [ " state " ] , name : " index_services_on_state " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " session_events " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " session_id "
t . string " etype "
t . binary " command "
t . binary " output "
t . string " remote_path "
t . string " local_path "
t . datetime " created_at "
end
2014-09-04 18:06:34 +00:00
create_table " sessions " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . string " stype "
t . string " via_exploit "
t . string " via_payload "
t . string " desc "
t . integer " port "
t . string " platform "
t . text " datastore "
2015-04-06 16:59:38 +00:00
t . datetime " opened_at " , null : false
2013-03-14 20:46:18 +00:00
t . datetime " closed_at "
t . string " close_reason "
t . integer " local_id "
t . datetime " last_seen "
2015-04-06 16:59:38 +00:00
t . integer " module_run_id "
2013-03-14 20:46:18 +00:00
end
2015-04-06 16:59:38 +00:00
add_index " sessions " , [ " module_run_id " ] , name : " index_sessions_on_module_run_id " , using : :btree
2014-09-04 18:06:34 +00:00
create_table " tags " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " user_id "
2014-09-04 18:06:34 +00:00
t . string " name " , limit : 1024
2013-03-14 20:46:18 +00:00
t . text " desc "
2014-09-04 18:06:34 +00:00
t . boolean " report_summary " , default : false , null : false
t . boolean " report_detail " , default : false , null : false
t . boolean " critical " , default : false , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " task_creds " , force : true do | t |
t . integer " task_id " , null : false
t . integer " cred_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-05-24 14:05:54 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " task_hosts " , force : true do | t |
t . integer " task_id " , null : false
t . integer " host_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-05-24 14:05:54 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " task_services " , force : true do | t |
t . integer " task_id " , null : false
t . integer " service_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-06-04 19:21:07 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " task_sessions " , force : true do | t |
t . integer " task_id " , null : false
t . integer " session_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-05-24 14:05:54 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " tasks " , force : true do | t |
t . integer " workspace_id " , default : 1 , null : false
2013-03-14 20:46:18 +00:00
t . string " created_by "
t . string " module "
t . datetime " completed_at "
2014-09-04 18:06:34 +00:00
t . string " path " , limit : 1024
2013-03-14 20:46:18 +00:00
t . string " info "
t . string " description "
t . integer " progress "
t . text " options "
t . text " error "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
t . text " result "
2014-09-04 18:06:34 +00:00
t . string " module_uuid " , limit : 8
2013-03-14 20:46:18 +00:00
t . binary " settings "
end
2014-09-04 18:06:34 +00:00
create_table " users " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . string " username "
t . string " crypted_password "
t . string " password_salt "
t . string " persistence_token "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
t . string " fullname "
t . string " email "
t . string " phone "
t . string " company "
2014-09-04 18:06:34 +00:00
t . string " prefs " , limit : 524288
t . boolean " admin " , default : true , null : false
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " vuln_attempts " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " vuln_id "
t . datetime " attempted_at "
t . boolean " exploited "
t . string " fail_reason "
t . string " username "
t . text " module "
t . integer " session_id "
t . integer " loot_id "
t . text " fail_detail "
end
2014-09-04 18:06:34 +00:00
create_table " vuln_details " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " vuln_id "
t . float " cvss_score "
t . string " cvss_vector "
t . string " title "
t . text " description "
t . text " solution "
t . binary " proof "
t . integer " nx_console_id "
t . integer " nx_device_id "
t . string " nx_vuln_id "
t . float " nx_severity "
t . float " nx_pci_severity "
t . datetime " nx_published "
t . datetime " nx_added "
t . datetime " nx_modified "
t . text " nx_tags "
t . text " nx_vuln_status "
t . text " nx_proof_key "
t . string " src "
t . integer " nx_scan_id "
t . datetime " nx_vulnerable_since "
t . string " nx_pci_compliance_status "
end
2014-09-04 18:06:34 +00:00
create_table " vulns " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " host_id "
t . integer " service_id "
t . datetime " created_at "
t . string " name "
t . datetime " updated_at "
2014-09-04 18:06:34 +00:00
t . string " info " , limit : 65536
2013-03-14 20:46:18 +00:00
t . datetime " exploited_at "
2014-09-04 18:06:34 +00:00
t . integer " vuln_detail_count " , default : 0
t . integer " vuln_attempt_count " , default : 0
2015-05-21 18:39:25 +00:00
t . integer " origin_id "
t . string " origin_type "
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
add_index " vulns " , [ " name " ] , name : " index_vulns_on_name " , using : :btree
2015-05-21 18:39:25 +00:00
add_index " vulns " , [ " origin_id " ] , name : " index_vulns_on_origin_id " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " vulns_refs " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . integer " ref_id "
t . integer " vuln_id "
end
2014-09-04 18:06:34 +00:00
create_table " web_forms " , force : true do | t |
t . integer " web_site_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
t . text " path "
2014-09-04 18:06:34 +00:00
t . string " method " , limit : 1024
2013-03-14 20:46:18 +00:00
t . text " params "
t . text " query "
end
2014-09-04 18:06:34 +00:00
add_index " web_forms " , [ " path " ] , name : " index_web_forms_on_path " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " web_pages " , force : true do | t |
t . integer " web_site_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2013-03-14 20:46:18 +00:00
t . text " path "
t . text " query "
2014-09-04 18:06:34 +00:00
t . integer " code " , null : false
2013-03-14 20:46:18 +00:00
t . text " cookie "
t . text " auth "
t . text " ctype "
t . datetime " mtime "
t . text " location "
t . text " headers "
t . binary " body "
t . binary " request "
end
2014-09-04 18:06:34 +00:00
add_index " web_pages " , [ " path " ] , name : " index_web_pages_on_path " , using : :btree
add_index " web_pages " , [ " query " ] , name : " index_web_pages_on_query " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " web_sites " , force : true do | t |
t . integer " service_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . string " vhost " , limit : 2048
2013-03-14 20:46:18 +00:00
t . text " comments "
t . text " options "
end
2014-09-04 18:06:34 +00:00
add_index " web_sites " , [ " comments " ] , name : " index_web_sites_on_comments " , using : :btree
add_index " web_sites " , [ " options " ] , name : " index_web_sites_on_options " , using : :btree
add_index " web_sites " , [ " vhost " ] , name : " index_web_sites_on_vhost " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " web_vulns " , force : true do | t |
t . integer " web_site_id " , null : false
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . text " path " , null : false
t . string " method " , limit : 1024 , null : false
t . text " params " , null : false
2013-07-17 16:46:08 +00:00
t . text " pname "
2014-09-04 18:06:34 +00:00
t . integer " risk " , null : false
t . string " name " , limit : 1024 , null : false
2013-03-14 20:46:18 +00:00
t . text " query "
2014-09-04 18:06:34 +00:00
t . text " category " , null : false
t . integer " confidence " , null : false
2013-03-14 20:46:18 +00:00
t . text " description "
t . text " blame "
t . binary " request "
2014-09-04 18:06:34 +00:00
t . binary " proof " , null : false
2013-03-14 20:46:18 +00:00
t . string " owner "
t . text " payload "
end
2014-09-04 18:06:34 +00:00
add_index " web_vulns " , [ " method " ] , name : " index_web_vulns_on_method " , using : :btree
add_index " web_vulns " , [ " name " ] , name : " index_web_vulns_on_name " , using : :btree
add_index " web_vulns " , [ " path " ] , name : " index_web_vulns_on_path " , using : :btree
2013-03-14 20:46:18 +00:00
2014-09-04 18:06:34 +00:00
create_table " wmap_requests " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . string " host "
2014-09-04 18:06:34 +00:00
t . inet " address "
2013-03-14 20:46:18 +00:00
t . integer " port "
t . integer " ssl "
2014-09-04 18:06:34 +00:00
t . string " meth " , limit : 32
2013-03-14 20:46:18 +00:00
t . text " path "
t . text " headers "
t . text " query "
t . text " body "
2014-09-04 18:06:34 +00:00
t . string " respcode " , limit : 16
2013-03-14 20:46:18 +00:00
t . text " resphead "
t . text " response "
t . datetime " created_at "
t . datetime " updated_at "
end
2014-09-04 18:06:34 +00:00
create_table " wmap_targets " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . string " host "
2014-09-04 18:06:34 +00:00
t . inet " address "
2013-03-14 20:46:18 +00:00
t . integer " port "
t . integer " ssl "
t . integer " selected "
t . datetime " created_at "
t . datetime " updated_at "
end
2014-09-04 18:06:34 +00:00
create_table " workspace_members " , id : false , force : true do | t |
t . integer " workspace_id " , null : false
t . integer " user_id " , null : false
2013-03-14 20:46:18 +00:00
end
2014-09-04 18:06:34 +00:00
create_table " workspaces " , force : true do | t |
2013-03-14 20:46:18 +00:00
t . string " name "
2015-04-21 21:51:27 +00:00
t . datetime " created_at " , null : false
t . datetime " updated_at " , null : false
2014-09-04 18:06:34 +00:00
t . string " boundary " , limit : 4096
t . string " description " , limit : 4096
2013-03-14 20:46:18 +00:00
t . integer " owner_id "
2014-09-04 18:06:34 +00:00
t . boolean " limit_to_network " , default : false , null : false
2013-03-14 20:46:18 +00:00
end
end