2011-06-10 03:08:47 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2011-06-10 03:08:47 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
require 'rex'
|
|
|
|
|
2016-03-07 19:19:55 +00:00
|
|
|
class Metasploit3 < Msf::Post
|
2011-06-10 03:08:47 +00:00
|
|
|
|
2013-09-05 18:41:25 +00:00
|
|
|
include Msf::Post::File
|
|
|
|
include Msf::Post::Solaris::System
|
|
|
|
|
|
|
|
|
|
|
|
def initialize(info={})
|
|
|
|
super( update_info( info,
|
|
|
|
'Name' => 'Solaris Gather Installed Packages',
|
|
|
|
'Description' => %q{ Post Module to enumerate installed packages on a Solaris System},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => [ 'Carlos Perez <carlos_perez[at]darkoperator.com>'],
|
|
|
|
'Platform' => [ 'solaris' ],
|
|
|
|
'SessionTypes' => [ 'shell' ]
|
|
|
|
))
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
# Run Method for when run command is issued
|
|
|
|
def run
|
|
|
|
distro = get_sysinfo
|
|
|
|
print_status("Running Module against #{distro[:hostname]}")
|
|
|
|
packages = cmd_exec("/usr/bin/pkginfo -l")
|
|
|
|
pkg_loot = store_loot("solaris.packages", "text/plain", session, packages, "installed_packages.txt", "Solaris Installed Packages")
|
|
|
|
print_status("Package list saved to loot file: #{pkg_loot}")
|
|
|
|
|
|
|
|
if datastore['VERBOSE']
|
|
|
|
packages.each do |p|
|
|
|
|
print_good("\t#{p.chomp}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2011-06-10 03:08:47 +00:00
|
|
|
end
|