{"id":20445865,"url":"https://github.com/rapid7/metasploit_data_models","last_synced_at":"2025-05-15T09:06:09.889Z","repository":{"id":2129067,"uuid":"3072132","full_name":"rapid7/metasploit_data_models","owner":"rapid7","description":"MSF database code, gemified","archived":false,"fork":false,"pushed_at":"2025-05-02T11:56:45.000Z","size":4580,"stargazers_count":52,"open_issues_count":0,"forks_count":57,"subscribers_count":107,"default_branch":"master","last_synced_at":"2025-05-02T12:46:12.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rapid7.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-12-30T01:15:12.000Z","updated_at":"2025-05-02T11:56:49.000Z","dependencies_parsed_at":"2024-02-07T14:29:36.365Z","dependency_job_id":"3f23b0f2-0df8-40ed-b6c2-025ac39e269a","html_url":"https://github.com/rapid7/metasploit_data_models","commit_stats":{"total_commits":1357,"total_committers":53,"mean_commits":25.60377358490566,"dds":0.5836403831982314,"last_synced_commit":"1bca1a4a8f92fde65435e137f5067f0d6fa3614e"},"previous_names":[],"tags_count":236,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit_data_models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit_data_models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit_data_models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit_data_models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapid7","download_url":"https://codeload.github.com/rapid7/metasploit_data_models/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310514,"owners_count":22049469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:15:08.049Z","updated_at":"2025-05-15T09:06:09.866Z","avatar_url":"https://github.com/rapid7.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"#MetasploitDataModels [![Build Status](https://travis-ci.org/rapid7/metasploit_data_models.png)](https://travis-ci.org/rapid7/metasploit_data_models)[![Code Climate](https://codeclimate.com/github/rapid7/metasploit_data_models.png)](https://codeclimate.com/github/rapid7/metasploit_data_models)[![Dependency Status](https://gemnasium.com/rapid7/metasploit_data_models.png)](https://gemnasium.com/rapid7/metasploit_data_models)[![Gem Version](https://badge.fury.io/rb/metasploit_data_models.png)](http://badge.fury.io/rb/metasploit_data_models)\n\nPart of Metasploit's database layer\n\n## Purpose\n__MetasploitDataModels__ exists to do several key things:\n\n1. Allow code sharing between Metasploit Framework (MSF) and the commercial versions of Metasploit (Community, Express, Pro -- usually referred to collectively as \"Pro\")\n\n2. Give developers a lightweight entry point to MSF's backend for use in developing tools that gather data intended for later use with Metasploit (e.g. specialized scanners).\n\n3. Make it easy to keep commercial stuff private while increasing the functionality of the open-source tools we provide to the community.\n\n\n## Usage\n\n### Rails\n\nIn a Rails application, MetasploitDataModels acts a\n[Rails Engine](http://edgeapi.rubyonrails.org/classes/Rails/Engine.html) and the models are available to application\njust as if they were defined under `app/models`.  If your Rails appliation needs to modify the models, this can be done\nusing `ActiveSupport.on_load` hooks in initializers.  The block passed to on_load hook is evaluated in the context of the\nmodel class, so defining method and including modules will work just like reopeninng the class, but\n`ActiveSupport.on_load` ensures that the monkey patches will work after reloading in development mode.  Each class has a\ndifferent `on_load` name, which is just the class name converted to an underscored symbol, so `Mdm::ApiKey` runs the\n`:mdm_api_key` load hooks, etc.\n\n    # Gemfile\n    gem :metasploiit_data_models, :git =\u003e git://github.com/rapid7/metasploit_data_models.git, :tag =\u003e 'v0.3.0'\n\n    # config/initializers/metasploit_data_models.rb\n    ActiveSupport.on_load(:mdm_api_key) do\n      # Returns the String obfuscated token for display. Meant to avoid CSRF\n      # api-key stealing attackes.\n      def obfuscated_token\n        token[0..3] + \"****************************\"\n      end\n    end\n\n**This gem's `Rails::Engine` is not required automatically.** You'll need to also add the following to your `config/application.rb`:\n\n    require 'metasploit_data_models/engine'\n\n`ArelHelper` classes must also be included in your applications `app/models/application_record.rb` class:\n\n    class ApplicationRecord \u003c ActiveRecord::Base\n      self.abstract_class = true\n      include ArelHelpers::ArelTable\n      include ArelHelpers::JoinAssociation\n    end\n\n### Metasploit Framework\n\nIn Metasploit Framework, `MetasploitDataModels::Engine` is loaded, but the data models are only if the user wants to use\nthe database.\n\n### Elsewhere\n\nIn Metasploit Pro, MDM is loaded via the metasploit_data_models gem: https://rubygems.org/gems/metasploit_data_models\n\n## Developer Info\n\n### Console\nThe gem includes a console based on [Pry](https://github.com/pry/pry/)\n\nGive it a path to a working MSF database.yml file for full\nActiveRecord-based access to your data.\n\n__Note:__ \"development\" mode is hardcoded into the console currently.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fmetasploit_data_models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapid7%2Fmetasploit_data_models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fmetasploit_data_models/lists"}