metasploitable3/chef/cookbooks/metasploitable/test/windows/snmp.rb
2017-07-06 08:55:40 +05:30

17 lines
614 B
Ruby

control "snmp" do
title "Setup SNMP"
desc "Check if SNMP has been set up correctly. Setup script available at /scripts/installs/setup_snmp.bat"
describe command('reg query "HKLM\SYSTEM\ControlSet001\services\SNMP\Parameters" /v EnableAuthenticationTraps') do
its('stdout') { should match ("REG_DWORD 0x0") }
end
describe command('reg query "HKLM\SYSTEM\ControlSet001\services\SNMP\Parameters\ValidCommunities" /v public') do
its('stdout') { should match ("REG_DWORD 0x4") }
end
describe command('netstat -aob | findstr :161') do
its('stdout') { should match "LISTENING" }
end
end