From a798bb69c2f74316dd6494edb3ab99cdf53f7cc6 Mon Sep 17 00:00:00 2001 From: Pixis Date: Wed, 16 Oct 2024 11:25:40 +0200 Subject: [PATCH] Update runasppl.py `execute()` method of `smb` class returns False if an error occurred. https://github.com/Pennyw0rth/NetExec/blob/main/nxc/protocols/smb.py#L766 If so, the current code fails as `False` is not iterable. This fix will check if `p` is not `False` before checking the error message in `p` Signed-off-by: Pixis --- nxc/modules/runasppl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxc/modules/runasppl.py b/nxc/modules/runasppl.py index 15f6bccd..917e893c 100644 --- a/nxc/modules/runasppl.py +++ b/nxc/modules/runasppl.py @@ -17,7 +17,7 @@ class NXCModule: command = r"reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\ /v RunAsPPL" context.log.debug(f"Executing command: {command}") p = connection.execute(command, True) - if "The system was unable to find the specified registry key or value" in p: + if not p or "The system was unable to find the specified registry key or value" in p: context.log.debug("Unable to find RunAsPPL Registry Key") else: context.log.highlight(p)