From 77281d94eb0a4d012c81d8a3bd1b1e2b55b2d48f Mon Sep 17 00:00:00 2001 From: Jeff Beley Date: Thu, 3 Oct 2019 09:45:59 -0500 Subject: [PATCH] Update install_agent.ps1 Change to fix TLS errors on download of agent.py --- Vagrant/scripts/install_agent.ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Vagrant/scripts/install_agent.ps1 b/Vagrant/scripts/install_agent.ps1 index 0b109de..e7ae857 100644 --- a/Vagrant/scripts/install_agent.ps1 +++ b/Vagrant/scripts/install_agent.ps1 @@ -1,5 +1,20 @@ Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Installing legacy cuckoo agent.py to sandbox" $agentStartupFolder = "C:\Users\vagrant\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" $cuckooAgent = 'C:\Users\vagrant\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\spy.pyw' +add-type @" + using System.Net; + using System.Security.Cryptography.X509Certificates; + public class TrustAllCertsPolicy : ICertificatePolicy { + public bool CheckValidationResult( + ServicePoint srvPoint, X509Certificate certificate, + WebRequest request, int certificateProblem) { + return true; + } + } +"@ +[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy + + + Invoke-WebRequest https://raw.githubusercontent.com/cuckoosandbox/cuckoo/2.0-rc2/agent/agent.py -o "C:\Users\vagrant\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\spy.pyw" &$cuckooAgent