LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   nmap 6.40 current (https://www.linuxquestions.org/questions/slackware-14/nmap-6-40-current-4175471445/)

conraid 07-30-2013 07:17 AM

nmap 6.40 current
 
Has anyone tried to compile nmap 6.40 in current?

With standard SlackBuild (ftp://ftp.slackware.com/pub/slackwar...map.SlackBuild)

Code:

g++ -L../libpcap    -o nping ArgParser.o common.o common_modified.o nping.o NpingOps.o utils.o utils_net.o output.o stats.o NpingTargets.o NpingTarget.o EchoHeader.o EchoServer.o EchoClient.o ProbeMode.o NEPContext.o Crypto.o PacketDiff.o ../nbase/libnbase.a ../nsock/src/libnsock.a ../libnetutil/libnetutil.a -lssl -lcrypto ../libpcap/libpcap.a ../libdnet-stripped/src/.libs/libdnet.a -lnl -ldl
g++: error: ../libpcap/libpcap.a: File or directory not found
make[3]: *** [nping] Error 1
make[3]: Leaving directory `/tmp/nmap-6.40/nping'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/nmap-6.40/nping'
make[1]: *** [build-nping] Error 2
make[1]: Leaving directory `/tmp/nmap-6.40'
make: *** [all] Error 2

ok, add libpcap path --with-libpcap=/usr in configure, add -lnl-3 in flags, add libpcap path in nping Makefile, and..

make nping
Code:

make[1]: Entering directory `/tmp/nmap-6.40/nping'
Compiling nping
rm -f nping
g++ -L../libpcap    -o nping ArgParser.o common.o common_modified.o nping.o NpingOps.o utils.o utils_net.o output.o stats.o NpingTargets.o NpingTarget.o EchoHeader.o EchoServer.o EchoClient.o ProbeMode.o NEPContext.o Crypto.o PacketDiff.o ../nbase/libnbase.a ../nsock/src/libnsock.a ../libnetutil/libnetutil.a -lssl -lcrypto /usr/lib/libpcap.a ../libdnet-stripped/src/.libs/libdnet.a -lnl -ldl
/usr/lib/libpcap.a(pcap-linux.o): In function `nl80211_init':
pcap-linux.c:(.text+0xc27): undefined reference to `nl_socket_alloc'
pcap-linux.c:(.text+0xcbe): undefined reference to `nl_socket_free'
/usr/lib/libpcap.a(pcap-linux.o): In function `nl80211_cleanup':
pcap-linux.c:(.text+0xdae): undefined reference to `nl_socket_free'
/usr/lib/libpcap.a(pcap-canusb-linux.o): In function `canusb_close':
pcap-canusb-linux.c:(.text+0x10b): undefined reference to `pthread_join'
pcap-canusb-linux.c:(.text+0x11d): undefined reference to `libusb_close'
/usr/lib/libpcap.a(pcap-canusb-linux.o): In function `canusb_opendevice':
pcap-canusb-linux.c:(.text+0x285): undefined reference to `libusb_get_device_list'
pcap-canusb-linux.c:(.text+0x2d1): undefined reference to `libusb_get_device_descriptor'
pcap-canusb-linux.c:(.text+0x302): undefined reference to `libusb_open'
pcap-canusb-linux.c:(.text+0x330): undefined reference to `libusb_get_string_descriptor_ascii'
pcap-canusb-linux.c:(.text+0x365): undefined reference to `libusb_kernel_driver_active'
pcap-canusb-linux.c:(.text+0x37d): undefined reference to `libusb_detach_kernel_driver'
pcap-canusb-linux.c:(.text+0x395): undefined reference to `libusb_set_configuration'
pcap-canusb-linux.c:(.text+0x3ad): undefined reference to `libusb_claim_interface'
pcap-canusb-linux.c:(.text+0x3bd): undefined reference to `libusb_close'
pcap-canusb-linux.c:(.text+0x3e0): undefined reference to `libusb_free_device_list'
pcap-canusb-linux.c:(.text+0x401): undefined reference to `libusb_free_device_list'
/usr/lib/libpcap.a(pcap-canusb-linux.o): In function `canusb_capture_thread':
pcap-canusb-linux.c:(.text+0x42e): undefined reference to `libusb_init'
pcap-canusb-linux.c:(.text+0x4b0): undefined reference to `libusb_interrupt_transfer'
pcap-canusb-linux.c:(.text+0x4e0): undefined reference to `libusb_interrupt_transfer'
pcap-canusb-linux.c:(.text+0x51c): undefined reference to `libusb_bulk_transfer'
pcap-canusb-linux.c:(.text+0x557): undefined reference to `libusb_close'
pcap-canusb-linux.c:(.text+0x563): undefined reference to `libusb_exit'
/usr/lib/libpcap.a(pcap-canusb-linux.o): In function `canusb_activate':
pcap-canusb-linux.c:(.text+0x744): undefined reference to `libusb_interrupt_transfer'
pcap-canusb-linux.c:(.text+0x7a2): undefined reference to `pthread_create'
/usr/lib/libpcap.a(pcap-canusb-linux.o): In function `canusb_findalldevs':
pcap-canusb-linux.c:(.text+0x85d): undefined reference to `libusb_init'
pcap-canusb-linux.c:(.text+0x890): undefined reference to `libusb_get_device_list'
pcap-canusb-linux.c:(.text+0x8e1): undefined reference to `libusb_get_device_descriptor'
pcap-canusb-linux.c:(.text+0x912): undefined reference to `libusb_open'
pcap-canusb-linux.c:(.text+0x943): undefined reference to `libusb_get_string_descriptor_ascii'
pcap-canusb-linux.c:(.text+0x9a9): undefined reference to `libusb_close'
pcap-canusb-linux.c:(.text+0x9f7): undefined reference to `libusb_free_device_list'
pcap-canusb-linux.c:(.text+0xa20): undefined reference to `libusb_free_device_list'
pcap-canusb-linux.c:(.text+0xa2c): undefined reference to `libusb_exit'
/usr/lib/libpcap.a(pcap-canusb-linux.o): In function `canusb_create':
pcap-canusb-linux.c:(.text+0xa5c): undefined reference to `libusb_init'
collect2: error: ld returned 1 exit status
make[1]: *** [nping] Error 1
make[1]: Leaving directory `/tmp/nmap-6.40/nping'
make: *** [all] Error 2


I have no more ideas :-)

ponce 07-30-2013 08:10 AM

Code:

--- nmap.SlackBuild.orig        2013-07-30 15:09:44.136228682 +0200
+++ nmap.SlackBuild    2013-07-30 15:08:12.256228246 +0200
@@ -20,8 +20,8 @@
 #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-VERSION=${VERSION:-6.25}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-6.40}
+BUILD=${BUILD:-1}
 
 # Automatically determine the architecture we're building on:
 if [ -z "$ARCH" ]; then
@@ -74,11 +74,13 @@
 
 # --without-nmap-update is needed below to avoid depending on apr and subversion libraries.
 # It's not worth the feature IMHO.
+LIBS="-lnl" \
 CFLAGS="$SLKCFLAGS" \
 ./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --with-liblua=included \
+  --with-libpcap=included \
  --mandir=/usr/man \
  --docdir=/usr/doc/nmap-$VERSION \
  --without-nmap-update \


conraid 07-30-2013 08:25 AM

I forgot, it was the first thing I tried, but I put -lnl or -lnl-3 in CFLAGS not in LIBS

Thanks Ponce, I owe you a ponce ;-)


All times are GMT -5. The time now is 10:49 PM.