redcanaryco / invoke-atomicredteam

Invoke-AtomicRedTeam is a PowerShell module to execute tests as defined in the [atomics folder](https://github.com/redcanaryco/atomic-red-team/tree/master/atomics) of Red Canary's Atomic Red Team project.
MIT License
805 stars 190 forks source link

Invoke-WebRequest The request was aborted: Could not create SSL/TLS secure channel. Error while getting prereq remotely #108

Closed Glacons closed 1 year ago

Glacons commented 1 year ago

Hello,

I m currently testing Invoke-AtomicTest remotely but i have this error when i try to get the prereq on the remote machine : Invoke-WebRequest : The request was aborted: Could not create SSL/TLS secure channel.

I already tried [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 on the machine containing the atomic repo but it's not working. Am i missing something or it's normal ?

I tried those command : Invoke-AtomicTest T1218.010-3 -Session $sess -GetPrereqs

Invoke-AtomicTest T1204.002-10 -Session $sess (don't have prereqs but fetch the lnk file on github).

I can see the command in the event log of the remote machine.

image

Thanks !

clr2of8 commented 1 year ago

Hello and thanks for reaching out (sorry I didn't see this earlier, I need to check my notification settings in github). The security protocol command is what you need but it needs to be executed on the remote machine and not the local machine as shown in your screenshot. In addition, since the Invoke-AtomicRedTeam execution framework starts up a new, hidden powershell session/window to execute the commands, including prereq commands, setting the protocol in the current session wouldn't have the needed effect either. Your two options for fixing this is to add the protocol command to the get_prereqs command on the atomic test itself, or to solve it for all atomics you could add the command to your powershell profile on the remote machine so it is always set for all powershell sessions, even the new hidden one the Invoke uses.