-
Notifications
You must be signed in to change notification settings - Fork 315
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
Zgrab2 + TLS CLient Cert Auth causes failure, but curl and openssl s_client succeed #252
Comments
Looking a little more deeply into this led to this code in zcrypto
It seems that the correct way to enable renegotiation would be to use: See also here which shows in the golang TLS code the options available for renegotiation:
It seems that (probably for security reasons?) zmap/zcrypto/zgrab2 made a choice to not allow renegotiation. It seems to me that it would be more appropriate to allow the user to turn it on if they want it |
Note, this has been take up as a legitimate TODO for zcrypto @ zmap/zcrypto#212 Once that is handled, I am happy to PR this functionality to zgrab2 as an optional (off by default) command-line flag |
Thanks to the work @dissoupov did on the TLS1.3 branch of zcrypto, I have a PR that implements a fix for this via a flag, I'd appreciate feedback from any zgrab2 devs on this- the "default" configuration of golang TLS stack is to not allow server-requested renegotiations at all. There are 3 values for this in the golang tls config:
So my question is, should the default in I think options 2 or 3 would be best- those in infosec for a long time are paranoid about allowing (arguably) unnecessary and complexity introducing behaviors like this into code, but because The branch is here: https://github.com/mzpqnxow/zgrab2/tree/feature/renegotiate |
Zgrab2 + TLS CLient Cert Auth Causes Failure, But curl and openssl s_client Succeed
This bit about golang and session renegotiation shines some light on things
This might be helpful enough for me to produce a PR
So I found a bit of a strange edge-case with how zgrab2 handles TLS client certificate authentication failure in certain server/load-balancer configurations. In short,
curl
,openssl s_client -connect
, etc. retrieve HTML content butzgrab2
does not; it returns an empty response (see below)The example site is https://cn-stg-mbr-migration-websvc-scus.azurewebsites.net
The error emitted from zgrab2 is
local error: no renegotiation
. More detail is belowCurl Behavior - Successfully retrieves HTML
Perform a standard HTTP 1.1 GET request on the server. It successfully retrieves HTML, though it contains an error message.
Zgrab2 Behavior - Fails to retreive HTML
When using zgrab2 to try to retrieve this HTML content, it fails. No response data is set and the error is described as
local error: no renegotiation
I fiddled with this for a bit, and tried explicitly disabling SNI (
--no-sni
) and with explicitly setting the SNI and/or Host header using--server-name=
. No luck. I even tried--follow-localhost-redirects
, just to make sure there wasn't some confused logic I could work around.Perhaps there is some parameter missing when using the golang TLS libraries, or maybe there's logic in zgrab2 code causing it to drop the HTTP response. I haven't looked closely at the code yet but will contribute any more detail here that I can if I get some time to do so.
SUMMARY: I believe the desirable behavior for zgrab2 should be identical to how
curl
handles it, producing the above HTML as a response, rather than aborting and returning{}
as a resultThe text was updated successfully, but these errors were encountered: