clong / DetectionLab

Automate the creation of a lab environment complete with security tooling and logging best practices
MIT License
4.59k stars 979 forks source link

Share file error when building Exchange #860

Closed vonjk closed 1 year ago

vonjk commented 1 year ago

Please verify that you are building from an updated Master branch before filing an issue.

Description of the issue:

Share file error when building Exchange

image
==> exchange: Enabling and configuring shared folders...
    exchange: -- /Users/jk/Desktop/DetectionLab/Vagrant/Exchange: /vagrant
==> exchange: Running provisioner: shell...
    exchange: Running: scripts/fix-second-network.ps1 as C:\tmp\vagrant-shell.ps1
    exchange: [17:54] Running fix-second-network.ps1...
    exchange: [17:54] No VirtIO adapters, moving on...
    exchange: [17:54]
    exchange: Setting IP address and DNS information for the Ethernet1 interface
    exchange: If this step times out, it's because vagrant is connecting to the VM on the wrong interface
    exchange: See https://github.com/clong/DetectionLab/issues/114 for more information
    exchange: [17:54] Set IP address to 192.168.56.106 of interface Ethernet1
    exchange:
    exchange: [17:54] Set DNS server address to 8.8.8.8 of interface Ethernet1
    exchange: The object is already in the list.
    exchange:
    exchange:
==> exchange: Running provisioner: shell...
    exchange: Running: scripts/provision.ps1 as C:\tmp\vagrant-shell.ps1
    exchange: [17:55] Setting timezone to UTC...
    exchange: [17:55] Checking if Windows evaluation is expiring soon or expired...
    exchange: powershell.exe : . : The term 'c:\vagrant\scripts\fix-windows-expiration.ps1' is not recognized as the name of a
    exchange:     + CategoryInfo          : NotSpecified: (. : The term 'c... the name of a :String) [], RemoteException
    exchange:     + FullyQualifiedErrorId : NativeCommandError
    exchange: cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
    exchange: was included, verify that the path is correct and try again.
    exchange: At C:\tmp\vagrant-shell.ps1:12 char:3
    exchange: + . c:\vagrant\scripts\fix-windows-expiration.ps1
    exchange: +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    exchange:     + CategoryInfo          : ObjectNotFound: (c:\vagrant\scri...-expiration.ps1:String) [], Comm
    exchange:    andNotFoundException
    exchange:     + FullyQualifiedErrorId : CommandNotFoundException
    exchange:
    exchange: [17:55] Unable to connect to ping.detectionlab.network
    exchange: The request was aborted: Could not create SSL/TLS secure channel.
    exchange: [17:55] Disabling IPv6 on all network adatpers...
    exchange:
    exchange: Name                           DisplayName                                        ComponentID
    exchange: ----                           -----------                                        -----------
    exchange: Ethernet1                      Internet Protocol Version 6 (TCP/IPv6)             ms_tcpip6
    exchange: Ethernet0 2                    Internet Protocol Version 6 (TCP/IPv6)             ms_tcpip6
    exchange: The operation completed successfully.
    exchange:
    exchange: [17:55] Current domain is set to 'workgroup'. Time to join the domain!
    exchange: [17:55] Installing bginfo...
    exchange: . : The term 'c:\vagrant\scripts\install-bginfo.ps1' is not recognized as the name of a cmdlet,
    exchange: function, script file, or operable program. Check the spelling of the name, or if a path was
    exchange: included, verify that the path is correct and try again.
    exchange: At C:\tmp\vagrant-shell.ps1:50 char:7
    exchange: +     . c:\vagrant\scripts\install-bginfo.ps1
    exchange: +       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    exchange:     + CategoryInfo          : ObjectNotFound: (c:\vagrant\scripts\install-bginfo.ps1:String) [],
    exchange:    CommandNotFoundException
    exchange:     + FullyQualifiedErrorId : CommandNotFoundException
    exchange:
    exchange: [17:55] My hostname is EXCHANGE
    exchange: . : The term 'c:\vagrant\scripts\join-domain.ps1' is not recognized as the name of a cmdlet,
    exchange: function, script file, or operable program. Check the spelling of the name, or if a path was
    exchange: included, verify that the path is correct and try again.
    exchange: At C:\tmp\vagrant-shell.ps1:62 char:7
    exchange: +     . c:\vagrant\scripts\join-domain.ps1
    exchange: +       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    exchange:     + CategoryInfo          : ObjectNotFound: (c:\vagrant\scripts\join-domain.ps1:String) [], Com
    exchange:    mandNotFoundException
    exchange:     + FullyQualifiedErrorId : CommandNotFoundException
    exchange:
    exchange:
    exchange:
The following WinRM command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

powershell -ExecutionPolicy Bypass -OutputFormat Text -file "C:\tmp\vagrant-shell.ps1"

Stdout from the command:

[17:55] Setting timezone to UTC...
[17:55] Checking if Windows evaluation is expiring soon or expired...
[17:55] Unable to connect to ping.detectionlab.network
The request was aborted: Could not create SSL/TLS secure channel.
[17:55] Disabling IPv6 on all network adatpers...

Name                           DisplayName                                        ComponentID
----                           -----------                                        -----------
Ethernet1                      Internet Protocol Version 6 (TCP/IPv6)             ms_tcpip6
Ethernet0 2                    Internet Protocol Version 6 (TCP/IPv6)             ms_tcpip6
The operation completed successfully.

[17:55] Current domain is set to 'workgroup'. Time to join the domain!
[17:55] Installing bginfo...
[17:55] My hostname is EXCHANGE

Stderr from the command:

powershell.exe : . : The term 'c:\vagrant\scripts\fix-windows-expiration.ps1' is not recognized as the name of a
    + CategoryInfo          : NotSpecified: (. : The term 'c... the name of a :String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At C:\tmp\vagrant-shell.ps1:12 char:3
+ . c:\vagrant\scripts\fix-windows-expiration.ps1
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (c:\vagrant\scri...-expiration.ps1:String) [], Comm
   andNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

. : The term 'c:\vagrant\scripts\install-bginfo.ps1' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At C:\tmp\vagrant-shell.ps1:50 char:7
+     . c:\vagrant\scripts\install-bginfo.ps1
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (c:\vagrant\scripts\install-bginfo.ps1:String) [],
   CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

. : The term 'c:\vagrant\scripts\join-domain.ps1' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At C:\tmp\vagrant-shell.ps1:62 char:7
+     . c:\vagrant\scripts\join-domain.ps1
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (c:\vagrant\scripts\join-domain.ps1:String) [], Com
   mandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
clong-msec commented 1 year ago

Exchange is no longer supported in DL

cthulhu897 commented 1 year ago

silly me... I forced exchange to work and after the weekend splunk has been disabled due to exceeding traffic... I would suggest adding a few more warnings to the exchange scripts 😅