From 36d99c45d3dd89d5e2820846c4d13a988f21c194 Mon Sep 17 00:00:00 2001 From: Chan9390 Date: Fri, 7 Jul 2017 18:46:43 +0530 Subject: [PATCH] Added IIS, psexec and winrm tests --- chef/cookbooks/metasploitable/test/windows/iis.rb | 8 ++++++++ .../metasploitable/test/windows/psexec.rb | 14 ++++++++++++++ .../cookbooks/metasploitable/test/windows/winrm.rb | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 chef/cookbooks/metasploitable/test/windows/iis.rb create mode 100644 chef/cookbooks/metasploitable/test/windows/psexec.rb create mode 100644 chef/cookbooks/metasploitable/test/windows/winrm.rb diff --git a/chef/cookbooks/metasploitable/test/windows/iis.rb b/chef/cookbooks/metasploitable/test/windows/iis.rb new file mode 100644 index 0000000..4c167b4 --- /dev/null +++ b/chef/cookbooks/metasploitable/test/windows/iis.rb @@ -0,0 +1,8 @@ +control "iis" do + title "IIS HTTP" + desc "Checks if the IIS server has started and listening on port 80. Setup script available at /scripts/installs/setup_iis.bat" + + describe command('netstat -aob | findstr :3389') do + its('stdout') { should match ("LISTENING") } + end +end diff --git a/chef/cookbooks/metasploitable/test/windows/psexec.rb b/chef/cookbooks/metasploitable/test/windows/psexec.rb new file mode 100644 index 0000000..632c27e --- /dev/null +++ b/chef/cookbooks/metasploitable/test/windows/psexec.rb @@ -0,0 +1,14 @@ +control "psexec" do + title "PxExec" + desc "Checks if the ports 139 - NetBIOS and 445 - SMB are listening" + + describe command('netstat -aob | findstr :139') do + its('stdout') { should match ("LISTENING") } + end + + describe command('netstat -aob | findstr :445') do + its('stdout') { should match ("LISTENING") } + end + +end + diff --git a/chef/cookbooks/metasploitable/test/windows/winrm.rb b/chef/cookbooks/metasploitable/test/windows/winrm.rb new file mode 100644 index 0000000..bce3253 --- /dev/null +++ b/chef/cookbooks/metasploitable/test/windows/winrm.rb @@ -0,0 +1,9 @@ +control "winrm" do + title "WinRM" + desc "Checks if the port 5985 is listening" + + describe command('netstat -aob | findstr :5985') do + its('stdout') { should match ("LISTENING") } + end + +end