Merge branch 'add_linux_vm' into chatbot

Fix conflict in Vagrantfile
This commit is contained in:
James Barnett 2017-04-20 15:20:07 -05:00
commit c03cbe633e
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
7 changed files with 109 additions and 8 deletions

1
Vagrantfile vendored
View File

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

View File

@ -0,0 +1,40 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: readme_app
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
# Short-Description: Init script for readme_app
# Description: Start/stop readme_app
### END INIT INFO
DESC="readme_app"
NAME=readme_app
#DAEMON=
do_start()
{
echo "Starting readme_app.";
cd /opt/readme_app
rails s &
}
do_stop()
{
echo "Stopping readme_app."
killall ruby
}
case "$1" in
start)
do_start
;;
stop)
do_stop
;;
esac
exit 0

View File

@ -0,0 +1,5 @@
description 'Run ReadMe App'
author 'metasploitable3'
start on runlevel [2345]
exec "/opt/readme_app/start.sh"

View File

@ -0,0 +1,5 @@
#!/bin/sh
cd /opt/readme_app
bundle install
rails s -b 0.0.0.0 -p 3500

View File

@ -0,0 +1,38 @@
#
# Cookbook:: metasploitable
# Recipe:: readme_app
#
# Copyright:: 2017, Rapid7, All Rights Reserved.
#
#
include_recipe 'metasploitable::ruby23'
package 'git'
package 'nodejs'
directory '/opt/readme_app' do
mode '0777'
end
bash "clone the readme app and install gems" do
code <<-EOH
cd /opt/
git clone https://github.com/jbarnett-r7/metasploitable3-readme.git readme_app
EOH
end
cookbook_file '/opt/readme_app/start.sh' do
source 'readme_app/start.sh'
mode '0777'
end
cookbook_file '/etc/init/readme_app.conf' do
source 'readme_app/readme_app.conf'
mode '0777'
end
service 'readme_app' do
supports restart: false, start: true, reload: false, status: false
action [:enable, :start]
end

View File

@ -0,0 +1,19 @@
#
# Cookbook:: metasploitable
# Recipe:: ruby23
#
# Copyright:: 2017, Rapid7, All Rights Reserved.
#
#
apt_repository 'rvm' do
uri 'ppa:brightbox/ruby-ng'
end
execute 'apt-get update' do
command 'apt-get update'
end
package 'ruby2.3'
package 'ruby2.3-dev'
package 'bundler'

View File

@ -7,14 +7,7 @@
#
include_recipe 'metasploitable::sinatra'
apt_repository 'rvm' do
uri 'ppa:brightbox/ruby-ng'
end
package 'ruby2.3'
package 'bundler'
include_recipe 'metasploitable::ruby23'
directory '/opt/sinatra' do
mode '0777'