@@ -89,11 +89,10 @@ def get_shell_history(users, user, shell)
89
89
if user == 'root' && !users . nil?
90
90
users = users . chomp . split
91
91
users . each do |u |
92
+ vprint_status ( "Extracting #{ shell } history for #{ u } " )
92
93
if u == 'root'
93
- vprint_status ( "Extracting #{ shell } history for #{ u } " )
94
94
hist = cat_file ( "/root/.#{ shell } _history" )
95
95
else
96
- vprint_status ( "Extracting #{ shell } history for #{ u } " )
97
96
hist = cat_file ( "/home/#{ u } /.#{ shell } _history" )
98
97
end
99
98
save ( "#{ shell } History for #{ u } " , hist ) unless hist . blank? || hist =~ /No such file or directory/
@@ -110,11 +109,10 @@ def get_mysql_history(users, user)
110
109
if user == 'root' && !users . nil?
111
110
users = users . chomp . split
112
111
users . each do |u |
112
+ vprint_status ( "Extracting MySQL history for #{ u } " )
113
113
if u == 'root'
114
- vprint_status ( "Extracting MySQL history for #{ u } " )
115
114
sql_hist = cat_file ( '/root/.mysql_history' )
116
115
else
117
- vprint_status ( "Extracting MySQL history for #{ u } " )
118
116
sql_hist = cat_file ( "/home/#{ u } /.mysql_history" )
119
117
end
120
118
save ( "MySQL History for #{ u } " , sql_hist ) unless sql_hist . blank? || sql_hist =~ /No such file or directory/
@@ -131,11 +129,10 @@ def get_psql_history(users, user)
131
129
if user == 'root' && !users . nil?
132
130
users = users . chomp . split
133
131
users . each do |u |
132
+ vprint_status ( "Extracting PostgreSQL history for #{ u } " )
134
133
if u == 'root'
135
- vprint_status ( "Extracting PostgreSQL history for #{ u } " )
136
134
sql_hist = cat_file ( '/root/.psql_history' )
137
135
else
138
- vprint_status ( "Extracting PostgreSQL history for #{ u } " )
139
136
sql_hist = cat_file ( "/home/#{ u } /.psql_history" )
140
137
end
141
138
save ( "PostgreSQL History for #{ u } " , sql_hist ) unless sql_hist . blank? || sql_hist =~ /No such file or directory/
@@ -152,17 +149,16 @@ def get_vim_history(users, user)
152
149
if user == 'root' && !users . nil?
153
150
users = users . chomp . split
154
151
users . each do |u |
152
+ vprint_status ( "Extracting VIM history for #{ u } " )
155
153
if u == 'root'
156
- vprint_status ( "Extracting VIM history for #{ u } " )
157
154
vim_hist = cat_file ( '/root/.viminfo' )
158
155
else
159
- vprint_status ( "Extracting VIM history for #{ u } " )
160
156
vim_hist = cat_file ( "/home/#{ u } /.viminfo" )
161
157
end
162
158
save ( "VIM History for #{ u } " , vim_hist ) unless vim_hist . blank? || vim_hist =~ /No such file or directory/
163
159
end
164
160
else
165
- vprint_status ( "Extracting history for #{ user } " )
161
+ vprint_status ( "Extracting VIM history for #{ user } " )
166
162
vim_hist = cat_file ( "/home/#{ user } /.viminfo" )
167
163
vprint_status ( vim_hist )
168
164
save ( "VIM History for #{ user } " , vim_hist ) unless vim_hist . blank? || vim_hist =~ /No such file or directory/
0 commit comments