New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize JSON into MDM Objects #9394

wants to merge 57 commits into
base: master


None yet
3 participants

jbarnett-r7 commented Jan 10, 2018

This PR adds a couple of new methods to enable us to deserialize JSON returned from a remote data service to an in-memory MDM object. This will allow easier compatibility with existing code on the framework side while working through conversions to use the remote data service.

Longer term we will use the Mdm object as the abstraction layer and change the backend, but keep the overall object method calls the same with the same functionality, reducing code movement on the framework side.


List the steps needed to make sure this thing works

  • Start msfconsole and msfdb
  • Connect msfconsole to the remote data service
  • Perform regression testing. Add some data, delete some data, pop shells, gather loot. Verify hosts, loot, etc commands still work.

clee-r7 and others added some commits Jul 7, 2017

Move normaliize_host to a library method
This method was in Msf::DbManager class but doesn't actually use the DB.
This required you to have a DB connection just to do the check.
Moved it out to a helper library so we have access to it without forcing
a DB connection.
Proxy session events.
This enables modules to use report_loot with a remote data service
WIP: Drop session objects before JSON conversion
The session object is not intended to be store in the DB.
There are a ton of subobjects and unneeded data that causes the JSON conversion
to hang or fail with 'stack level too deep' errors.

jbarnett-r7 and others added some commits Oct 24, 2017

Connect and get working with net/http.
POST looks to be working too.
Fix bug in db_nmap with RDS
The cmd_db_nmap method was cleaning up the nmap XML file
before it could be read. Making the call synchronous will prevent
it from hitting the ensure block before the processing is done
when running msfdb locally.
Move file processing to helper method.
Also fixed a bug in processing loot files.
Land #1, db_nmap work with remote data service
Make db_nmap Work With Remote Data Service
Implement hosts remote data store delete
Also, resolve an issue when adding a host where the client-side
raises an exception.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment