-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,6 @@ | |
# | ||
# Copyright:: 2017, The Authors, All Rights Reserved. | ||
|
||
include_recipe 'metasploitable::7zip' | ||
include_recipe 'metasploitable::jdk8' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
powershell_script 'Download ElasticSearch' do | ||
code '(New-Object System.Net.WebClient).DownloadFile(\'http://repo1.maven.org/maven2/org/elasticsearch/elasticsearch/1.1.1/elasticsearch-1.1.1.zip\', \'C:\Windows\Temp\elasticsearch-1.1.1.zip\')' | ||
end | ||
|
@@ -18,6 +15,7 @@ | |
|
||
execute 'Install ElasticSearch' do | ||
command '"C:\Program Files\elasticsearch-1.1.1\bin\service.bat" install' | ||
environment ({"JAVA_HOME" => "C:\\Program Files\\Java\\jdk1.8.0_144"}) | ||
This comment has been minimized.
Sorry, something went wrong.
jbarnett-r7
Contributor
|
||
action :run | ||
end | ||
|
||
|
@@ -39,11 +37,18 @@ | |
action :start | ||
end | ||
|
||
powershell_script 'Sleep 5 secs' do | ||
code 'Start-Sleep -s 5' | ||
end | ||
|
||
powershell_script 'Test response' do | ||
code '$req = [System.Net.HttpWebRequest]::Create(\'http://localhost:9200/metasploitable3/\'); $req.method = \'PUT\'; $req.GetResponse()' | ||
code "$req = [System.Net.HttpWebRequest]::Create('http://localhost:9200/metasploitable3/'); $req.method = 'PUT'; $req.GetResponse()" | ||
end | ||
|
||
powershell_script 'Test' do | ||
code '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()"' | ||
powershell_script 'Sleep 5 secs' do | ||
code 'Start-Sleep -s 5' | ||
This comment has been minimized.
Sorry, something went wrong.
jbarnett-r7
Contributor
|
||
end | ||
|
||
powershell_script 'Test' do | ||
code "$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()" | ||
end |
JDK8 is still a requirement, we should leave the include_recipe here.