-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Vulnerability Report Enhancement #20424
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
base: master
Are you sure you want to change the base?
Vulnerability Report Enhancement #20424
Conversation
Gemfile
Outdated
gem 'metasploit_data_models', git: '[email protected]:cdelafuente-r7/metasploit_data_models.git', branch: 'MS-9930_resource_layered_services' | ||
|
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 has been added to make testing possible before the metasploit_data_models
PR is landed. This will need to be removed before landing this PR
Neat. Is there any way we can do this programmatically? Automatically populating vulnerabilities for every module which returns |
service = (port ? host.services.find_by_port(port.to_i) : nil) | ||
|
||
vuln_info[:service] = service if service | ||
if session.exploit.respond_to?(:service_details) && session.exploit.service_details |
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 takes advantage of the #service_details
method, which some modules implement. For now, the lib/msf/core/exploit/remote/http_client.rb
mixin implement it. Maybe we can enforce exploit modules to implemented it in the future.
For example:
https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/tomcat_mgr_upload.rb#L428
https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/core/exploit/remote/http_client.rb#L932
@bcoles, See the previous implementation: https://github.com/rapid7/metasploit-framework/blob/master/lib/msf/ui/console/module_command_dispatcher.rb#L177 |
0b71adf
to
3a8499a
Compare
Thanks. I tried to verify this before posting, but as usual the database config is broken in my dev environment. |
43f4854
to
7a41ca5
Compare
752d418
to
46d565c
Compare
- update `#report_service` and `#report_vuln` - update vulnerability report when a session is established - update CheckCode and `#cmd_check` to report a vulnerability when Vulnerable checkcode is returned - update `vulns` and `services` commands to display the `resource` and parent services - specs
46d565c
to
2df584b
Compare
This PR updates how vulnerability and services are reported by adding a
resource
field to both models. It also add aparents
field to make layered services possible.This PR needs to be landed prior this one.
Description
#report_service
and#report_vuln
have been updated to add the necessary logic for resources and layered services. An optionalresource
field can now be provided and the existingservice
field has been updated to also accept an option hash. For example:Services can also include a
resource
. Note that this field is not validated and any key/value pair is accepted, as long as it is a valid hash. It will be serialized and stored as a JSONB in the database.Services can also have parents to better describe the service layers. For example:
This can be set from a call to
#report_service
:or calling
#report_vuln
:Note that a service can have multiple parents (e.i.
Web App
can haveHTTP
andHTTPS
parent services). An array of hashes can be passed as a value of theparents
key:This PR updates the way a vulnerability is reported report when a session is established and adds the service used by the exploit that got a session.
It updates
CheckCode
and thecheck
command to report a vulnerability when aVulnerable
checkcode is returned. It is now possible to pass avuln
argument with the vulnerability details that will be passed to#report_vuln
:Finally, it updates the
vulns
andservices
commands to display theresource
and parent services.Verification
./msfdb reinit
to update the schemamsfconsole
check
and make sure it returns aVulnerable
CheckCodevulns
commandservices
command (alsoservices -v
report_vuln
following the new schema (see above)vulns
commandservices
commandScenarios