Issue While Installing NCrack 0.4Alpha

So today I was trying to install NCrack 0.4Alpha, and I encountered this problem of undeclared variable DE1 and userkey not in scope. Below are the commands to run and the red marks where the errors appear.

wget http://nmap.org/ncrack/dist/ncrack-0.4ALPHA.tar.gz
tar xzf ncrack-0.4ALPHA.tar.gz
cd ncrack-0.4ALPHA.tar.gz && ./configure
make
make install

The errors:

... 
crypto.cc: In function 'void deskey(unsigned char*, int)':
crypto.cc:545:14: error: 'DE1' was not declared in this scope
crypto.cc: In function 'void cookey(long unsigned int*)':
crypto.cc:590:14: error: 'usekey' was not declared in this scope
...

Online people suggest to install the following crypto packages. And then redo above installation steps.

sudo apt-get install build-essential checkinstall libssl-dev libssh-dev

It works, but it seems like we do not need to install those.

After digging into the code where it went wrong, the solution is to make the following changes in the file crypto.cc.

Change

...
        if( edf == DE1) m = (15 - i) << 1;
...

into:

...
        if( edf == 1) m = (15 - i) << 1;
...

And move

//void usekey(from) 
//register unsigned long *from; 
void usekey(
register unsigned long *from
)
{
    register unsigned long *to, *endp; 
    to = KnL, endp = &KnL[32]; 
    while( to < endp ) *to++ = *from++; 
    return; 
}

above

static void cookey(
register unsigned long *raw1
)
...

Then it'll work.

Leave a Reply

Your email address will not be published. Required fields are marked *