Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: ncat - UNIX-domain sockets support
From: David Fifield <david () bamsoftware com>
Date: Thu, 8 Nov 2012 13:21:22 -0800

On Thu, Oct 04, 2012 at 10:16:00AM -0400, Tomas Hozza wrote:
Thank you very much for reviewing my patches. I did some refactoring
and added/changed thinks you've requested.

It would be great if you (David) or other people would have a look on
my new patches and give me some feedback.

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.

I run these commands:
        ./ncat -l -U -k -vvv aaa
        ./ncat -U aaa -vvv
and I see these messages in the log:
        NCAT DEBUG: selecting, fdmax 3
        NCAT DEBUG: select returned 1 fds ready
        NCAT DEBUG: fd 3 is ready
        Ncat: Connection from .
        Ncat: Connection from .
        NCAT DEBUG: Added fd 4 to list, nfds 3, maxfd 4
        NCAT DEBUG: Added fd 4 to list, nfds 1, maxfd 4
        NCAT DEBUG: selecting, fdmax 4
I'm wondering why the client address is the empty string, and why there
are two "Connection from" messages after I've only made one connection.

Please resolve these warnings:
        ncat_main.c: In function ‘main’:
        ncat_main.c:707:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
        ncat_listen.c: In function ‘handle_connection’:
        ncat_listen.c:396:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
        util.c: In function ‘do_listen’:
        util.c:420:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
        util.c:433:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]

Is it possible to use tempnam rather than mktemp, so that the TMPDIR
will be chosen automatically? I don't want to have "/tmp" hardcoded.

The message you get when you fail to provide a socket name in listen
mode is confusing:
        $ ./ncat -l -U
        Ncat: You have to specify a socket to connect to. QUITTING.

These questions may be because I don't understand this type of socket
very well, so please explain if this is the case.

I've attached rebased and modified patches against the current trunk.

David Fifield

Attachment: 0001-Implementation-of-UNIX-domain-sockets-for-Nsock.patch
Description:

Attachment: 0002-Implementation-of-UNIX-domain-sockets-for-Ncat.patch
Description:

Attachment: 0003-Tests-for-UNIX-sockets-implementation-in-Ncat.patch
Description:

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

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
AlienVault