Merge pull request #132 from rapid7/chatbot

Add chatbot to Linux VM
This commit is contained in:
jbarnett-r7 2017-05-03 13:06:44 -05:00 committed by GitHub
commit 31af07a5d1
6 changed files with 65 additions and 2 deletions

1
Vagrantfile vendored
View File

@ -171,6 +171,7 @@ Vagrant.configure("2") do |config|
chef.add_recipe "metasploitable::docker"
chef.add_recipe "metasploitable::samba"
chef.add_recipe "metasploitable::unrealircd"
chef.add_recipe "metasploitable::chatbot"
chef.add_recipe "metasploitable::cups"
chef.add_recipe "metasploitable::readme_app"
chef.add_recipe "metasploitable::payroll_app"

View File

@ -0,0 +1,45 @@
#
# Cookbook:: metasploitable
# Recipe:: chatbot
#
# Copyright:: 2017, Rapid7, All Rights Reserved.
#
#
include_recipe 'metasploitable::ruby23'
include_recipe 'metasploitable::nodejs'
package 'unzip'
bash "Install dependencies" do
code <<-EOH
npm install express
npm install cors
EOH
end
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 vagrant:vagrant /opt/chatbot'
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

View File

@ -0,0 +1,17 @@
#
# Cookbook:: metasploitable
# Recipe:: nodejs
#
# Copyright:: 2017, Rapid7, All Rights Reserved.
#
#
execute 'add nodejs 4 repository' do
command 'curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -'
end
execute "apt-get update" do
command "apt-get update"
end
package 'nodejs'

View File

@ -7,9 +7,9 @@
#
include_recipe 'metasploitable::ruby23'
include_recipe 'metasploitable::nodejs'
package 'git'
package 'nodejs'
directory '/opt/readme_app' do
mode '0777'

View File

@ -1,5 +1,5 @@
#
# Cookbook:: sinatra
# Cookbook:: metasploitable
# Recipe:: sinatra
#
# Copyright:: 2017, Rapid7, All Rights Reserved.