rapid7/metasploit-framework — pull request #3692 by TomSellers (2014-08-24 14:58:18+00:00)
Title: Credential Gem: Post/Windows/Gather - enum_snmp

This is a refactor of 'post/windows/gather/enum_snmp.rb' to support the Metasploit Credential gem as part of Loginpalooza.

Testing the PR requires a target that has SNMP installed and configured. The following links provide instructions on how to do this on Windows 2008 R2

1. Install SNMP
a. From an Administrative command line run ````Dism /online /enable-feature /featurename:SNMP````

2. Configure SNMP
a. From the same command line, run ````services.msc````
b. Locate 'SNMP Service' in the list and double click on it
c. On the Traps tab, type the name of a test trap in the Community Name field, click Add to list
d. Click the Add button under Trap destinations, enter a destination IP, and click the Add button
e. Click Apply
f. On the Security tab, click the Add button under Accepted community names
g. Select a level of access rights from the Community rights drop down
h. Enter a test community name and click the Add button
i. Repeat f through h as desired
j. To add an additional destination click the Add button under Accept SNMP packets from these hosts
k. Enter a destination IP and click Add
l. Click Ok

**Verification**

- [ ] Verify that the database is connected
- [ ] Establish Meterpreter on Windows target running in context of target's platform and SYSTEM
- [ ] ````use post/windows/gather/enum_snmp````
- [ ] ````set SESSION ````
- [ ] ````run````
- [ ] Results including human readable information about community strings and traps to remote hosts
- [ ] ````creds````
- [ ] __VERIFY__ that the community strings are all listed against the target host
- [ ] __VERIFY__ that the snmp traps are all listed against the destination host and show the correct string

My testing was performed using 'exploit/windows/smb/psexec' with 'windows/meterpreter/reverse_https' against Windows 2008 R2.