This commit is contained in:
Dave Eargle 2023-07-25 21:55:05 -06:00 committed by GitHub
commit ffd941187d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,27 @@
#
# Cookbook:: metasploitable
# Recipe:: ingreslock
#
# Copyright:: 2020, Rapid7, All Rights Reserved.
include_recipe 'iptables::default'
iptables_rule '01_ingreslock' do
lines "-A INPUT -p tcp --dport 1524 -j ACCEPT"
end
package 'inetutils-inetd' do
action :install
end
# needs to happen before starting the service --
# otherwise, if no services listed in inetd.conf,
# inetd will refuse to start.
execute 'add ingreslock to /etc/inetd.conf' do
command "echo 'ingreslock stream tcp nowait root /bin/bash bash -i' >> /etc/inetd.conf"
not_if "grep -q 'ingreslock stream tcp nowait root /bin/bash bash -i' /etc/inetd.conf"
end
service 'inetutils-inetd' do
action [:enable, :start]
end

View File

@ -41,6 +41,7 @@ Vagrant.configure("2") do |config|
chef.add_recipe "metasploitable::cups"
chef.add_recipe "metasploitable::drupal"
chef.add_recipe "metasploitable::knockd"
chef.add_recipe "metasploitable::ingreslock"
chef.add_recipe "metasploitable::iptables"
chef.add_recipe "metasploitable::flags"
chef.add_recipe "metasploitable::clear_cache"

View File

@ -175,6 +175,7 @@
"metasploitable::cups",
"metasploitable::drupal",
"metasploitable::knockd",
"metasploitable::ingreslock",
"metasploitable::iptables",
"metasploitable::flags",
"metasploitable::ifnames"

View File

@ -69,6 +69,7 @@ Vagrant.configure("2") do |config|
chef.add_recipe "metasploitable::cups"
chef.add_recipe "metasploitable::drupal"
chef.add_recipe "metasploitable::knockd"
chef.add_recipe "metasploitable::ingreslock"
chef.add_recipe "metasploitable::iptables"
chef.add_recipe "metasploitable::flags"
chef.add_recipe "metasploitable::clear_cache"