Add TLS logs in results when using the banner module with the --tls
flag
#336
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds the result of the TLS handshake when using the banner module with the
--tls
option.How to Test
echo 4.5.6.7 | zgrab2 banner --tls -p 443
shows the certificates of the TLS connection if it succeeded.Notes & Caveats
Hopefully that won't break modules that could be subclassing the Banner module, but the changes are minimal to avoid breaking anything.
I based the patch on existing code that was done for SMTP with STARTTLS, HTTPS, etc.
Something to note: results are returned even if no data is received in the underlying TLS connection. This means that if the banner module is used without
--tls
and no data is receiveddata.banner.result
in the JSON will be an empty object ({}
) instead of being omitted. I'm not sure if that's a problem or not, but we'd need to add some additionalif
statements if result must not be{}
.Issue Tracking
I don't think there is an issue regarding this.