diff --git a/README.md b/README.md index e9e8d04..25f870c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ System Requirements: Requirements: * [Packer](https://www.packer.io/intro/getting-started/setup.html) -* [Vagrant](https://www.vagrantup.com/docs/installation/) +* [Vagrant](https://www.vagrantup.com/docs/installation/) NOTE: Currently 1.9.1 is recommended as there are build issues with newer versions. * [Vagrant Reload Plugin](https://github.com/aidanns/vagrant-reload#installation) * [VirtualBox](https://www.virtualbox.org/wiki/Downloads) * Internet connection diff --git a/build_win2008.ps1 b/build_win2008.ps1 index 8e90559..7ae2a53 100644 --- a/build_win2008.ps1 +++ b/build_win2008.ps1 @@ -29,15 +29,22 @@ function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False return $True } -If ($(Test-Path "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe") -eq $True) { - $vboxVersion = cmd.exe /c "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" -v +$expectedVBoxLocation = "C:\Program Files\Oracle\VirtualBox" +If ($(Test-Path "$expectedVBoxLocation\VBoxManage.exe") -eq $True) { + $vboxVersion = cmd.exe /c "$expectedVBoxLocation\VBoxManage.exe" -v $vboxVersion = $vboxVersion.split("r")[0] +} else { + Write-Host "VirtualBox is not installed (or not in the expected location of $expectedVBoxLocation\)" + Write-Host "Please download and install it from https://www.virtualbox.org/" + exit } If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinVersion -exactMatch $False) { Write-Host "Compatible version of VirtualBox found." } else { - Write-Host "Could not find a compatible version of VirtualBox at C:\Program Files\Oracle\VirtualBox\. Please download and install it from https://www.virtualbox.org/" + Write-Host "A compatible version of VirtualBox was not found." + Write-Host "Current Version=[$vboxVersion], Minimum Version=[$virtualBoxMinVersion]" + Write-Host "Please download and install it from https://www.virtualbox.org/" exit } diff --git a/build_win2008.sh b/build_win2008.sh index 8925909..f29308a 100755 --- a/build_win2008.sh +++ b/build_win2008.sh @@ -47,10 +47,19 @@ elif [ $(uname) = "Linux" ]; then fi fi -if compare_versions $(VBoxManage -v | sed -e 's/r.*//g' -e 's/_.*//g') $min_vbox_ver false; then - echo "Compatible version of VirtualBox found." +if [ -x "$(which VBoxManage)" ] ; then + current_vbox_ver=$(VBoxManage -v | sed -e 's/r.*//g' -e 's/_.*//g') + if compare_versions $current_vbox_ver $min_vbox_ver false; then + echo "Compatible version of VirtualBox found." + else + echo "A compatible version of VirtualBox was not found." + echo "Current Version=[$current_vbox_ver], Minimum Version=[$min_vbox_ver]" + echo "Please download and install it from https://www.virtualbox.org/" + exit 1 + fi else - echo "A compatible version of VirtualBox was not found. Please download and install it from https://www.virtualbox.org/" + echo "VirtualBox is not installed (or not added to the path)." + echo "Please download and install it from https://www.virtualbox.org/" exit 1 fi diff --git a/scripts/configs/create_users.bat b/scripts/configs/create_users.bat index 68c89e1..3a2f260 100644 --- a/scripts/configs/create_users.bat +++ b/scripts/configs/create_users.bat @@ -1,4 +1,4 @@ -net user leah_organa help_me_obiw@n /ADD +net user leia_organa help_me_obiw@n /ADD net user luke_skywalker use_the_f0rce /ADD net user han_solo sh00t-first /ADD net user artoo_detoo beep_b00p /ADD @@ -14,7 +14,7 @@ net user greedo hanShotFirst! /ADD net user chewbacca rwaaaaawr5 /ADD net user kylo_ren daddy_issues1 /ADD -net localgroup "Backup Operators" leah_organa /ADD +net localgroup "Backup Operators" leia_organa /ADD net localgroup "Certificate Service DCOM Access" luke_skywalker /ADD net localgroup "Cryptographic Operators" han_solo /ADD net localgroup "Distributed COM Users" artoo_detoo /ADD @@ -29,7 +29,7 @@ net localgroup "Print Operators" jabba_hutt /ADD net localgroup "Remote Desktop Users" greedo /ADD net localgroup "Replicator" chewbacca /ADD -reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v leah_organa /t REG_DWORD /d 0 /f +reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v leia_organa /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v luke_skywalker /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v han_solo /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v artoo_detoo /t REG_DWORD /d 0 /f diff --git a/scripts/installs/install_elasticsearch.bat b/scripts/installs/install_elasticsearch.bat index dfda300..4ee97bd 100644 --- a/scripts/installs/install_elasticsearch.bat +++ b/scripts/installs/install_elasticsearch.bat @@ -3,7 +3,7 @@ cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\elasticsearch-1.1.1.z cmd /c ""C:\Program Files\elasticsearch-1.1.1\bin\service.bat" install" sc config "elasticsearch-service-x64" start= auto cmd /c ""C:\Program Files\elasticsearch-1.1.1\bin\service.bat" start" -powershell -Command "Start-Sleep -s 5" +powershell -Command "Start-Sleep -s 30" powershell -Command "$req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/'); $req.method = 'PUT'; $req.GetResponse()" powershell -Command "$body = [System.Text.Encoding]::ASCII.GetBytes('{\"user\":\"kimchy\", \"post_date\": \"2009-11-15T14:12:12\", \"message\": \"Elasticsearch\" }'); $req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/message/1'); $req.method = 'PUT'; $req.ContentType = 'application/x-www-form-urlencoded'; $stream = $req.GetRequestStream(); $stream.Write($body, 0, $body.Length); $stream.close(); $req.GetResponse()" diff --git a/scripts/installs/install_wamp.bat b/scripts/installs/install_wamp.bat index 9074382..0cf53a3 100644 --- a/scripts/installs/install_wamp.bat +++ b/scripts/installs/install_wamp.bat @@ -1,4 +1,4 @@ -powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://sourceforge.mirrorservice.org/w/wa/wampserver/WampServer 2/WampServer 2.2/wampserver2.2d-x64.exe', 'C:\Windows\Temp\wampserver2.2.d-x64.exe')"