Skip to content
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

ncat datagram connect only if not in recvonly mode #23

Closed
wants to merge 1 commit into from

Conversation

glicht
Copy link

@glicht glicht commented Dec 27, 2014

I am trying to use ncat to listen on a unix domain datagram socket in
receive only mode. I am using this as a simple syslog receiving server for
testing.

When I use the following command:

ncat --recv-only -luU /tmp/test.socket

and then try to log a message using logger with the following command:

logger -d -u /tmp/test.socket "this is a test"

I get the following error on the ncat side:

connect: Invalid argument

From looking at the ncat_listen.c code it looks like ncat tries to connect
a sending socket even when in recv-only mode. I added a check to connect
only when not in recv-only mode and then ncat worked as expected.

I've also sent this out a few days back to the dev mailing list: http://seclists.org/nmap-dev/2014/q4/343 .

Hope this fix is something you can merge in.

Thanks,

Guy

@dmiller-nmap
Copy link

This is not really the correct way to handle this: Ncat crashes even without --recv-only. The reason is that logger does not bind its socket to a filename before sending, meaning that it is an unnamed socket. Ncat just can't handle that right now. I'm adding a bug (#46) for this, since it is a legit problem. Also see my reply to your dev list message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants