mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-06-24 13:55:48 +02:00
Enable WebDAV on Apache.
This commit is contained in:
parent
bc8fb88017
commit
9ae9c0a561
39
chef/cookbooks/metasploitable/files/apache/dav.conf
Normal file
39
chef/cookbooks/metasploitable/files/apache/dav.conf
Normal file
|
@ -0,0 +1,39 @@
|
|||
#
|
||||
# Distributed authoring and versioning (WebDAV)
|
||||
#
|
||||
# Required modules: mod_dav, mod_dav_fs, mod_setenvif, mod_alias
|
||||
# mod_auth_digest, mod_authn_file
|
||||
#
|
||||
|
||||
# The following example gives DAV write access to a directory called
|
||||
# "uploads" under the ServerRoot directory.
|
||||
#
|
||||
# The User/Group specified in httpd.conf needs to have write permissions
|
||||
# on the directory where the DavLockDB is placed and on any directory where
|
||||
# "Dav On" is specified.
|
||||
|
||||
Alias /uploads "/var/www/uploads"
|
||||
|
||||
<Directory "/var/www/uploads">
|
||||
AllowOverride All
|
||||
Dav On
|
||||
|
||||
<Limit GET HEAD POST DELETE OPTIONS PUT>
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
</Limit>
|
||||
</Directory>
|
||||
|
||||
#
|
||||
# The following directives disable redirects on non-GET requests for
|
||||
# a directory that does not include the trailing slash. This fixes a
|
||||
# problem with several clients that do not appropriately handle
|
||||
# redirects for folders with DAV methods.
|
||||
#
|
||||
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
|
||||
BrowserMatch "MS FrontPage" redirect-carefully
|
||||
BrowserMatch "^WebDrive" redirect-carefully
|
||||
BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
|
||||
BrowserMatch "^gnome-vfs/1.0" redirect-carefully
|
||||
BrowserMatch "^XML Spy" redirect-carefully
|
||||
BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
|
64
chef/cookbooks/metasploitable/recipes/apache.rb
Normal file
64
chef/cookbooks/metasploitable/recipes/apache.rb
Normal file
|
@ -0,0 +1,64 @@
|
|||
#
|
||||
# Cookbook:: metasploitable
|
||||
# Recipe:: apache
|
||||
#
|
||||
# Copyright:: 2017, Rapid7, All Rights Reserved.
|
||||
|
||||
execute 'apt-get update' do
|
||||
command 'apt-get update'
|
||||
end
|
||||
|
||||
package 'apache2' do
|
||||
action :install
|
||||
end
|
||||
|
||||
directory '/var/www/cgi-bin' do
|
||||
mode '0755'
|
||||
recursive true
|
||||
end
|
||||
|
||||
directory '/var/www/uploads' do
|
||||
mode '0777'
|
||||
recursive true
|
||||
end
|
||||
|
||||
cookbook_file '/var/www/cgi-bin/hello_world.sh' do
|
||||
source 'apache/hello_world.sh'
|
||||
mode '0755'
|
||||
end
|
||||
|
||||
cookbook_file '/etc/apache2/conf-available/cgi-bin.conf' do
|
||||
source 'apache/cgi-bin.conf'
|
||||
mode '0644'
|
||||
end
|
||||
|
||||
cookbook_file '/etc/apache2/conf-available/dav.conf' do
|
||||
source 'apache/dav.conf'
|
||||
mode '0644'
|
||||
end
|
||||
|
||||
bash "configure cgi" do
|
||||
code <<-EOH
|
||||
a2enmod cgi
|
||||
a2enconf cgi-bin
|
||||
a2disconf serve-cgi-bin
|
||||
EOH
|
||||
end
|
||||
|
||||
bash "configure webDAV" do
|
||||
code <<-EOH
|
||||
a2enmod dav
|
||||
a2enmod dav_fs
|
||||
a2enmod dav_lock
|
||||
a2enmod auth_digest
|
||||
a2enconf dav
|
||||
EOH
|
||||
end
|
||||
|
||||
execute 'make /var/www/html writeable' do
|
||||
command 'chmod o+w /var/www/html'
|
||||
end
|
||||
|
||||
service 'apache2' do
|
||||
action [:enable, :start]
|
||||
end
|
Loading…
Reference in New Issue
Block a user