http-default-accounts-fingerprints: Tomcat, add support for host-manager#1755
http-default-accounts-fingerprints: Tomcat, add support for host-manager#1755cnotin wants to merge 2 commits intonmap:masterfrom cnotin:patch-2
Conversation
nnposter
left a comment
There was a problem hiding this comment.
This is definitely a valid enhancement.
This implementation might work in most instances but there is a fundamental weakness in that you are really trying to leverage the same fingerprint for two different applications that do not inherently share the same authorization base.
As an example, imagine that a Tomcat instance has user mymanager in role manager-gui and also user myadmin in role admin-gui and let's assume that these are hypothetically Tomcat default accounts.
- According to your code, the script will first probe path
/manager/html/and finds usermymanager. - It will flag this path as correct for this Tomcat instance.
- It will not find user
myadminon path/manager/html/because it does not have the appropriate role. - The script finishes the testing of default users in the fingerprint, never proceeding to probe the rest of the paths, hence never finding
myadmin.
A better approach might be to split the fingerprint into two, which is what I have in my NNDefaccts fingerprint set:
- The script will first test the fingerprint for Manager against path
/manager/html/and finds usermymanager. - It flags this path as correct for this Tomcat Manager instance.
- It will not test for user
myadminon path/manager/html/because it is not part of this fingerprint (and even if it were, it still lacks the appropriate role). - The script finishes the testing of default users in the fingerprint, never proceeding to probe the rest of the paths.
- The script then moves onto the fingerprint for Host Manager.
- It finds user
myadminon path/host-manager/html/. - It flags this path as correct for this Tomcat Host Manager instance.
- The script finishes the testing of the fingerprint for Host Manager.
|
Thanks for the detailed feedback. Indeed it's better this way! |
|
My fingerprint set is not a working clone of what is in Nmap but a separate, GPL-licensed product, which makes it unsuitable for merging into Nmap. I would suggest two paths forward:
I am fine with either approach. |
|
I split the fingerprint since it's better as you said. I copied the credential for "host manager" from "manager". I did not copy your own. |
|
Committed as r37772. Thank you for contributing to Nmap! |
|
Thanks for suggestions! |
Tomcat has two common management applications: "manager" and "host-manager".
Host manager is at "/host-manager/html" and with the "Tomcat Host Manager Application" realm.
See:
https://github.com/apache/tomcat/blob/3e5ce3108e2684bc25013d9a84a7966a6dcd6e14/webapps/manager/WEB-INF/web.xml#L153
https://github.com/apache/tomcat/blob/3e5ce3108e2684bc25013d9a84a7966a6dcd6e14/webapps/host-manager/WEB-INF/web.xml#L99