rapid7 / metasploitable3

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

System error 67 has occurred - win2k8 #246

Open dnorhoj opened 6 years ago

dnorhoj commented 6 years ago

Issue Description

I ran "vagrant provisioner" and it gave me the output below

Host System

Command Output

$ vagrant provision
==> ub1404: VM not created. Moving on...
==> win2k8: Running provisioner: shell...
    win2k8: Running: scripts/configs/enable_firewall.bat as c:\tmp\vagrant-shell.bat
    win2k8: Ok.
==> win2k8: Running provisioner: shell...
    win2k8: Running: scripts/configs/configure_firewall.bat as c:\tmp\vagrant-shell.bat
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
    win2k8: Ok.
==> win2k8: Running provisioner: shell...
    win2k8: Running: scripts/installs/install_share_autorun.bat as c:\tmp\vagrant-shell.bat
    win2k8:         1 file(s) copied.
    win2k8: The operation completed successfully.
==> win2k8: Running provisioner: shell...
    win2k8: Running: inline PowerShell script
==> win2k8: Running provisioner: shell...
    win2k8: Running: scripts/installs/setup_linux_share.bat as c:\tmp\vagrant-shell.bat
    win2k8: CMDKEY: Credential added successfully.
    win2k8: System error 67 has occurred.
    win2k8: The network name cannot be found.
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

cmd /q /c "c:\tmp\vagrant-shell.bat"

Stdout from the command:

CMDKEY: Credential added successfully.

Stderr from the command:

System error 67 has occurred.

The network name cannot be found.
sxpati2 commented 6 years ago

I too encountered the same issue on windows 10 Pro while performing 'vagrant up' PS D:\metasploitable\metasploitable3-master> vagrant up Bringing machine 'win2k8' up with 'virtualbox' provider... Bringing machine 'ub1404' up with 'virtualbox' provider... ==> win2k8: Importing base box 'metasploitable3-win2k8'... ==> win2k8: Matching MAC address for NAT networking... ==> win2k8: Setting the name of the VM: metasploitable3-master_win2k8_1521929199239_26757 Vagrant is currently configured to create VirtualBox synced folders with the SharedFoldersEnableSymlinksCreate option enabled. If the Vagrant guest is not trusted, you may want to disable this option. For more information on this option, please refer to the VirtualBox manual:

https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false ==> win2k8: Clearing any previously set network interfaces... ==> win2k8: Preparing network interfaces based on configuration... win2k8: Adapter 1: nat win2k8: Adapter 2: hostonly win2k8: Adapter 3: hostonly ==> win2k8: Forwarding ports... win2k8: 3389 (guest) => 3389 (host) (adapter 1) win2k8: 22 (guest) => 2222 (host) (adapter 1) win2k8: 5985 (guest) => 55985 (host) (adapter 1) win2k8: 5986 (guest) => 55986 (host) (adapter 1) ==> win2k8: Running 'pre-boot' VM customizations... ==> win2k8: Booting VM... ==> win2k8: Waiting for machine to boot. This may take a few minutes... win2k8: WinRM address: 127.0.0.1:55985 win2k8: WinRM username: vagrant win2k8: WinRM execution_time_limit: PT2H win2k8: WinRM transport: negotiate ==> win2k8: Machine booted and ready! ==> win2k8: Checking for guest additions in VM... ==> win2k8: Setting hostname... ==> win2k8: Configuring and enabling network interfaces... ==> win2k8: Mounting shared folders... win2k8: /vagrant => D:/unswVMbuilds/metasploitable/metasploitable3-master ==> win2k8: Running provisioner: shell... win2k8: Running: scripts/configs/enable_firewall.bat as c:\tmp\vagrant-shell.bat win2k8: Ok. ==> win2k8: Running provisioner: shell... win2k8: Running: scripts/configs/configure_firewall.bat as c:\tmp\vagrant-shell.bat win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. win2k8: Ok. ==> win2k8: Running provisioner: shell... win2k8: Running: scripts/installs/install_share_autorun.bat as c:\tmp\vagrant-shell.bat win2k8: 1 file(s) copied. win2k8: The operation completed successfully. ==> win2k8: Running provisioner: shell... win2k8: Running: inline PowerShell script ==> win2k8: Running provisioner: shell... win2k8: Running: scripts/installs/setup_linux_share.bat as c:\tmp\vagrant-shell.bat win2k8: CMDKEY: Credential added successfully. win2k8: System error 67 has occurred. win2k8: The network name cannot be found. The following WinRM command responded with a non-zero exit status. Vagrant assumes that this means the command failed!

cmd /q /c "c:\tmp\vagrant-shell.bat"

Stdout from the command:

CMDKEY: Credential added successfully.

Stderr from the command:

System error 67 has occurred.

The network name cannot be found.

sanman57 commented 6 years ago

The two bat files that are involved are install_share_autorun.bat and the setup_linux_share.bat. The install_share_autorun.bat sets the registry to run the setup_linux_share.bat. The setup_linux_share.bat pings itself and parses the result. If there is not error it adds new creds to the system and maps a drive. The problem is that the share that it is trying to map does not exist on the system.

Partial Code from setup_linux_share.bat: net use W: \172.28.128.3\public /savecred /p:yes

The question is what script is suppose to create the public share on the system? I can create the share manually but I don't know what is the intended location the share should point to on the system.

sxpati2 commented 6 years ago

I want to build the box and run on the Windows machine. So shall I comment out those scripts?

kraftur commented 6 years ago

I was having the same issue on a linux machine. If you remove vagrant version 2.0.3 and install vagrant 2.0.2 that will fix the issue. I also had to run " vagrant up win2k8 " This kept ub1404 from trying to run. It works for me now.

sanman57 commented 6 years ago

I replaced vagrant 2.0.3 with vagrant 2.0.2 and reran vagrant provision win2k8. However it fails in the same place with a System Error 67. The share that the setup_linux_share.bat tries to map does not exist. Can you let me know where the "\X.X.X.X\public" share is mapping to on your box and what are the permissions set. I want to try creating the share manually and rerunning the provision.

sxpati2 commented 6 years ago

In my case I have vagrant 2.0.3. I noticed that although I am getting errors mentioned above, metasploitable VM was still running in the virtual box when I opened the virtual box. However it was connected to the private network with ip 10.2.0.15. I had to change its network setting to connect to the Public Network. once I did that I could run nmap -sV 172.28.128.3 and see the services running in it.

darist21 commented 6 years ago

I had exactly the same problem using vagrant 2.0.3 on a Windows 10 64-bit OS. I understand that the script tries to ping another virtual machine on the network (I guess the ub1404) and in case of success then tries to mount a network drive W: on the remote network share. The problem is that 172.28.128.3 is the IP address of the local win2k8 system, meaning that ping command succeeds. Consequently, when it tries to mount the network drive (using the net share command with its local IP address) this obviously causes an error.

I solved the problem by changing the target IP address (ex. 172.28.128.4), resulting into a "Linux host not available" message.

busterb commented 5 years ago

I don't think we have a better way yet for identifying the co-vms IPs.

lochoang75 commented 5 years ago

Still stuck with this issue

Yashvendra commented 5 years ago

I was having the same issue on a linux machine. If you remove vagrant version 2.0.3 and install vagrant 2.0.2 that will fix the issue. I also had to run " vagrant up win2k8 " This kept ub1404 from trying to run. It works for me now.

Didn't work for 2.0.2 and 2.2.5 as well.

mathiasconradt commented 4 years ago

This issue still happens for me as well for the win2k8. Host system is Kali Linux, Virtualbox provider.