rapid7 / metasploitable3

Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities.
Other
4.79k stars 1.15k forks source link

vagrant-ssh execution script errors #580

Closed DevelopMan closed 1 year ago

DevelopMan commented 2 years ago

Issue Description

Please check the General Issues section in the wiki before you submit the issue. If you didn't find your issue mentioned, please give a thorough description of the issue you're seeing. Also, please be sure to include any troubleshooting steps that you've already attempted.

Host System

Command Output

Copy the relevant command output here. If it's long, either post to a gist and add the link here, or isolate the error lines.

I've tried to use ./build.sh windows2008 and got the error:

Exception setting "SecurityProtocol": "Cannot convert null to type "System.Net.SecurityProtocolType" due to invalid enumeration values. Specify one of the following enumeration values and try again. The possible enumeration values are "Ssl3, Tls"."
At line:2 char:35
+        [Net.ServicePointManager]:: <<<< SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys')
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyAssignmentException

Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."
At line:2 char:135
+        [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object System.Net.WebClient).DownloadFile <<<< ('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys')
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

It means that dotnet 4.5 wasn't installed (because this package supposes to do this). I investigated it a bit and found the error:

2022-11-02T22:59:41 System.Management.Automation.MethodInvocationException: Exception calling "DownloadFile" with "2" argument(s): "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel." ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

The entire log file: https://gist.github.com/DevelopMan/fdd9e5356452598c7a691f08615847b0

The script can't download the dotnet package because of the certificate.

jmartin-tech commented 1 year ago

This looks to be a duplicate of #575, a fix just landed please update the retest this.

If the issue persists please reopen here.