From 355be339c078060e3e848f290bf147a22dbdc2ff Mon Sep 17 00:00:00 2001 From: Chris Long Date: Sat, 31 Jul 2021 20:53:01 -0700 Subject: [PATCH] Add check for vmnet2 --- Vagrant/post_build_checks.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Vagrant/post_build_checks.ps1 b/Vagrant/post_build_checks.ps1 index 93b6a7d..3aa9074 100644 --- a/Vagrant/post_build_checks.ps1 +++ b/Vagrant/post_build_checks.ps1 @@ -30,6 +30,18 @@ function download { function post_build_checks { $checkmark = ([char]8730) + if ((Get-NetAdapter | where {$_.name -eq "VMware Network Adapter VMnet2"}).ifIndex) { + Write-Host '[*] Verifying vmnet2 interface has its IP address set correctly' + $vmnet2idx=(Get-NetAdapter | where {$_.name -eq "VMware Network Adapter VMnet2"}).ifIndex + if ((get-netipaddress -AddressFamily IPv4 | where { $_.InterfaceIndex -eq $vmnet2idx }).IPAddress -ne "192.168.38.1") { + Write-Host '[!] Your vmnet2 network adapter is not set with a static IP address of 192.168.38.1' -ForegroundColor red + Write-Host '[!] Please match your adapter settings to the screenshot shown here: https://github.com/clong/DetectionLab/issues/681#issuecomment-890442441' -ForegroundColor red + } + Else { + Write-Host ' ['$($checkmark)'] VMNet2 is correctly set to 192.168.38.1!' -ForegroundColor Green + } + } + Write-Host '[*] Verifying that Splunk is reachable...' $SPLUNK_CHECK = download -URL 'https://192.168.38.105:8000/en-US/account/login?return_to=%2Fen-US%2F' -PatternToMatch 'This browser is not supported by Splunk' if ($SPLUNK_CHECK -eq $false) {