Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Re: ncat's nsock vs. nmap nsock
From: " mixter () gmail com" <mixter () gmail com>
Date: Fri, 9 May 2008 15:28:44 +0200

Ok... taking a second look at the strace I sent there... :)
The problem is actually clear, nsock has no problems with
network input, but with stdin input! dup(0) = 4, then
recv(4, ...) = -1 errno ENOTSOCK means that recv()
refuses to read from stdin as not being a real socket.

ncat.h:
struct conn_state {
    nsock_iod tcp_nsi;
    nsock_iod stdin_nsi;
[...]

So we have a minor design issue there, if we do not want to copy any
nsock code for nmap. My proposal is that we could have an additional
"real_socket"
field in "struct mspool" that takes care of making a difference
between non-network
(stdin) and network socket. read() only for stdin should even work on Win32. ;)
And only ncat would need to set that flag when initializing their
conn_state.stdin_nsi.

$.02

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


  By Date           By Thread  

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