Nmap Development mailing list archives

Ncat problems and fixes


From: <OlkhinAG () nk rn-inform ru>
Date: Wed, 13 Feb 2013 17:49:08 +0400

Hi, All

 

1. Ncat Portable building for windows:

                OpenSSL paths should be changed to ..\mswin32\OpenSSL\include 

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

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);

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)) {

 

Andrey Olkhin

 

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

Current thread: