CP: How to get a secret with Hash authentication via a Powershell script launched from Windows Task Scheduler

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CP: How to get a secret with Hash authentication via a Powershell script launched from Windows Task Scheduler

L1 Bithead

AppProvider version: 13.0.0.6

PVWA version: 13.0.0.13

Vault version: 12.6.0.21

 

Problem:

Try to get a secret via the CP CLI Application Password SDK.

The CLI SDK is called via Powershell.

The script is launched from a scheduled task in Windows Task Scheduler.

The Application's authentication is Hash authentication.

 

Even if the powershell.exe is added to the TrustedCLIShells in the CP config, the log says "APPAP309E Script run using untrusted shell"

 

1 accepted solution

Accepted Solutions

L1 Bithead

Solution:

Add the "C:\Windows\System32\svchost.exe" to the TrustedCLIShells in the CP config additionally to the powershell.exe.

Add the Hash of the powershell script to the Application in PVWA.

 

Explanation:

The powershell.exe application is started from the svchost.exe within the Windows process tree.

This can be verified with the Sysmon tool (https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon)

 

You'll find the following output (truncated for readability:)

ParentImage: C:\Windows\System32\svchost.exe

ParentCommandLine: C:\WINDOWS\system32\svchost.exe -k netsvcs -p -s Schedule

ParentUser: NT-AUTORITÄT\SYSTEM

View solution in original post

1 REPLY 1

L1 Bithead

Solution:

Add the "C:\Windows\System32\svchost.exe" to the TrustedCLIShells in the CP config additionally to the powershell.exe.

Add the Hash of the powershell script to the Application in PVWA.

 

Explanation:

The powershell.exe application is started from the svchost.exe within the Windows process tree.

This can be verified with the Sysmon tool (https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon)

 

You'll find the following output (truncated for readability:)

ParentImage: C:\Windows\System32\svchost.exe

ParentCommandLine: C:\WINDOWS\system32\svchost.exe -k netsvcs -p -s Schedule

ParentUser: NT-AUTORITÄT\SYSTEM

  • 1 accepted solution
  • 617 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!