Skip to content

Commit

Permalink
add ingreslock vuln
Browse files Browse the repository at this point in the history
classic backdoor shell on 1524
  • Loading branch information
deargle committed Oct 2, 2020
1 parent b0eaed0 commit 4225b94
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
27 changes: 27 additions & 0 deletions chef/cookbooks/metasploitable/recipes/ingreslock.rb
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion chef/dev/ub1404/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ 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"
end
end
end
1 change: 1 addition & 0 deletions packer/templates/ubuntu_1404.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
"metasploitable::cups",
"metasploitable::drupal",
"metasploitable::knockd",
"metasploitable::ingreslock",
"metasploitable::iptables",
"metasploitable::flags"
]
Expand Down
1 change: 1 addition & 0 deletions versions/pro/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4225b94

Please sign in to comment.