Nmap Development mailing list archives

Windows bug in d33tah/ncat-env-ncatins, possibly SSL-related


From: Jacek Wielemborek <wielemborekj1 () gmail com>
Date: Wed, 7 Aug 2013 19:00:16 +0200

Hi,

While testing my d33tah/ncat-env-ncatins branch, I noticed a Windows
bug that I have problems tracking down. In order to reproduce it,
compile Ncat from my SVN branch under MSVC and run ncat --ssl --listen
--lua-exec scripts/hello-ncatout.lua. Then, connect to the spawned
server and instead of writing to the server's terminal ("ncatin"),
write to the SSL connection. hello-ncatout.lua will not expect this
and won't read the data, but instead of keeping it in the buffer, it
will fail with the exit code 259. Here's the debug output:

Ncat: Version 6.26SVN ( http://nmap.org/ncat )
Ncat: Generating a temporary 1024-bit RSA key. Use --ssl-key and
--ssl-cert to use a permanent one.
Ncat: SHA-1 fingerprint: F5AA 6EEA 2C73 BC99 1CA6 304D 47B4 242D E65F 2054
NCAT DEBUG: Initialized fdlist with 63 maxfds
Ncat: Listening on :::31337
NCAT DEBUG: Added fd 132 to list, nfds 1, maxfd 132
Ncat: Listening on 0.0.0.0:31337
NCAT DEBUG: Added fd 136 to list, nfds 2, maxfd 136
NCAT DEBUG: Added fd 0 to list, nfds 3, maxfd 136
NCAT DEBUG: Initialized fdlist with 60 maxfds
NCAT DEBUG: selecting, fdmax 136
NCAT DEBUG: select returned 1 fds ready
NCAT DEBUG: fd 132 is ready
Ncat: Connection from ::1.
NCAT DEBUG: Swapping fd[0] (132) with fd[2] (0)
NCAT DEBUG: Removed fd 132 from list, nfds 2, maxfd 136
NCAT DEBUG: Swapping fd[1] (136) with fd[1] (136)
NCAT DEBUG: Removed fd 136 from list, nfds 1, maxfd 0
Ncat: Connection from ::1:53957.
NCAT DEBUG: Added fd 152 to list, nfds 2, maxfd 152
NCAT DEBUG: selecting, fdmax 152
NCAT DEBUG: select returned 1 fds ready
NCAT DEBUG: fd 152 is ready
NCAT DEBUG: selecting, fdmax 152
NCAT DEBUG: select returned 1 fds ready
NCAT DEBUG: fd 152 is ready
NCAT DEBUG: selecting, fdmax 152
NCAT DEBUG: select returned 1 fds ready
NCAT DEBUG: fd 152 is ready
NCAT DEBUG: Swapping fd[1] (152) with fd[1] (152)
NCAT DEBUG: Removed fd 152 from list, nfds 1, maxfd 0
NCAT DEBUG: Executing:
"C:\cygwin\home\d33tah\shared\ncat\ncat-env-ncatins\ncat\Debug\ncat.exe"
--lua-exec-internal "scripts\hello-ncatout.lua"
NCAT DEBUG: Creating named pipe "\\.\pipe\ncat-3716-0"
NCAT DEBUG: Creating named pipe "\\.\pipe\ncatout-3716-0"
NCAT DEBUG: Creating named pipe "\\.\pipe\ncatin-3716-0"
NCAT DEBUG: Register subprocess 0000010C at index 0.
NCAT DEBUG: WaitForMultipleObjects iteration... i=2
NCAT DEBUG: WaitForMultipleObjects iteration... i=2
NCAT DEBUG: WaitForMultipleObjects iteration... i=2
NCAT DEBUG: WaitForMultipleObjects iteration... i=1
NCAT DEBUG: WaitForMultipleObjects iteration... i=2
NCAT DEBUG: ncatin_thread_func: reading stdin...NCAT DEBUG:
WaitForMultipleObjects iteration... i=0
NCAT DEBUG: WaitForMultipleObjects iteration... i=0
NCAT DEBUG: Unregister subprocess 0000010C from index 0.
NCAT DEBUG: Subprocess still running, terminating it.
NCAT DEBUG: Subprocess ended with exit code 259.
NCAT DEBUG: Terminating subprocesses
NCAT DEBUG: max_index 1

The same issue happens in connect mode. I failed to debug it with
MSVC, so I'd like to ask you guys for help. I hadn't ruled out bugs in
OpenSSL library yet.

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


Current thread: