Deal with non-RFC compliant servers #375
Merged
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.
There are many servers on the internet intending to be an HTTP service, but in reality, they do not adequately conform to the HTTP RFC. For example, many servers on the internet do not send back the full terminating CRLF or
Connection: close
headers, but we might still want to treat as HTTP, for example:Note that the connection is terminated at the server-end for services like this (and lacks the proper response headers)
This patch attempts to fix this single issue by catching the EOF, and if data was captured in the response, do not immediately error.
For example, running zgrab2 on the
master
branch will result in a response like the following:Whereas with this change, we see:
How to Test
Here is a simple python script that can be used to mimick what I am seeing on a large number of hosts the internet:
Start this script up, and run
echo 127.0.0.1 | zgrab2 http -p 8085