Skip to content

Commit f0a8f40

Browse files
committed
Omitting timestamp from msfconsole search output
SeeRM rapid7#8795 The disclosure date field in the results from the search command where returning with a timestamp that was almost always 00:00:00 UTC. I added a bit of date time formatting to only include the year (4 digit), month (2 digit), and day (2 digit) in the following format: Y-m-d. This date time formatting applies to both searches conducted through the database instance as well as searches performed without a database (slow search).
1 parent 9cd6c5e commit f0a8f40

File tree

1 file changed

+2
-2
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+2
-2
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ def cmd_search(*args)
14881488
next if not o
14891489

14901490
if not o.search_filter(match)
1491-
tbl << [ o.fullname, o.disclosure_date.to_s, o.rank_to_s, o.name ]
1491+
tbl << [ o.fullname, o.disclosure_date.strftime("%Y-%m-%d"), o.rank_to_s, o.name ]
14921492
end
14931493
end
14941494
end
@@ -1503,7 +1503,7 @@ def cmd_search(*args)
15031503
def search_modules_sql(search_string)
15041504
tbl = generate_module_table("Matching Modules")
15051505
framework.db.search_modules(search_string).each do |o|
1506-
tbl << [ o.fullname, o.disclosure_date.to_s, RankingName[o.rank].to_s, o.name ]
1506+
tbl << [ o.fullname, o.disclosure_date.strftime("%Y-%m-%d"), RankingName[o.rank].to_s, o.name ]
15071507
end
15081508
print_line(tbl.to_s)
15091509
end

0 commit comments

Comments
 (0)