Skip to content

Commit 188ef13

Browse files
committed
Encode to b64 with powershell and not certutil
1 parent a4d54d1 commit 188ef13

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

nxc/protocols/wmi/wmiexec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def execute_WithOutput(self, command):
7777

7878
commands = [
7979
f"{self.__shell} {command} 1> {result_output} 2>&1",
80-
f"{self.__shell} certutil -encodehex -f {result_output} {result_output_b64} 0x40000001",
80+
f'{self.__shell} powershell -Command "[Convert]::ToBase64String([IO.File]::ReadAllBytes(\'{result_output}\')) | Out-File -Encoding ASCII \'{result_output_b64}\'"',
8181
f'{self.__shell} for /F "usebackq" %G in ("{result_output_b64}") do reg add HKLM\\{self.__registry_Path} /v {keyName} /t REG_SZ /d "%G" /f',
8282
f"{self.__shell} del /q /f /s {result_output} {result_output_b64}",
8383
]

0 commit comments

Comments
 (0)