Paul Koch
unread,Feb 19, 2013, 2:20:40 AM2/19/13You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I am using FreeBSD /usr/bin/nc, which is apparently an import of the
OpenBSD nc code.
When connecting to a remote telnet daemon on port 23 and using the -t
option to process the telnet protocol commands, garbage characters
appear in the output. Passing the output through hexdump shows the
characters are telnet command options (eg. FF FD 01 FF FD ....).
This is because...
in netcat.c the following code is run:
if (tflag)
atelnet(nfd, buf, n);
if (atomicio(vwrite, lfd, buf, n) != n)
return;
The atelnet() function is processing the telnet command options but
isn't removing them from 'buf', so the write is outputting them.
atelnet() should probably remove the processed characters, compact the
'buf' and return the number of chars left in 'buf' for the write to use.
Paul Koch.