Nmap Development mailing list archives

Re: ncat - UNIX-domain sockets support


From: David Fifield <david () bamsoftware com>
Date: Mon, 12 Nov 2012 12:54:42 -0800

I have made some changes and committed your patches. Good job. Some more
comments are below.

I'm not sure that automatic generation of a source socket filename is
ready, so I removed it. Is this an essential feature that other netcats
have? There is code in ncat_connect to delete the source socket, but 1)
it deletes the file even if not automatically generated; i.e., if the
user used --source, and 2) connect_handler calls exit itself, so that
the unlink code never runs in case of e.g. "Connection refused".

Can you explain this comment?
/* If we use Unix domain sockets, we have to count with them. */

One of the tests doesn't work in my tests:

PASS Server UNIX socket listen on ncat.unixsock (STREAM)
PASS Server UNIX socket listen on ncat.unixsock --udp (DGRAM)
FAIL Connect to UNIX datagram socket with -s
     Died at ./ncat-test.pl line 1279.

This is strange. When I run the test, it passes.

It works for me now.

are two "Connection from" messages after I've only made one
connection.

The message is doubled, because it is so also with IP sockets:
$ ./ncat -l -k -vvv
...
NCAT DEBUG: selecting, fdmax 4
NCAT DEBUG: select returned 1 fds ready
NCAT DEBUG: fd 4 is ready
Ncat: Connection from 127.0.0.1.
Ncat: Connection from 127.0.0.1:39645.
NCAT DEBUG: Added fd 5 to list, nfds 4, maxfd 5
NCAT DEBUG: Added fd 5 to list, nfds 1, maxfd 5
NCAT DEBUG: selecting, fdmax 5

I changed the output when using UNIX socket, so there is only
one message about incoming connection and without empty address.

Okay, I see. It's fine to double in that case.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: