diff --git a/nxc/helpers/powershell.py b/nxc/helpers/powershell.py index fd73d85d..227325f2 100644 --- a/nxc/helpers/powershell.py +++ b/nxc/helpers/powershell.py @@ -149,7 +149,7 @@ def create_ps_command(ps_command, force_ps32=False, obfs=False, custom_amsi=None amsi_bypass = "" # for readability purposes, we do not do a one-liner - if force_ps32: + if force_ps32: # noqa: SIM108 # https://stackoverflow.com/a/60155248 command = amsi_bypass + f"$functions = {{function Command-ToExecute{{{amsi_bypass + ps_command}}}}}; if ($Env:PROCESSOR_ARCHITECTURE -eq 'AMD64'){{$job = Start-Job -InitializationScript $functions -ScriptBlock {{Command-ToExecute}} -RunAs32; $job | Wait-Job | Receive-Job }} else {{IEX '$functions'; Command-ToExecute}}" else: