Nmap Development mailing list archives

Re: ssh-hostkey.nse "threw an error!" - attempt to get length of local 'bdata' (a nil value)


From: Daniel Miller <bonsaiviking () gmail com>
Date: Tue, 16 Dec 2014 21:35:32 -0600

On Tue, Dec 16, 2014 at 6:51 PM, Forrest B. <forrest () securitymetrics com>
wrote:

Hey all!

I've encountered an error in the ssh-hostkey.nse script that is
happening on FreeBSD 9.2 running Nmap 6.40 as well as on Debian Jessie
running Nmap 6.47. I tried looking up the error message and found two
previous threads on the list that turned up in dead-ends.


Forrest,

Thanks for this excellent bug report! Taking the time to hunt down other
reports and including debug output made this one fairly simple to handle.
There are two fixes associated with your report: r33867 removes the crash
without fixing the bug, by removing the unneeded call to base64.enc(). As
it turns out, for SSH 2 hostkeys, this value is already encoded, so we were
double-encoding it for XML output :(

The complete fix is in r33868: our routines for fetching SSH 1 and SSH 2
hostkeys were returning slightly different structures, so the XML output
had no way to get the proper data for an SSH 1 hostkey. Now, the two
structures are more parallel, and both SSH version 1 and version 2 are
fully supported.

Thanks again,
Dan
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: