mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-06-28 15:55:47 +02:00
Merge remote-tracking branch 'origin/master' into feature/build_with_packer
This commit is contained in:
commit
abe223ba44
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()"
|
||||
|
||||
|
|
|
@ -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')" <NUL
|
||||
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://sourceforge.net/projects/wampserver/files/WampServer 2/WampServer 2.2/wampserver2.2d-x64.exe', 'C:\Windows\Temp\wampserver2.2.d-x64.exe')" <NUL
|
||||
C:\Windows\Temp\wampserver2.2.d-x64.exe /verysilent
|
||||
copy /Y "C:\vagrant\resources\wamp\httpd.conf" "C:\wamp\bin\apache\Apache2.2.21\conf\httpd.conf"
|
||||
copy /Y "C:\vagrant\resources\wamp\phpmyadmin.conf" "C:\wamp\alias\phpmyadmin.conf"
|
||||
|
|
|
@ -5,7 +5,7 @@ copy /Y "C:\vagrant\resources\glassfish\admin-keyfile" "C:\glassfish\glassfish4\
|
|||
copy /Y "C:\vagrant\resources\glassfish\domain.xml" "C:\glassfish\glassfish4\glassfish\domains\domain1\config\domain.xml"
|
||||
cmd.exe /c "C:\glassfish\glassfish4\bin\asadmin.bat create-service domain1"
|
||||
net start domain1
|
||||
powershell -Command "Start-Sleep -s 5"
|
||||
powershell -Command "Start-Sleep -s 10"
|
||||
net stop domain1
|
||||
icacls "C:\glassfish" /grant "NT Authority\LOCAL SERVICE:(OI)(CI)F" /T
|
||||
sc config "domain1" obj= "NT Authority\LOCAL SERVICE"
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
net start "domain1 GlassFish Server"
|
||||
powershell -command "Start-Sleep -s 5"
|
||||
net start "domain1"
|
||||
|
|
Loading…
Reference in New Issue
Block a user