Nmap Development mailing list archives

Re: stdnse.make_buffer(socket, "\r")


From: David Fifield <david () bamsoftware com>
Date: Mon, 29 Nov 2010 12:10:24 -0800

On Mon, Nov 29, 2010 at 02:49:48PM -0500, Patrick Donnelly wrote:
On Mon, Nov 29, 2010 at 1:53 PM, David Fifield <david () bamsoftware com> wrote:
On Sat, Nov 27, 2010 at 06:57:06PM +0200, Toni Ruottu wrote:
  hello

I am trying to chat with a server that uses "\r" as a line separator.
I do stdnse.make_buffer(socket, "\r") to handle buffering. The problem
is that make_buffer will never return anything unless the server sends
"\n". Is this considered appropriate behavior from make_buffer, or
would this be considered a bug? I am asking because fixing this for
each script separately would require duplicating lots of functionality
available in the standard library.

Probably the server is line-buffered and doesn't even send anything
until it has a '\n' to send. Run your program with --script-trace to see
what is going on. Also consider looking at a packet capture from tcpdump
or Wireshark.

Well, stdnse.make_buffer right now does line by line reads so it seems
this line should now be changed from
      local status, str = socket:receive_lines(1);
to
      local status, str = socket:receive();

Yes, I think you're right. Will you make the change?

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


Current thread: