From d9357922422f0df5d4cc5ba2e82aa3473d69a56b Mon Sep 17 00:00:00 2001 From: Dobin Rutishauser Date: Wed, 26 Jun 2024 06:23:51 +0200 Subject: [PATCH] feature: sanity checks --- supermega.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/supermega.py b/supermega.py index d589968..f2e9d0d 100644 --- a/supermega.py +++ b/supermega.py @@ -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