feature: sanity checks

This commit is contained in:
Dobin Rutishauser
2024-06-26 06:23:51 +02:00
parent 2b576df872
commit d935792242
+12
View File
@@ -129,6 +129,15 @@ def start(settings: Settings) -> int:
return 0
def sanity_checks(settings):
if 'dll_loader' in settings.carrier_name:
if not settings.payload_path.endswith(".dll"):
raise Exception("dll loader requires a dll as payload, not shellcode")
else:
if not settings.payload_path.endswith(".bin"):
raise Exception("loader requires shellcode as payload, not DLL")
def start_real(settings: Settings):
"""Main entry point for the application. This is where the magic happens (based on settings)"""
@@ -152,6 +161,9 @@ def start_real(settings: Settings):
project.settings.plugin_guardrail)
)
# Tell user if they attempt to do something stupid
sanity_checks(project.settings)
# FIXUP DLL Payload
# Prepare DLL payload for usage in dll_loader_change
# This needs to be done before rendering the C templates, as need