You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using statsd-c-client in a C++ project of mine and I've been trying to add some functionality in order to detect if statsd is listening from server-ip on port. But since the socket is setup with SOCK_DGRAM and IPPROTO_UDP it's simply not possible to detect whether the service is at all listening/receiving (no sendto failures)
I've also tried to setup a temporary socket type SOCK_STREAM and added a signal(SIGPIPE, sigpipe_handler) as a sig-handler. Then normally, when you would write (and no service was listening) you would get a pipe error which could serve as a indicator that statsd is not active as a service. The problem is that statsd is not supporting these kind of socket connections (which I can understand) but making it almost impossible to solve..
You think there might be a other way to detect this?
The text was updated successfully, but these errors were encountered:
This is what's written in nmap docs, I don't know if it helps you:
"UDP recvfrom() and write() scanning : While non-root users can't read port unreachable errors directly, Linux is cool enough to inform the user indirectly when they have been received. For example a second write() call to a closed port will usually fail. A lot of scanners such as netcat and Pluvius' pscan.c does this. I have also noticed that recvfrom() on non-blocking UDP sockets usually return EAGAIN ("Try Again", errno 13) if the ICMP error hasn't been received, and ECONNREFUSED ("Connection refused", errno 111) if it has. This is the technique used for determining open ports when non-root users use -u (UDP). Root users can also use the -l (lamer UDP scan) options to force this, but it is a really dumb idea."
I'm using
statsd-c-client
in a C++ project of mine and I've been trying to add some functionality in order to detect if statsd is listening fromserver-ip
onport
. But since the socket is setup withSOCK_DGRAM
andIPPROTO_UDP
it's simply not possible to detect whether the service is at all listening/receiving (nosendto
failures)I've also tried to setup a temporary
socket
typeSOCK_STREAM
and added asignal(SIGPIPE, sigpipe_handler)
as a sig-handler. Then normally, when you would write (and no service was listening) you would get a pipe error which could serve as a indicator that statsd is not active as a service. The problem is that statsd is not supporting these kind of socket connections (which I can understand) but making it almost impossible to solve..You think there might be a other way to detect this?
The text was updated successfully, but these errors were encountered: