metasploitable3/chef/cookbooks/metasploitable/test/windows/glassfish.rb
2017-07-07 17:50:21 +05:30

38 lines
1.1 KiB
Ruby

control "glassfish" do
title "Check GlassFish"
desc "Check if the GlassFish service is correctly installed. Installation script available at /scripts/installs/setup_g"
describe file("C:\\glassfish") do
it { should exist }
end
describe file("C:\\glassfish\\glassfish4\\glassfish\\domains\\domain1\\config\\admin-keyfile") do
it { should exist }
end
describe file("C:\\glassfish\\glassfish4\\glassfish\\domains\\domain1\\config\\domain.xml") do
it { should exist }
end
describe command('sc query domain1') do
its('stdout') { should match ('STATE : 4 RUNNING') }
end
# describe command('icacls "C:\glassfish"') do
# its('stdout') { should match "NT AUTHORITY\LOCAL SERVICE:(OI)(CI)(F)" }
# end
describe command('netstat -aob | findstr :4848') do
its('stdout') { should match ("LISTENING") }
end
describe command('netstat -aob | findstr :8080') do
its('stdout') { should match ("LISTENING") }
end
describe command('netstat -aob | findstr :8181') do
its('stdout') { should match ("LISTENING") }
end
end