Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: Ncrack 0.4ALPHA Release
From: "Luis MartinGarcia." <luis.mgarc () gmail com>
Date: Thu, 28 Apr 2011 15:26:58 +0200

On 04/28/2011 03:01 PM, ithilgore - wrote:
On Thu, Apr 28, 2011 at 3:05 PM, Luis MartinGarcia.
<luis.mgarc () gmail com> wrote:
On 04/28/2011 01:32 PM, ithilgore - wrote:
Hello nmap-dev.

I am pleased to announce the 0.4ALPHA release of the high-speed
network authentication cracking tool Ncrack. This release brings you the VNC
module - a fine contribution by rhh of rycon.hu, the Ncrack
Developer's Guide (which
has also been announced on a separate mail previously) and some additional
(mostly debugging) extensions and important bug fixes.

I haven't tested the VNC module, as I have not VNC server I can play
with, but I'm happy to report that it compiles fine on my 2.6.35-23
x86_64 box. Just one thing: I get a small warning:

ncrack_rdp.cc: In function ‘int rdp_get_crypto(Connection*, u_char*)’:
ncrack_rdp.cc:3224: warning: format ‘%d’ expects type ‘int’, but
argument 4 has type ‘long int’
ncrack_rdp.cc:3224: warning: format ‘%d’ expects type ‘int’, but
argument 4 has type ‘long int’
Hello Luis,
I don't get this warning with either gcc version 4.6.0 20110415
(prerelease) on x86 or gcc version 4.5.2 20110127 (prerelease) (GCC)
on x86_64 

I think that's because in x86, pointers are 32 bits long while in x86_64
pointers are 64bits long, which makes them long integers.

but nevertheless I think it's better to fix it by changing
snprintf to use %ld instead of casting to int (which might have an
impact on precision)

I chose to cast to int because I find it very unlikely that substraction
of those two pointers will result in a value higher than 2^31. Also,
I've encountered portability annoyances in the past with printf format
specifiers for "long" types, because (if I recall correctly), for
unsigned longs, some systems want "%lu", some others prefer "%ul", etc.

Anyway, as it's a debug message, it doesn't really matter how you fix
the warning. If you want to use %ld, i think it's fine.


Luis MartinGarcia.

Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]