Skip to content

Commit 73fdc06

Browse files
committed
Fix enum_xchat to work with meterpreter
1 parent b476505 commit 73fdc06

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

modules/post/linux/gather/enum_xchat.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ def initialize(info={})
2020
.log files.
2121
},
2222
'License' => MSF_LICENSE,
23-
'Author' => [ 'sinn3r'],
24-
'Platform' => [ 'linux' ],
23+
'Author' => ['sinn3r'],
24+
'Platform' => ['linux'],
2525
# linux meterpreter is too busted to support right now,
2626
# will come back and add support once it's more usable.
27-
'SessionTypes' => [ 'shell' ],
27+
'SessionTypes' => ['shell', 'meterpreter'],
2828
'Actions' =>
2929
[
3030
['CONFIGS', { 'Description' => 'Collect XCHAT\'s config files' } ],
@@ -62,7 +62,7 @@ def get_file(file)
6262
end
6363

6464
def whoami
65-
user = cmd_exec("whoami").chomp
65+
user = cmd_exec("/usr/bin/whoami").chomp
6666
return user
6767
end
6868

@@ -120,7 +120,7 @@ def get_configs(base)
120120
files.each do |f|
121121
vprint_status("#{@peer} - Downloading: #{base + f}")
122122
buf = read_file(base + f)
123-
next if buf.empty?
123+
next if buf.blank?
124124
config << {
125125
:filename => f,
126126
:data => buf
@@ -139,7 +139,7 @@ def run
139139
@peer = "#{session.session_host}:#{session.session_port}"
140140

141141
user = whoami
142-
if user.nil?
142+
if user.blank?
143143
print_error("#{@peer} - Unable to get username, abort.")
144144
return
145145
end
@@ -149,8 +149,8 @@ def run
149149
configs = get_configs(base) if action.name =~ /ALL|CONFIGS/i
150150
chatlogs = get_chatlogs(base) if action.name =~ /ALL|CHATS/i
151151

152-
save(:configs, configs) if not configs.empty?
153-
save(:chatlogs, chatlogs) if not chatlogs.empty?
152+
save(:configs, configs) unless configs.empty?
153+
save(:chatlogs, chatlogs) unless chatlogs.empty?
154154
end
155155

156156
end

0 commit comments

Comments
 (0)