rapid7/metasploit-framework — pull request #1655 by neinwechter (2013-03-25 16:41:05+00:00)
Title: Minor fixes to tomcat_enum

tomcat_enum fails to deregister USER_AS_PASS which causes it to attempt user names twice without reason. Additionally, if there is an issue connecting to a specified host, the module continues to attempt every username in the list.

This PR resolves both of these issues.

**Before PR with server available or unavailable:**
msf auxiliary(tomcat_enum) > run

[*] 192.168.56.101:8180 - [1/4] - /admin/j_security_check - Apache Tomcat - Trying name: 'tomcat'
[*] 192.168.56.101:8180 - [2/4] - /admin/j_security_check - Apache Tomcat - Trying name: 'garbage'
[*] 192.168.56.101:8180 - [3/4] - /admin/j_security_check - Apache Tomcat - Trying name: 'tomcat'
[*] 192.168.56.101:8180 - [4/4] - /admin/j_security_check - Apache Tomcat - Trying name: 'garbage'
[*] http://192.168.56.101:8180/admin/j_security_check - No users found.
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

**After PR with server available:**

msf auxiliary(tomcat_enum) > run

[*] 192.168.56.101:8180 - [1/2] - /admin/j_security_check - Apache Tomcat - Trying name: 'tomcat'
[*] 192.168.56.101:8180 - [2/2] - /admin/j_security_check - Apache Tomcat - Trying name: 'garbage'
[*] http://192.168.56.101:8180/admin/j_security_check - No users found.
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

**After PR with server unavailable:**

msf auxiliary(tomcat_enum) > run

[*] 192.168.56.101:8180 - [1/2] - /admin/j_security_check - Apache Tomcat - Trying name: 'tomcat'
[-] http://192.168.56.101:8180/admin/j_security_check - UNREACHABLE
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed