A script that runs powershell but keeps the Authenticode Signature valid

Hello :slight_smile:

Thank you very much for the many nice procedures. Sadly I am not good with python and the encoding really makes me crazy :P. I tried to modify the Run powershell script in a way so it respects the Authenticode Signature of my script but sadly I am unable to keep the Signature intact.

It would be very nice to have a Python Script that can run a signed powershell script.

I hope you guys can help me out with this request.

Thank you very very much in advance :slight_smile:

I added a sample script as an attachment which is digitally signed and can be used for testing. It should run with:

powershell.exe -ex AllSigned -File <PSFile>

SignedScript.ps1.txt (8.04 KB)

Ok. I spend a little time thinking about my issue. I build a little work around using Base64 encoding. I verified the execution in my lab envoirnment but sadly when using ITarian the script procedure does not run.

It is not that it throws an error or anything like my scripts before it is that just nothing happens on the client. Are there any limitations on running scripts using ITarian?

The script is attached maybe someone form ITarian can give me a hint why this script won’t even start :).

test.py.txt (27.4 KB)

OK found it out myself :). The one single line was the issue. After splitting the Base64 encoded string into multiple lines everything worked perfectly :slight_smile: