Home page logo
/

nmap-dev logo Nmap Development mailing list archives

BUG: ncat does not get response from server (ssl connection + binary data sent)
From: "Kartik ." <17kartik17 () gmail com>
Date: Sun, 23 Mar 2014 11:48:48 +0100

Hi,

There is a bug with the last version 6.40-2 when sending binary data (with
a cat for example) to a ncat ssl connection. The ncat does not get the
response from the server. *It does not happen when using nmap v6.01*.
Tested with OSX and Linux versions.

command used:
$ cat binary_data_file | ncat --ssl IP_ADDRESS PORT

However, when using fifo, it works correctly regardless of the version used:
$mkfifo pipe
$ncat -l -k -p PORT <pipe | ncat --ssl IP_ADDRESS PORT | tee pipe

Hereunder verbose ouput:


###########################################################################
###########################################################################


$ cat test | ncat --ssl -vvvvvvvvv IP_ADDRESS PORT

*Ncat: Version 6.40-2* ( http://nmap.org/ncat )
NCAT DEBUG: Not doing certificate verification.
libnsock nsi_new2(): nsi_new (IOD #1)
libnsock msevent_new(): msevent_new (IOD #1) (EID #9)
libnsock nsock_connect_ssl(): SSL connection requested to
IP_ADDRESS:PORT/tcp (IOD #1) EID 9
libnsock nsp_add_event(): NSE #9: Adding event
libnsock nsock_loop(): nsock_loop() started (no timeout). 1 events pending
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 9
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 9
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 9
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 9
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 9
libnsock process_event(): NSE #9: Sending event
libnsock nsock_trace_handler_callback(): Callback: SSL-CONNECT SUCCESS for
EID 9 [IP_ADDRESS:PORT]
Ncat: SSL connection to IP_ADDRESS:PORT.
Ncat: SHA-1 fingerprint: 7172 75E6 AD6E 12BE 3649 0AFD DB75 B7D2 803D 4788
libnsock nsi_new2(): nsi_new (IOD #2)
libnsock msevent_new(): msevent_new (IOD #1) (EID #18)
libnsock nsock_read(): Read request from IOD #1 [IP_ADDRESS:PORT] (timeout:
-1ms) EID 18
libnsock nsp_add_event(): NSE #18: Adding event
libnsock msevent_new(): msevent_new (IOD #2) (EID #26)
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2 [peer
unspecified] EID 26
libnsock nsp_add_event(): NSE #26: Adding event
libnsock msevent_delete(): msevent_delete (IOD #1) (EID #9)
libnsock process_event(): Processing event 18
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 18
libnsock process_event(): Processing event 26
libnsock process_event(): NSE #26: Sending event
libnsock nsock_trace_handler_callback(): Callback: READ SUCCESS for EID 26
[(null):-1] (259 bytes)
libnsock msevent_new(): msevent_new (IOD #1) (EID #35)
libnsock nsock_write(): Write request for 259 bytes to IOD #1 EID 35
[IP_ADDRESS:PORT]
libnsock nsp_add_event(): NSE #35: Adding event
libnsock msevent_delete(): msevent_delete (IOD #2) (EID #26)
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 18
libnsock process_event(): Processing event 35
libnsock process_event(): NSE #35: Sending event
libnsock nsock_trace_handler_callback(): Callback: WRITE SUCCESS for EID 35
[IP_ADDRESS:PORT]
libnsock msevent_new(): msevent_new (IOD #2) (EID #42)
libnsock nsock_readbytes(): Read request for 0 bytes from IOD #2
[(null):-1] EID 42
libnsock nsp_add_event(): NSE #42: Adding event
libnsock msevent_delete(): msevent_delete (IOD #1) (EID #35)
libnsock process_event(): Processing event 42
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 18
libnsock process_event(): Processing event 42
libnsock process_event(): NSE #42: Sending event
libnsock nsock_trace_handler_callback(): Callback: READ EOF for EID 42
[(null):-1]
libnsock msevent_delete(): msevent_delete (IOD #2) (EID #42)
libnsock select_loop(): wait for events
libnsock process_event(): Processing event 18
libnsock process_event(): NSE #18: Sending event
libnsock nsock_trace_handler_callback(): Callback: READ EOF for EID 18
[IP_ADDRESS:PORT]
libnsock msevent_delete(): msevent_delete (IOD #1) (EID #18)
Ncat: 259 bytes sent, *0 bytes received* in 0.20 seconds.
libnsock nsi_delete(): nsi_delete (IOD #1)
libnsock nsi_delete(): nsi_delete (IOD #2)





###########################################################################
###########################################################################


$ cat test | ncat --ssl -vvvvvvvvv IP_ADDRESS PORT
*Ncat: Version 6.01* ( http://nmap.org/ncat )
NCAT DEBUG: Not doing certificate verification.
NSOCK (0.0020s) SSL connection requested to IP_ADDRESS:PORT/tcp (IOD #1)
EID 9
NSOCK (0.1500s) Callback: SSL-CONNECT SUCCESS for EID 9 [IP_ADDRESS:PORT]
Ncat: SSL connection to IP_ADDRESS:PORT.
Ncat: SHA-1 fingerprint: 7172 75E6 AD6E 12BE 3649 0AFD DB75 B7D2 803D 4788
NSOCK (0.1510s) Read request from IOD #1 [IP_ADDRESS:PORT] (timeout: -1ms)
EID 18
NSOCK (0.1510s) Read request for 0 bytes from IOD #2 (peer unspecified) EID
26
NSOCK (0.1510s) Callback: READ SUCCESS for EID 26 [(null):-1] (259 bytes)
NSOCK (0.1510s) Write request for 259 bytes to IOD #1 EID 35
[IP_ADDRESS:PORT]
NSOCK (0.1510s) Callback: WRITE SUCCESS for EID 35 [IP_ADDRESS:PORT]
NSOCK (0.1510s) Read request for 0 bytes from IOD #2 [(null):-1] EID 42
NSOCK (0.1510s) Callback: READ EOF for EID 42 [(null):-1]
NSOCK (0.2380s) Callback: READ SUCCESS for EID 18 [IP_ADDRESS:PORT] (*324
bytes*)
*[***DATA SENT BY THE SERVER***]*
NSOCK (0.2380s) Read request for 0 bytes from IOD #1 [IP_ADDRESS:PORT] EID
50


###########################################################################
###########################################################################


Hope that helps,
Regards,
Kartik.
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


  By Date           By Thread  

Current thread:
  • BUG: ncat does not get response from server (ssl connection + binary data sent) Kartik . (Mar 23)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]