-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http-default-accounts-fingerprints: Tomcat, add support for host-manager #1755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
myadmin
on 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
myadmin
on 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
myadmin
on 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