Hello list,
This is a patch to detect TCP wrapped. They are not put in
Services/unknown so that we don't lose time on them.
(Note: the "new key set" defined by register_service is not used yet.
Ignore this)
Current problems with this feature:
- slows down find_service (should be parallel)
- May declare as "wrapped" services that just close the connection if
no command is sent quickly (a dirty hack is supposed to avoid this,
but I am not sure it works in all cases)
There are probably other bugs or design fault.
Any comments, test results?
The algorithm to detect the wrapped port looks like this:
find_service sends "GET / HTTP/1.0". if it gets no answer and the
service does not run on top of SSL, then the connection is opened
again, and we wait for "wrap_timeout". If the connection does not
close before the end of the timeout, we try to send one byte. If we
get EPIPE, the connection was broekn in fact.
If the connection was broken (timeout or EPIPE) in not too much time
(see code :) then we consider the service as wrapped.
This is a patch to detect TCP wrapped. They are not put in
Services/unknown so that we don't lose time on them.
(Note: the "new key set" defined by register_service is not used yet.
Ignore this)
Current problems with this feature:
- slows down find_service (should be parallel)
- May declare as "wrapped" services that just close the connection if
no command is sent quickly (a dirty hack is supposed to avoid this,
but I am not sure it works in all cases)
There are probably other bugs or design fault.
Any comments, test results?
The algorithm to detect the wrapped port looks like this:
find_service sends "GET / HTTP/1.0". if it gets no answer and the
service does not run on top of SSL, then the connection is opened
again, and we wait for "wrap_timeout". If the connection does not
close before the end of the timeout, we try to send one byte. If we
get EPIPE, the connection was broekn in fact.
If the connection was broken (timeout or EPIPE) in not too much time
(see code :) then we consider the service as wrapped.