rapid7 / metasploitable3

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

Vagrant-ssh, Chocolatey, Dotnet, WMF errors & chatGPTs responses #583

Closed jetson02 closed 1 year ago

jetson02 commented 1 year ago

Issue Description

I've been trying to get meta3 running for a couple weeks. I've tried on ubuntu as well as kali, with automatic build and manual, with qemu and virtualbox and they all end up with the same errors. The most recognizable being when the script runs vagrant-ssh.ps1 & chocolatey.ps1. Both give the same very long error(s). In searching the problem I noticed someone with the same errors mention DotNet wasn't downloading, so I looked & found the same thing in the VM's logs. dotnet-install.log says failed to download file, and the Windows Management Framework 5 install log says the same, yet OpenSSH downloads, installs, and works fine, & I can browse & DL within the VM. (Does the problem start with a failed download or update?) I've tried using different network settings, and went to other forks and even found an ovf of a meta3 VM but can't get it to load on my system. I'd tried setting this up before doing all the latest updates, as well as afterwards, and I've tried purging all the necessary programs, rebooting, and reinstalling them multiple times.

I ran the errors from vagrant-ssh & chocolatey below through chatGPT & included its responses below, but I also posted the vagrant-ssh code & it finds nothing wrong with it. The errors I receive are really much longer and full of mess but I cleaned them up for posting.

I'd really appreciate any assistance and love to hear from anyone that has the VM operational using the latest versions available. Thank you

Host System

Command Output

">Exception setting "SecurityProtocol": "Cannot convert null to type due to invalid enumeration values. Specify one of the folowing enumeration values and try again. The possible enumeration values aresl3, Tls[Net.ServicePointManager]:: SecurityProtocol = [Net.SecurityProtol::Tls12; ChatGPT: "The error message states that the value provided is not a valid enumeration value and suggests that either "Ssl3" or "Tls" should be used instead." DownloadFile('https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub', 'C:\Users\vagrant\.ssh\authorized_keys'+ CategoryInfo InvalidOperation: (:) [], RuntimeException_Error"> FullyQualifiedErrorId : PropertyAssignmentException="Error">Exception calling "DownloadFile" with "2" argument(s): ChatGPt: "This is an error message indicating that there is a problem with a script or code that is attempting to download a file from a URL using the .DownloadFile method of the System.Net.WebClient class. The error message states that there was an issue with the underlying connection and that it was closed with an "unexpected error occurred on a send." Additionally, it seems to be indicating that this error occurred at line 2, character 135 in some script or code. It's also indicating that there is a problem with the SecurityProtocol settings, which is being set to Tls12. It is also indicating that the PropertyAssignmentException and DotNetMethodException are occurred. It is recommended to check your internet connection, URL, and the SecurityProtocol settings to fix the issue."
vertuzero9 commented 1 year ago

Same issues!

vertuzero9 commented 1 year ago

Simple solution: Download all install file require in scripts folder and attach to guest instead of download need SSL/TLS by guest!

jmartin-tech commented 1 year ago

Duplicates #575 as new pattern is needed adjust download process for these initial files.

jetson02 commented 1 year ago

Pretty rash closure. I doubt searches for the vagrant-ssh error will lead to #575. Other dotnet issues remain open, and I asked if anyone had a vm running. There was more to be learned & gained. You could refer without closing.


From: Jeffrey Martin @.> Sent: Friday, January 27, 2023, 4:07 p.m. To: rapid7/metasploitable3 @.> Cc: jetson02 @.>; Author @.> Subject: Re: [rapid7/metasploitable3] Vagrant-ssh, Chocolatey, Dotnet, WMF errors & chatGPTs responses (Issue #583)

Duplicates #575https://github.com/rapid7/metasploitable3/issues/575 as new pattern is needed adjust download process for these initial files.

— Reply to this email directly, view it on GitHubhttps://github.com/rapid7/metasploitable3/issues/583#issuecomment-1407075312, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANVX3SOGWRKXKMKGB2OPVH3WUQ2I3ANCNFSM6AAAAAAT3M35NA. You are receiving this because you authored the thread.Message ID: @.***>

jmartin-tech commented 1 year ago

As a primary maintainer on this project closing duplicate issues reporting a known problem and linking the reports has value. Even closed issues can be found in search.

@jetson02, I have fully reviewed this report, the issue is rooted in the reference to Tls[Net.ServicePointManager]:: SecurityProtocol = [Net.SecurityProtol::Tls12; this is what the issue I linked documents. The download failure is due to the need for TLS 1.2 to be available in the VM during the build. My evaluation is also in line with what your own ChatGPT search identified. By referencing the issue when closing I have added a comment breadcrumb to lead users to the root cause. The response may have been a bit terse, however closing was not rash by any means. Since the issue was not locked it can be reopened if it is found that my conclusion is incorrect.

If you are just looking to get a working version of the VM you can use the Quick-start method and have vagrant download the last build that completed and publish prior to the TLS issue with downloading external resources by the guest OS, instead of building from scratch.

To offer solutions to the issue I linked or ideas on how to address it, please look over that issue and the comments there. Note the possible approach to addressing it or offer new ideas in that issue. PRs are welcome if you have a working solution to restore end-to-end capabilities to build the Windows VM from scratch.

jetson02 commented 1 year ago

That hasn't worked either, regardless of the different systems I've tried it on.

"The box you're attempting to add doesn't support the provider. Find an alternate box or use an alternate provider. Double check your requested provider to verify you didn't simply misspell it. If you’re adding a box from hashicorps vagrant cloud, make sure the box is released. Address https://vagrantcloud.com/rapid7/metasploitable3-win2k8 Request provider [:libvirt]

My post would have really informed myself (and those to follow) before troubleshooting for days. How is anyone going to connect the vagrantssh.ps1 fail (where dotnet's failure causes the 1st error message; ) with that dotnet issues post? Personally, after searching dozens of answers I noticed in the other "vagrant-ssh post", a user added that his dotnet dl was failing. That was my first clue but it was just one person, but now that we know it can't be built as posted due to broken links, shouldn't there be a disclaimer, or an issue posted, clearing it up for everyone.


From: Jeffrey Martin @.> Sent: Saturday, January 28, 2023, 6:03 p.m. To: rapid7/metasploitable3 @.> Cc: jetson02 @.>; Mention @.> Subject: Re: [rapid7/metasploitable3] Vagrant-ssh, Chocolatey, Dotnet, WMF errors & chatGPTs responses (Issue #583)

As a primary maintainer on this project closing duplicate issues reporting a known problem and linking the reports has value. Even closed issues can be found in search.

@jetson02https://github.com/jetson02, I have fully reviewed this report, the issue is rooted in the reference to Tls[Net.ServicePointManager]:: SecurityProtocol = [Net.SecurityProtol::Tls12; this is what the issue I linked documents. The download failure is due to the need for TLS 1.2 to be available in the VM during the build. My evaluation is also in line with what your own ChatGPT search identified. By referencing the issue when closing I have added a comment breadcrumb to lead users to the root cause. The response may have been a bit terse, however closing was not rash by any means. Since the issue was not locked it can be reopened if it is found that my conclusion is incorrect.

If you are just looking to get a working version of the VM you can use the Quick-starthttps://github.com/rapid7/metasploitable3#quick-start method and have vagrant download the last build that completed and publish prior to the TLS issue with downloading external resources by the guest OS, instead of building from scratch.

To offer solutions to the issue I linked or ideas on how to address it, please look over that issue and the comments there. Note the possible approach to addressing it or offer new ideas in that issue. PRs are welcome if you have a working solution to restore end-to-end capabilities to build the Windows VM from scratch.

— Reply to this email directly, view it on GitHubhttps://github.com/rapid7/metasploitable3/issues/583#issuecomment-1407507006, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANVX3SOIQBPFKT4WEJN7ELLWUWQUNANCNFSM6AAAAAAT3M35NA. You are receiving this because you were mentioned.Message ID: @.***>

jmartin-tech commented 1 year ago

Request provider [:libvirt]

The message from vagrant states that vagrant is configured for libvirt instead of virtualbox as noted in your original report. Currently VMs are published in vagrantcloud for vmware and virtualbox only. If you configure vagrant to use virtualbox you may be able to utilize a downloaded VM from vagrantcloud.

How is anyone going to connect the vagrantssh.ps1 fail (where dotnet's failure causes the 1st error message; ) with that dotnet issues post?

Marking this report as a duplicate of that issue is how users can now link the issues together, I for one appreciate your report here as perspective and output can be different for various environments. This issue and the various other I linked this week will aid future users in finding that the failures were related. In a perfect world the original issue would have been resolved before this issue was opened.

575 was opened when the issue was found and it notes the first error message as the root cause, I suspect the same log line was seen on at least one of your test runs. Unfortunately there are later errors from provisioners as packer does not recognize the issue occurring during initial OS install which allows provisioners to attempt to execute further steps.

Hopefully the solution for installation of dotnet and powershell that just landed fixes the build for your environment. It was tested with virtualbox and vmware however it should also meet the requirements for libvirt as well.

jetson02 commented 1 year ago

I ran vagrant --provider virtualbox and came to issue #393 (i ran vagrant on windows too just to see if i could get a vm one, but got same error there.) "Linux box failed error" https://github.com/rapid7/metasploitable3/issues/393

I can nmap it & find several vulnerabilities have opened but can't ping it.

The iptables suggestion just locks up my connection entirely. After inputting those 3 commands I can't even surf. Adding just the "iptables -A INPUT -p icmp -j ACCEPT" part doesn't lock up my connection but doesn't allow the .bat to run either, or let me ping the vm.

It looks like theres lots of other chocolatey or vagrant posts that are likely dotnet related. As mentioned I searched and worked 3 weeks and it was https://github.com/rapid7/metasploitable3/issues/580 first connecting ssh & choco errors to dotnet (not my screwing up). I kept trying and trying, getting mad at myself for failing, burning myself out, and convincing myself to quit IT altogether. If only I had seen it earlier.

Im in marketing. This is a great project but I bet many users will spend time on the wrong error messages. (Metasploitable related instead of Metasploit related)


From: Jeffrey Martin @.> Sent: Sunday, February 5, 2023, 3:09 p.m. To: rapid7/metasploitable3 @.> Cc: jetson02 @.>; Mention @.> Subject: Re: [rapid7/metasploitable3] Vagrant-ssh, Chocolatey, Dotnet, WMF errors & chatGPTs responses (Issue #583)

Request provider [:libvirt]

The message from vagrant states that vagrant is configured for libvirt instead of virtualbox as noted in your original report. Currently VMs are published in vagrantcloud for vmware and virtualbox only. If you configure vagrant to use virtualbox you may be able to utilize a downloaded VM from vagrantcloud.

How is anyone going to connect the vagrantssh.ps1 fail (where dotnet's failure causes the 1st error message; ) with that dotnet issues post?

Marking this report as a duplicate of that issue is how users can now link the issues together, I for one appreciate your report here as perspective and output can be different for various environments. This issue and the various other I linked this week will aid future users in finding that the failures were related. In a perfect world the original issue would have been resolved before this issue was opened.

575https://github.com/rapid7/metasploitable3/issues/575 was opened when the issue was found and it notes the first error message as the root cause, I suspect the same log line was seen on at least one of your test runs. Unfortunately there are later errors from provisioners as packer does not recognize the issue occurring during initial OS install which allows provisioners to attempt to execute further steps.

Hopefully the solution for installation of dotnet and powershell that just landed fixes the build for your environment. It was tested with virtualbox and vmware however it should also meet the requirements for libvirt as well.

— Reply to this email directly, view it on GitHubhttps://github.com/rapid7/metasploitable3/issues/583#issuecomment-1418253135, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANVX3SOWWANZX6M4PSQBOE3WWACIXANCNFSM6AAAAAAT3M35NA. You are receiving this because you were mentioned.Message ID: @.***>