Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/post/solaris/gather/enum_services.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::File7include Msf::Post::Solaris::System89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Solaris Gather Configured Services',14'Description' => %q{15Post module to enumerate services on a Solaris System16},17'License' => MSF_LICENSE,18'Author' => [ 'Carlos Perez <carlos_perez[at]darkoperator.com>'],19'Platform' => [ 'solaris' ],20'SessionTypes' => [ 'shell' ]21)22)23end2425# Run Method for when run command is issued26def run27distro = get_sysinfo28store_loot('solaris.version', 'text/plain', session, "Distro: #{distro[:hostname]}, Version: #{distro[:version]}, Kernel: #{distro[:kernel]}", 'solaris_info.txt', 'Solaris Version')2930# Print the info31print_good('Info:')32print_good("\t#{distro[:version]}")33print_good("\t#{distro[:kernel]}")34installed_pkg = get_services35pkg_loot = store_loot('solaris.services', 'text/plain', session, installed_pkg, 'configured_services.txt', 'Solaris Configured Services')36print_good("Service list saved to loot file: #{pkg_loot}")37if datastore['VERBOSE']38print_good('Services:')3940# Print the Packages41installed_pkg.each_line do |p|42print_good("\t#{p.chomp}")43end44end45end4647def get_services48services_installed = ''49services_installed = cmd_exec('/usr/bin/svcs -a')50return services_installed51end52end535455