Skip to content

Commit 2b6f823

Browse files
committed
store vuln attempt when reported
1 parent 99fa52e commit 2b6f823

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

lib/msf/core/auxiliary/report.rb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,28 @@ def report_vuln(opts={})
274274
:workspace => myworkspace,
275275
:task => mytask
276276
}.merge(opts)
277-
framework.db.report_vuln(opts)
277+
vuln = framework.db.report_vuln(opts)
278+
279+
# add vuln attempt audit details here during report
280+
281+
timestamp = opts[:timestamp]
282+
username = opts[:username]
283+
mname = self.fullname # use module name when reporting attempt for correlation
284+
285+
# report_vuln is only called in an identified case, consider setting value reported here
286+
attempt_info = {
287+
:vuln_id => vuln.id,
288+
:attempted_at => timestamp || Time.now.utc,
289+
:exploited => false,
290+
:fail_detail => 'vulnerability identified',
291+
:fail_reason => 'Untried', # Mdm::VulnAttempt::Status::UNTRIED, avoiding direct dependency on Mdm, used elsewhere in this module
292+
:module => mname,
293+
:username => username || "unknown",
294+
}
295+
296+
vuln.vuln_attempts.create(attempt_info)
297+
298+
vuln
278299
end
279300

280301
# This will simply log a deprecation warning, since report_exploit()

0 commit comments

Comments
 (0)