2017-04-17 18:45:23 +02:00
|
|
|
#
|
2017-04-20 22:50:02 +02:00
|
|
|
# Cookbook:: metasploitable
|
2017-04-17 20:28:07 +02:00
|
|
|
# Recipe:: chatbot
|
2017-04-17 18:45:23 +02:00
|
|
|
#
|
|
|
|
# Copyright:: 2017, Rapid7, All Rights Reserved.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2017-04-20 22:50:02 +02:00
|
|
|
include_recipe 'metasploitable::ruby23'
|
|
|
|
include_recipe 'metasploitable::nodejs'
|
2017-04-17 18:45:23 +02:00
|
|
|
|
|
|
|
package 'unzip'
|
|
|
|
|
2017-04-20 22:50:02 +02:00
|
|
|
bash "Install dependencies" do
|
|
|
|
code <<-EOH
|
|
|
|
npm install express
|
|
|
|
npm install cors
|
|
|
|
EOH
|
|
|
|
end
|
2017-04-17 18:45:23 +02:00
|
|
|
|
|
|
|
cookbook_file '/tmp/chatbot.zip' do
|
|
|
|
source 'chatbot/chatbot.zip'
|
2017-08-21 23:12:02 +02:00
|
|
|
mode '0700'
|
2017-04-17 18:45:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
execute 'unzip chatbot' do
|
|
|
|
command 'unzip /tmp/chatbot.zip -d /opt'
|
|
|
|
end
|
|
|
|
|
|
|
|
execute 'chown chatbot' do
|
2017-08-04 18:18:57 +02:00
|
|
|
command "chown -R root:root /opt/chatbot"
|
2017-04-17 18:45:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
execute 'chmod chatbot' do
|
2017-08-16 00:28:53 +02:00
|
|
|
command 'chmod -R 700 /opt/chatbot'
|
2017-04-17 18:45:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
execute 'install chatbot' do
|
|
|
|
command '/opt/chatbot/install.sh'
|
|
|
|
end
|
|
|
|
|
|
|
|
service 'chatbot' do
|
|
|
|
supports restart: false, start: true, reload: false, status: false
|
|
|
|
action [:enable, :start]
|
|
|
|
end
|