File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed
cookbooks/metasploitable/recipes Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # Cookbook:: metasploitable
3+ # Recipe:: ingreslock
4+ #
5+ # Copyright:: 2020, Rapid7, All Rights Reserved.
6+
7+ include_recipe 'iptables::default'
8+
9+ iptables_rule '01_ingreslock' do
10+ lines "-A INPUT -p tcp --dport 1524 -j ACCEPT"
11+ end
12+
13+ package 'inetutils-inetd' do
14+ action :install
15+ end
16+
17+ # needs to happen before starting the service --
18+ # otherwise, if no services listed in inetd.conf,
19+ # inetd will refuse to start.
20+ execute 'add ingreslock to /etc/inetd.conf' do
21+ command "echo 'ingreslock stream tcp nowait root /bin/bash bash -i' >> /etc/inetd.conf"
22+ not_if "grep -q 'ingreslock stream tcp nowait root /bin/bash bash -i' /etc/inetd.conf"
23+ end
24+
25+ service 'inetutils-inetd' do
26+ action [ :enable , :start ]
27+ end
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ Vagrant.configure("2") do |config|
4141 chef . add_recipe "metasploitable::cups"
4242 chef . add_recipe "metasploitable::drupal"
4343 chef . add_recipe "metasploitable::knockd"
44+ chef . add_recipe "metasploitable::ingreslock"
4445 chef . add_recipe "metasploitable::iptables"
4546 chef . add_recipe "metasploitable::flags"
4647 chef . add_recipe "metasploitable::clear_cache"
Original file line number Diff line number Diff line change 175175 " metasploitable::cups" ,
176176 " metasploitable::drupal" ,
177177 " metasploitable::knockd" ,
178+ " metasploitable::ingreslock" ,
178179 " metasploitable::iptables" ,
179180 " metasploitable::flags" ,
180181 " metasploitable::ifnames"
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ Vagrant.configure("2") do |config|
6969 chef . add_recipe "metasploitable::cups"
7070 chef . add_recipe "metasploitable::drupal"
7171 chef . add_recipe "metasploitable::knockd"
72+ chef . add_recipe "metasploitable::ingreslock"
7273 chef . add_recipe "metasploitable::iptables"
7374 chef . add_recipe "metasploitable::flags"
7475 chef . add_recipe "metasploitable::clear_cache"
You can’t perform that action at this time.
0 commit comments