Skip to content

Commit a798bb6

Browse files
authored
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 <hackndo@gmail.com>
1 parent 6d4fdfd commit a798bb6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

nxc/modules/runasppl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def on_admin_login(self, context, connection):
1717
command = r"reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\ /v RunAsPPL"
1818
context.log.debug(f"Executing command: {command}")
1919
p = connection.execute(command, True)
20-
if "The system was unable to find the specified registry key or value" in p:
20+
if not p or "The system was unable to find the specified registry key or value" in p:
2121
context.log.debug("Unable to find RunAsPPL Registry Key")
2222
else:
2323
context.log.highlight(p)

0 commit comments

Comments
 (0)