forked from outflanknl/C2-Tool-Collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKerbHash_bof.s1.py
31 lines (25 loc) · 1.09 KB
/
KerbHash_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
from typing import List, Tuple
from outflank_stage1.task.base_bof_task import BaseBOFTask
from outflank_stage1.task.enums import BOFArgumentEncoding
class KerbHashBOF(BaseBOFTask):
def __init__(self):
super().__init__("KerbHash")
self.parser.description = "Hash passwords to kerberos keys."
self.parser.epilog = (
"Example usage:\n"
" - Hash useraccount password:\n"
" KerbHash Welcome123 adminuser domain.local\n"
" - Hash computeraccount password\n"
" KerbHash Welcome123 SERVER$ domain.local"
)
self.parser.add_argument("password", help="The password to hash.")
self.parser.add_argument("username", help="The username.")
self.parser.add_argument("domain", help="The domain.")
def _encode_arguments_bof(
self, arguments: List[str]
) -> List[Tuple[BOFArgumentEncoding, str]]:
return [
(BOFArgumentEncoding.WSTR, arguments[0]),
(BOFArgumentEncoding.WSTR, arguments[1]),
(BOFArgumentEncoding.WSTR, arguments[2]),
]