Commit Graph

542 Commits

Author SHA1 Message Date
Jeffrey Martin 7505e1bf71 Consolidate logic for actions taken on a workspace
* When renaming a workspace allow validation to handle all cases the same
* Do not display backtrace on console for rename failure, this is still logged to framework.log
2019-10-15 16:12:11 -05:00
Brent Cook 42c0a3b96a deprecate the db_rebuild_cache command, add reload_search
For a while, Metasploit has not used the old database-backed module cache in favor of the lightweight JSON data store. This also means that the db_rebuild_cache command has been broken.

While the base module cache usually stays up to date, if you delete a module as a developer, there's currently no great way to make the search function forget about that module unless you rebuild the cache manually (a procedure mostly documented inside of an automated build job).

This moves the logic from that build job into the a new reload_search command, and deprecates the old one.
2019-06-29 03:36:39 -05:00
William Vu bea3659475 Fix truncated range 2019-05-23 15:41:38 -05:00
Matthew Kienow d15095f452 Land #11191, add analyze command 2019-02-19 21:50:20 -05:00
James Barnett a2548fe92d Only lookup db connections by name
Matching on all attributes was causing issues when the connection
criteria would change for a db service at a host that already existed.
It would find the existing connection and load that outdated connection
and fail to connect.

The new functionality will save a new, valid connection with a randomly
generated name, unless the -n flag is specified to overwrite an existing
connection.
2019-01-08 15:21:14 -06:00
Jeffrey Martin 288cbd2386 add analyze command 2018-12-13 18:21:00 -06:00
James Barnett e36e27d91a Port is optional for HTTP data services 2018-12-05 16:05:09 -06:00
James Barnett 1e57f025d9 Update db_connect help 2018-12-05 14:52:26 -06:00
Brendan Coles e231fd0623 next if onlyup 2018-11-10 16:21:06 +00:00
Matthew Kienow 34f87efb2b Land #10532, enhance db_connect for data services 2018-09-03 09:43:34 -04:00
James Barnett 1c8a2f3ee1 Raise an error when http service fails to connect
Also fix a bug where failed Postgres connections werent being raised
2018-09-02 15:51:13 -05:00
James Barnett b4c731d4ca Check name validity at a higher level 2018-08-31 18:16:32 -05:00
James Barnett 084607b955 Set current_data_service when disconnecting from http 2018-08-31 16:48:33 -05:00
James Barnett 185fe56e82 Add message when connecting via yaml 2018-08-31 16:13:17 -05:00
James Barnett a413b27e57 Fix bug connecting to https servers 2018-08-31 15:49:29 -05:00
James Barnett 1e6f19e1de Update db_save message when no valid service connected
Also add the current data service name to db_status
2018-08-31 12:54:08 -05:00
James Barnett bc4a0345dc Fix bug preventing yaml connections 2018-08-31 11:26:08 -05:00
James Barnett 6ddf4f4c22 Refactor db_connect for updated usage
db_connect will now automatically save the data service it connects to
db_save will be used to set the current data service as default
add a db_remove command to delete a saved data service
2018-08-30 18:19:14 -05:00
James Barnett d6d9f9c675 Handle case for no connection for save and disconnect 2018-08-29 13:54:20 -05:00
James Barnett 133892629e Dont allow invalid config file characters
Also only save cert when it is present
2018-08-29 12:49:03 -05:00
James Barnett f7ecd4436d Even more messaging changes 2018-08-29 11:32:01 -05:00
James Barnett 65f38d6051 More messaging changes 2018-08-29 11:19:37 -05:00
James Barnett 28954dbc1d More messaging improvements 2018-08-28 17:14:59 -05:00
James Barnett cc5d96a441 Update messaging 2018-08-28 17:00:58 -05:00
James Barnett 52cc140cd2 Handle case where no default db is set 2018-08-28 15:52:26 -05:00
James Barnett 5e45e2f1e9 Add help text for -l and -n options 2018-08-28 11:42:10 -05:00
James Barnett 3c1086741b Use correct variable name for api_token 2018-08-28 10:49:50 -05:00
James Barnett 5b7127c826 Use Rex::Text::Table for outputting data services 2018-08-27 13:18:41 -05:00
James Barnett 24cf99f59c Enable deletion of saved data services 2018-08-27 11:32:19 -05:00
James Barnett bb0ec0472b Enable saving local data services 2018-08-24 12:51:50 -05:00
James Barnett 724e0dcaf3 Add ability to connect to saved data services 2018-08-22 17:16:27 -05:00
William Vu 2891255549 Clarify what is being imported currently
Since the parser is focused on creds.
2018-08-22 15:53:19 -05:00
William Vu b1c633faf6 Add Group Policy Preferences support to db_import
And take the Jaden Smith approach, as @busterb quipped to me. :)

This one's a little weird, since you normally import scans into
Metasploit, but now that creds are first-class in the database, it makes
more sense to be able to import them.

Currently, your alternatives are post/windows/gather/credentials/gpp,
which requires a session, and auxiliary/scanner/smb/smb_enum_gpp, which
requires a network scan.
2018-08-21 23:44:39 -05:00
James Barnett b6401dbe56 Add db_save command 2018-08-21 11:10:43 -05:00
James Barnett f05844d8f4 Refactor options handling and help printing 2018-08-15 11:48:03 -05:00
James Barnett c8dc5967d2 Remove data_services commands
db_connect is now the preferred method of connecting
2018-08-08 17:47:17 -05:00
James Barnett d7dcdce7a8 Add more information when already connected to a db 2018-08-08 13:32:25 -05:00
James Barnett cfe1ea86fb Only allow one http connection at a time 2018-08-08 13:20:46 -05:00
James Barnett 387d784ddc Implement db_disconnect for remote data service
And a couple of fixes for db_connect for remote data services
2018-08-07 14:03:38 -05:00
James Barnett df607ddd16 Enable connecting to remote data services with db_connect 2018-08-03 13:38:02 -05:00
Matthew Kienow 257a05d5d7 Add long port option for data_services cmd 2018-07-18 14:29:32 -04:00
Matthew Kienow 65c290fa39 Make API token optional on data_services cmd 2018-07-16 16:44:44 -04:00
Matthew Kienow 77a0b74f76 Add delete option to data_services cmd 2018-07-05 16:40:55 -04:00
Matthew Kienow 514c0c76d5 Add API token to RemoteHTTPDataService 2018-07-02 18:34:35 -04:00
Matthew Kienow 4ecc1ff551 Modify loots, notes and services search methods
Modify loots and services method signatures. Remove workspace as a
positional argument, move into opts hash argument and update callers.
Made host search for these models more uniform. Update find_or_create
methods to handle difference in opts between find and report
operations.
2018-05-21 17:37:51 -04:00
Matthew Kienow b3a1f2531b Update to use new hosts DataProxy method signature 2018-05-14 17:38:49 -04:00
christopher lee 038fe03777 Merge branch 'master' into ms-2962 2018-05-02 15:31:57 -05:00
christopher lee 516b61ebaa Merged master 2018-04-26 16:02:56 -05:00
Matthew Kienow c79e39377e Narrow rescue scope to StandardError 2018-04-26 14:55:41 -04:00
James Barnett a5172e066d Land #9926, check remote data service before connecting
This PR adds a check prior to connecting to a remote data service
to verify it is online and returning expected data. This prevents
crashes that were occurring when unexpected responses were returned
2018-04-25 14:07:33 -05:00