Report
Msf::Auxiliary::Report provides APIs for saving data to the Metasploit database. Its implementation is lib/msf/core/auxiliary/report.rb. HttpClient includes it too.
Main APIs
Section titled “Main APIs”| Method | Purpose |
|---|---|
report_host | Register a host |
report_service | Register a service |
report_note | Save a free-form note |
report_vuln | Record a vulnerability |
report_loot | Record loot metadata |
store_loot | Save the file and index it as loot |
create_credential | Save a credential |
create_credential_login | Record a successful login |
create_credential_and_login | Do both together |
invalidate_login | Record a failed login |
myworkspace / myworkspace_id | Current workspace |
Examples
Section titled “Examples”report_service( host: rhost, port: rport, proto: 'tcp', name: 'http', info: 'ExampleApp 1.2')
report_note( host: rhost, type: 'example.version', data: { version: '1.2' }, update: :unique_data)
report_vuln( host: rhost, port: rport, name: 'Example RCE', refs: references)path = store_loot( 'example.config', # ltype 'text/plain', # ctype rhost, # host or session res.body, # data 'config.php', # filename 'Application config' # info)print_good("Loot: #{path}")create_credential_and_login( address: rhost, port: rport, service_name: 'ssh', protocol: 'tcp', workspace_id: myworkspace_id, origin_type: :service, module_fullname: fullname, username: user, private_data: pass, private_type: :password, status: Metasploit::Model::Login::Status::SUCCESSFUL)Modules still run without a database, but these calls become effectively no-ops or produce warnings. In a test environment, prepare msfdb first as described in Basics and the Database.
For helper examples, also see Reporting Helpers.

