Add back enum_protections with some new changes

This commit is contained in:
sinn3r 2012-03-17 16:00:20 -05:00
parent d79f89b190
commit acac3fa38d
1 changed files with 9 additions and 10 deletions

View File

@ -32,9 +32,8 @@ class Metasploit3 < Msf::Post
'License' => MSF_LICENSE,
'Author' =>
[
'ohdae <bindshell[at]live.com>',
'ohdae <bindshell[at]live.com>'
],
'Version' => '$Revision$',
'Platform' => [ 'linux' ],
'SessionTypes' => [ 'shell' ]
))
@ -64,11 +63,10 @@ class Metasploit3 < Msf::Post
return host
end
def which(cmd)
paths = cmd_exec("echo $PATH").split(':')
for path in paths
def which(env_paths, cmd)
for path in env_paths
if "#{cmd}" == cmd_exec("/bin/ls #{path} | /bin/grep '#{cmd}'")
return "#{path}/#{cmd}"
return "#{path}/#{cmd}"
end
end
return nil
@ -82,14 +80,16 @@ class Metasploit3 < Msf::Post
"psad", "wireshark", "nagios", "nagios", "apparmor", "honeyd", "thpot"
]
env_paths = cmd_exec("echo $PATH").split(":")
apps.each do |a|
output = which("#{a}")
output = which(env_paths, a)
if output
print_good("#{a} found: #{output}")
report_note(
:host_name => get_host,
:type => "protection",
:type => "linux.protection",
:data => output,
:update => :unique_data
)
@ -98,5 +98,4 @@ class Metasploit3 < Msf::Post
print_status("Installed applications saved to notes.")
end
end
end