metasploitable3/chef/cookbooks/metasploitable/recipes/chatbot.rb

46 lines
802 B
Ruby
Raw Normal View History

2017-04-17 18:45:23 +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.
#
#
include_recipe 'metasploitable::ruby23'
include_recipe 'metasploitable::nodejs'
2017-04-17 18:45:23 +02:00
package 'unzip'
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'
mode '0777'
end
execute 'unzip chatbot' do
command 'unzip /tmp/chatbot.zip -d /opt'
end
execute 'chown chatbot' do
command "chown -R root:root /opt/chatbot"
2017-04-17 18:45:23 +02:00
end
execute 'chmod chatbot' do
command 'chmod -R 777 /opt/chatbot'
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