nmap / ncrack

Ncrack network authentication tool
Other
1.05k stars 235 forks source link

ncrack fails to compile: multiple definition of `umac_ctx' #128

Closed blshkv closed 1 year ago

blshkv commented 1 year ago
crypto.cc:863:44: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  863 |         register unsigned long fval, work, right, leftt;
      |                                            ^~~~~
crypto.cc:863:51: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  863 |         register unsigned long fval, work, right, leftt;
      |                                                   ^~~~~
crypto.cc:864:22: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  864 |         register int round;
      |                      ^~~~~
ncrack_resume.cc: In function ‘int ncrack_resume(char*, int*, char***)’:
ncrack_resume.cc:477:10: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying 7 bytes from a string of the same length [-Wstringop-truncation]
  477 |   strncpy(ncrack_arg_buffer, "ncrack ", 7);
      |          ^
Compiling Ncrack...
rm -f ncrack
x86_64-pc-linux-gnu-g++ -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Lnbase -Lnsock/src -Lopensshlib   -o ncrack ncrack.o utils.o TargetGroup.o Target.o targets.o NcrackOps.o Service.o ServiceGroup.o Connection.o services.o timing.o ncrack_error.o output.o ncrack_tty.o Buf.o NcrackOutputTable.o ncrack_input.o ncrack_resume.o crypto.o http.o http_digest.o xml.o ntlmssp.o modules/ncrack_ssh.o modules/ncrack_smb.o modules/ncrack_smb2.o modules/ncrack_rdp.o modules/ncrack_sip.o modules/ncrack_psql.o modules/ncrack_mysql.o modules/ncrack_winrm.o modules/ncrack_mongodb.o modules/ncrack_ftp.o modules/ncrack_telnet.o modules/ncrack_http.o modules/ncrack_pop3.o modules/ncrack_vnc.o modules/ncrack_redis.o modules/ncrack_owa.o modules/ncrack_imap.o modules/ncrack_cassandra.o modules/ncrack_mssql.o modules/ncrack_cvs.o modules/ncrack_wordpress.o modules/ncrack_joomla.o modules/ncrack_dicom.o modules/ncrack_mqtt.o -lnsock -lnbase -lssl -lcrypto -lopenssh 
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: opensshlib/libopenssh.a(umac128.o):(.bss+0x0): multiple definition of `umac_ctx'; opensshlib/libopenssh.a(umac.o):(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:69: ncrack] Error 1
make[1]: Leaving directory '/var/tmp/portage/net-analyzer/ncrack-0.7/work/ncrack-0.7'
make: *** [Makefile:64: all] Error 2
blshkv commented 1 year ago

build.log

emerge --info
fatal: detected dubious ownership in repository at '/var/db/repos/pentoo-overlay'
To add an exception for this directory, call:

        git config --global --add safe.directory /var/db/repos/pentoo-overlay
Portage 3.0.46 (python 3.11.4-final-0, default/linux/amd64/17.1/hardened, gcc-12, glibc-2.37-r3, 6.1.31-gentoo x86_64)
=================================================================
System uname: Linux-6.1.31-gentoo-x86_64-Intel-R-_Core-TM-_i7-10750H_CPU_@_2.60GHz-with-glibc2.37
KiB Mem:    16301140 total,   3452328 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Sun, 09 Jul 2023 01:45:01 +0000
Head commit of repository gentoo: c75b687ef09f4ebb1287a28be60dc441c9b46486
Timestamp of repository steam-overlay: Sun, 02 Jul 2023 15:32:30 +0000
Head commit of repository steam-overlay: 301e948a8983d54430c42621a58c8c9ccdc6231c

sh bash 5.1_p16-r6
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r6::gentoo
dev-java/java-config:      2.3.1-r1::gentoo
dev-lang/perl:             5.36.1-r2::gentoo
dev-lang/python:           3.11.4::gentoo
dev-lang/rust-bin:         1.69.0-r1::gentoo
dev-util/cmake:            3.26.4-r1::gentoo
dev-util/meson:            1.1.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.46::gentoo
sys-apps/sandbox:          2.32::gentoo
sys-devel/autoconf:        2.71-r6::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           16.0.5::gentoo
sys-devel/gcc:             11.3.1_p20230427::gentoo, 12.3.1_p20230526::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             16.0.5::gentoo
sys-devel/llvm:            14.0.6-r4::localrepo, 16.0.5::gentoo
sys-devel/make:            4.4.1-r1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.37-r3::gentoo
blshkv commented 1 year ago

the following debian patch fixes the problem:" https://sources.debian.org/patches/ncrack/0.7%2Bdebian-4/fix-gcc-10-build.patch/

blshkv commented 1 year ago

dup of https://github.com/nmap/ncrack/issues/120