Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3506  / 2 Years ago, fri, june 10, 2022, 6:14:53

im trying to install



i tried following the instructions in the nmap site by doing this:



bzip2 -cd nmap-6.40.tar.bz2 | tar xvf -
cd nmap-6.40
./configure
make
su root
make install


and it all works well untill i type in make and i seem to get something that is an error



/nmap-6.40$ make
Compiling liblua
make[1]: Entering directory `/home/qayin/nmap-6.40/liblua'
make[1]: `liblua.a' is up to date.
make[1]: Leaving directory `/home/qayin/nmap-6.40/liblua'
Compiling liblinear
make[1]: Entering directory `/home/qayin/nmap-6.40/liblinear'
make[1]: `liblinear.a' is up to date.
make[1]: Leaving directory `/home/qayin/nmap-6.40/liblinear'
Compiling libpcap
make[1]: Entering directory `/home/qayin/nmap-6.40/libpcap'
VER=`cat ./VERSION`;
MAJOR_VER=`sed 's/([0-9][0-9]*)..*/1/' ./VERSION`;
gcc -shared -Wl,-soname,libpcap.so.$MAJOR_VER
-o libpcap.so.$VER pcap-linux.o pcap-usb-linux.o pcap-can-linux.o pcap-netfilter-linux.o fad-getad.o pcap.o inet.o gencode.o optimize.o nametoaddr.o etherent.o savefile.o sf-pcap.o sf-pcap-ng.o pcap-common.o bpf_image.o bpf_dump.o scanner.o grammar.o bpf_filter.o version.o
/usr/bin/ld: cannot open output file libpcap.so.1.2.1: Permission denied
collect2: ld returned 1 exit status
make[1]: *** [libpcap.so] Error 1
make[1]: Leaving directory `/home/qayin/nmap-6.40/libpcap'
make: *** [pcap_build] Error 2
qayin@kraken-PC:~/nmap-6.40$ sudo make
Compiling liblua
make[1]: Entering directory `/home/qayin/nmap-6.40/liblua'
make[1]: `liblua.a' is up to date.
make[1]: Leaving directory `/home/qayin/nmap-6.40/liblua'
Compiling liblinear
make[1]: Entering directory `/home/qayin/nmap-6.40/liblinear'
make[1]: `liblinear.a' is up to date.
make[1]: Leaving directory `/home/qayin/nmap-6.40/liblinear'
Compiling libpcap
make[1]: Entering directory `/home/qayin/nmap-6.40/libpcap'
VER=`cat ./VERSION`;
MAJOR_VER=`sed 's/([0-9][0-9]*)..*/1/' ./VERSION`;
gcc -shared -Wl,-soname,libpcap.so.$MAJOR_VER
-o libpcap.so.$VER pcap-linux.o pcap-usb-linux.o pcap-can-linux.o pcap-netfilter-linux.o fad-getad.o pcap.o inet.o gencode.o optimize.o nametoaddr.o etherent.o savefile.o sf-pcap.o sf-pcap-ng.o pcap-common.o bpf_image.o bpf_dump.o scanner.o grammar.o bpf_filter.o version.o
./config.status --file=pcap-config.tmp:./pcap-config.in
config.status: creating pcap-config.tmp
mv pcap-config.tmp pcap-config
chmod a+x pcap-config
make[1]: Leaving directory `/home/qayin/nmap-6.40/libpcap'
Compiling libpcre
make[1]: Entering directory `/home/qayin/nmap-6.40/libpcre'
make all-am
make[2]: Entering directory `/home/qayin/nmap-6.40/libpcre'
make[2]: Leaving directory `/home/qayin/nmap-6.40/libpcre'
make[1]: Leaving directory `/home/qayin/nmap-6.40/libpcre'
Compiling libdnet
make[1]: Entering directory `/home/qayin/nmap-6.40/libdnet-stripped'
Making all in include
make[2]: Entering directory `/home/qayin/nmap-6.40/libdnet-stripped/include'
make all-recursive
make[3]: Entering directory `/home/qayin/nmap-6.40/libdnet-stripped/include'
Making all in dnet
make[4]: Entering directory `/home/qayin/nmap-6.40/libdnet-stripped/include/dnet'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/qayin/nmap-6.40/libdnet-stripped/include/dnet'
make[4]: Entering directory `/home/qayin/nmap-6.40/libdnet-stripped/include'
make[4]: Leaving directory `/home/qayin/nmap-6.40/libdnet-stripped/include'
make[3]: Leaving directory `/home/qayin/nmap-6.40/libdnet-stripped/include'
make[2]: Leaving directory `/home/qayin/nmap-6.40/libdnet-stripped/include'
Making all in src
make[2]: Entering directory `/home/qayin/nmap-6.40/libdnet-stripped/src'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/qayin/nmap-6.40/libdnet-stripped/src'
make[2]: Entering directory `/home/qayin/nmap-6.40/libdnet-stripped'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/qayin/nmap-6.40/libdnet-stripped'
make[1]: Leaving directory `/home/qayin/nmap-6.40/libdnet-stripped'
Compiling libnbase
cd nbase && make
make[1]: Entering directory `/home/qayin/nmap-6.40/nbase'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/qayin/nmap-6.40/nbase'
Compiling libnsock
cd nsock/src && make
make[1]: Entering directory `/home/qayin/nmap-6.40/nsock/src'
cd ../../nbase && make
make[2]: Entering directory `/home/qayin/nmap-6.40/nbase'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/qayin/nmap-6.40/nbase'
make[1]: Leaving directory `/home/qayin/nmap-6.40/nsock/src'
cd ncat && make
make[1]: Entering directory `/home/qayin/nmap-6.40/ncat'
Compiling liblua
make[2]: Entering directory `/home/qayin/nmap-6.40/liblua'
make[2]: `liblua.a' is up to date.
make[2]: Leaving directory `/home/qayin/nmap-6.40/liblua'
Compiling libnsock
cd ../nsock/src && make
make[2]: Entering directory `/home/qayin/nmap-6.40/nsock/src'
cd ../../nbase && make
make[3]: Entering directory `/home/qayin/nmap-6.40/nbase'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/qayin/nmap-6.40/nbase'
make[2]: Leaving directory `/home/qayin/nmap-6.40/nsock/src'
gcc -o test/addrset -g -O2 -Wall -L../libpcap test/addrset.o ncat_core.o sys_wrap.o util.o ncat_lua.o -ldl -ldl ../nsock/src/libnsock.a ../nbase/libnbase.a -lpcap ./../liblua/liblua.a -lm
./../liblua/liblua.a(loadlib.o): In function `ll_sym':
/home/qayin/nmap-6.40/liblua/loadlib.c:142: undefined reference to `dlsym'
./../liblua/liblua.a(loadlib.o): In function `ll_load':
/home/qayin/nmap-6.40/liblua/loadlib.c:135: undefined reference to `dlopen'
./../liblua/liblua.a(loadlib.o): In function `ll_sym':
/home/qayin/nmap-6.40/liblua/loadlib.c:143: undefined reference to `dlerror'
./../liblua/liblua.a(loadlib.o): In function `ll_load':
/home/qayin/nmap-6.40/liblua/loadlib.c:136: undefined reference to `dlerror'
./../liblua/liblua.a(loadlib.o): In function `ll_unloadlib':
/home/qayin/nmap-6.40/liblua/loadlib.c:130: undefined reference to `dlclose'
collect2: ld returned 1 exit status
make[1]: *** [test/addrset] Error 1
make[1]: Leaving directory `/home/qayin/nmap-6.40/ncat'
make: *** [ncat_build] Error 2


anyhow i try to continue and su root and i get authentication failure for some reason, so i did sudo su instead, and then it says im root
but make install does not work, giving me the replay:
make: *** No rule to make targetlibnetutil/libnetutil.a', needed by nmap Stop.



ty


More From » 12.04

 Answers
5

I haven't tried buidling this version of nmap, but based on my previous experience there is an issue with the Makefile for the ncat subcomponent not respecting the gcc library link-order requirements with respect to libdl



If you only need nmap itself, then the easiest workaround is simply to configure the build without the ncat component i.e. run



./configure --without-ncat


and then perform the make and make install steps again. Since you used sudo for the make step last time you will likely need to do so again, since any object files will have been created with root ownership - however it would be preferable to fix the original ownership / permissions issue.




If you do need to build the ncat component, then you will probably have to edit the corresponding Makefile, as described here on ubuntuforums.org



You can read more about library link-order in the gcc documentation or see for example Linker order - GCC on stackoverflow


[#27897] Sunday, June 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lasagnerhead

Total Points: 487
Total Questions: 105
Total Answers: 122

Location: French Southern and Antarctic Lands
Member since Sun, May 3, 2020
4 Years ago
;