Nmap Development mailing list archives

Re: [NSE] Strange bug in broadcast-ms-sql-discover


From: Patrik Karlsson <patrik () cqure net>
Date: Thu, 27 Oct 2011 07:22:11 +0200

On Tue, Oct 25, 2011 at 12:09 PM, Duarte Silva
<duarte.silva () serializing me>wrote:

Hi,

I agree, with that, but I think a generic error message (without stack
traces)
would be better in order not to pollute the nmap output. Something like:

|_broadcast-ms-sql-discover: FAILURE: An unexpected failure occurred,
please
run with -d2 and --script-trace and report to ...

We could also think about generating a dump file (using a specific option
or in
a automatic fashion when a script failed with an exception) with the stack
trace and any useful information for tracking down the problem cause. Then
the
user would only have to submit that file.

Best regards,
Duarte Silva

On Monday 24 October 2011 22:32:08 David Fifield wrote:
On Mon, Oct 24, 2011 at 06:44:43PM +0200, Patrik Karlsson wrote:
Hi all,

I'm seeing the following error when running the
broadcast-ms-sql-discover
script:

NSE: 'broadcast-ms-sql-discover' (thread: 0x7feb3b19df40) threw an
error!
...sers/patrik/hacktools/rd/nmap-dev/./nselib/mssql.lua:2012: bad
argument #1 to 'set_port_version' (host is not being processed right
now)

I'm quite sure that this error did not occur in the past. Does anyone
have an idea why it's behaving this way, except for the obvious error
message? As a temporary fix I've commented out the line causing the
problem an committed it as r26928.

broadcast-ms-sql-discover doesn't have any real host tables to work
with, so it creates it own dummy tables.
        local host = { ip = "255.255.255.255" }
        local port = { number = 1434, protocol = "udp" }
But as it's a prerule script, Nmap hasn't actually created any Target
objects yet. I don't see how it could have worked before. Commenting it
out seems fine.

I noticed this error only after I enabled debugging as I was quite
certain there were SQL servers on the network.
I'm not all that happy with scripts silently failing unless running in
debug mode.
Does anyone else feel that this isn't all that great either?

I tend to agree that errors and stack traces should be visible by
default.

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


The generic error message suggesting to do -d2 and --script-trace works for
me.
I think the dump file may be overkill for now and that copying the output to
a mail would be sufficient.
David, any thoughts?

-- 
Patrik Karlsson
http://www.cqure.net
http://twitter.com/nevdull77
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: