Giter Club home page Giter Club logo

metasploit_data_models's Introduction

#MetasploitDataModels Build StatusCode ClimateCoverage StatusDependency StatusGem Version

The database layer for Metasploit

Purpose

MetasploitDataModels exists to do several key things:

  1. Allow code sharing between Metasploit Framework (MSF) and the commercial versions of Metasploit (Community, Express, Pro -- usually referred to collectively as "Pro")

  2. 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).

  3. Make it easy to keep commercial stuff private while increasing the functionality of the open-source tools we provide to the community.

Usage

Rails

In a Rails application, MetasploitDataModels acts a Rails Engine and the models are available to application just as if they were defined under app/models. If your Rails appliation needs to modify the models, this can be done using ActiveSupport.on_load hooks in initializers. The block passed to on_load hook is evaluated in the context of the model class, so defining method and including modules will work just like reopeninng the class, but ActiveSupport.on_load ensures that the monkey patches will work after reloading in development mode. Each class has a different on_load name, which is just the class name converted to an underscored symbol, so Mdm::ApiKey runs the :mdm_api_key load hooks, etc.

# Gemfile
gem :metasploiit_data_models, :git => git://github.com/rapid7/metasploit_data_models.git, :tag => 'v0.3.0'

# config/initializers/metasploit_data_models.rb
ActiveSupport.on_load(:mdm_api_key) do
  # Returns the String obfuscated token for display. Meant to avoid CSRF
  # api-key stealing attackes.
  def obfuscated_token
    token[0..3] + "****************************"
  end
end

This gem's Rails::Engine is not required automatically. You'll need to also add the following to your config/application.rb:

require 'metasploit_data_models/engine'

Metasploit Framework

In Metasploit Framework, MetasploitDataModels::Engine is loaded, but the data models are only if the user wants to use the database.

Elsewhere

In Metasploit Pro, MDM is loaded via the metasploit_data_models gem: https://rubygems.org/gems/metasploit_data_models

An MRI and JRuby implementation is generated for all substantial updates.

Developer Info

Console

The gem includes a console based on Pry

Give it a path to a working MSF database.yml file for full ActiveRecord-based access to your data.

Note: "development" mode is hardcoded into the console currently.

Contributing

See CONTRIBUTING.md

metasploit_data_models's People

Contributors

limhoff-r7 avatar trosen-r7 avatar shuckins-r7 avatar mbuck-r7 avatar egypt avatar farias-r7 avatar jvennix-r7 avatar techpeace avatar bturner-r7 avatar sgonzalez-r7 avatar jhart-r7 avatar ccatalan-r7 avatar todb avatar joevennix avatar gmikeska-r7 avatar ethompson-r7 avatar jvazquez-r7 avatar wchen-r7 avatar blt04 avatar cdoughty-r7 avatar tabassassin avatar trevrosen avatar gen0cide avatar

Watchers

CyrusYzGTt avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.