Nmap Development mailing list archives

RE: Ncat problems and fixes


From: <OlkhinAG () nk rn-inform ru>
Date: Mon, 4 Mar 2013 13:27:05 +0400

https://secwiki.org/w/Nmap/Ncat_Portable says to copy openssl library to "nmap\mswin32\OpenSSL\", but this path is not 
included the solution file. Take a look at "Configuration Properties -> C/C++ -> Additional Include Directories" and 
"Configuration Properties -> Linker -> Additional Library Directories" in visual studio.

Error is:
ncat_ssl.c(109): fatal error C1083: Cannot open include file: 'openssl/applink.c': No such file or directory

In Ncat_ssl.c I've  removed following lines:
#ifdef WIN32
#include <openssl/applink.c>
#endif

Andrey Olkhin

-----Original Message-----
From: David Fifield [mailto:david () bamsoftware com] 
Sent: Saturday, March 02, 2013 12:33 PM
To: Ольхин Андрей Геннадьевич
Cc: dev () nmap org
Subject: Re: Ncat problems and fixes

On Wed, Feb 13, 2013 at 05:49:08PM +0400, OlkhinAG () nk rn-inform ru wrote:
1. Ncat Portable building for windows:
                OpenSSL paths should be changed to 
..\mswin32\OpenSSL\include

Can you explain more what you mean? mswin32/OpenSSL no longer exists in the source tree. There is a precompiled OpenSSL 
in /nmap-mswin32-aux; see http://nmap.org/book/inst-windows.html#inst-win-source.

                All references to openssl/applink.c should be removed 
- not relevant for modern openSSL (also from 
https://secwiki.org/w/Nmap/Ncat_Portable)

What is the error you get when using applink? Can you give us a tested patch that removes it?

2. Odd behavior when running several instances of ncat using -e or -c switch. 
                Problem caused by non-unique named pipe names in 
run_command_redirected in ncat_exec_win.c
                Fix:
int myPid = GetCurrentProcessId();
Snprintf(pipe_name, sizeof(pipe_name), "\\\\.\\pipe\\ncat-%d-%d", 
myPid, pipe_serial_no);

Thanks, this is committed in r30641.

3. Ncat with -e or -c switch not ends when connection dies.
                There is error in subprocess_thread_func:
DWORD n
...
n = ncat_recv(
if (n <= 0)
                               n is unsigned and if connection dies 
recv returns -1
                Fix:
                int n;
...
if (GetOverlappedResult(info->child_out_r, &overlap, (LPDWORD) &n, 
FALSE)) {

Thanks, fixed in r30642.

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

Current thread: