Reporting Helpers
Examples of helpers that save results in the database or loot. For the API list, see the Report mixin.
store_loot
Section titled “store_loot”path = store_loot( 'app.config', 'application/json', rhost, res.body, 'config.json', 'ExampleApp config dump')print_good("Stored #{path}")In a post module, you can pass session instead of a host.
store_loot('host.passwd', 'text/plain', session, data, 'passwd')report_service / report_note / report_vuln
Section titled “report_service / report_note / report_vuln”report_service(host: rhost, port: 22, proto: 'tcp', name: 'ssh', info: banner)
report_note( host: rhost, type: 'example.users', data: { users: users }, update: :unique_data)
report_vuln( host: rhost, port: rport, name: name, refs: references, info: 'authenticated RCE')Credentials
Section titled “Credentials”create_credential_and_login( workspace_id: myworkspace_id, origin_type: :service, module_fullname: fullname, address: rhost, port: rport, protocol: 'tcp', service_name: 'http', username: datastore['USERNAME'], private_data: datastore['PASSWORD'], private_type: :password, status: Metasploit::Model::Login::Status::SUCCESSFUL)
invalidate_login( address: rhost, port: rport, protocol: 'tcp', public: user, private: pass, realm_key: nil, status: Metasploit::Model::Login::Status::INCORRECT)Checking results at runtime
Section titled “Checking results at runtime”hostsservicescredsvulnsloot
