# If you ever want to uninstall Nmap, or clean up files from an old version
# before installing a new one, skip down to the bottom for instructions.
# Prerequisites:
# Python >= 2.7 and GTK+ (for Zenmap)
# libpcap (uses the system installed
# one if >= 0.9.4, otherwise uses the bundled one)
# PCRE
# lua
# OpenSSL (optional; leave off --with-openssl below to skip it)
# Glib
# GTK+ (for nmapfe)
cd
test -f installed/nmap-5.51.tar.bz2 && mv installed/nmap-5.51.tar.bz2 .
test ! -f nmap-5.51.tar.bz2 &&
wget http://download.insecure.org/nmap/dist/nmap-5.51.tar.bz2
# Here is where I got the md5sum from:
wget -q http://insecure.org/nmap/dist/sigs/nmap-5.51.tar.bz2.digest.txt \
-O - | grep " MD5 = " | tr -d [:space:] | tr [:upper:] [:lower:] | \
awk -F= '{ print $2 }'
# Here is where I got the sha1sum from:
wget -q http://insecure.org/nmap/dist/sigs/nmap-5.51.tar.bz2.digest.txt \
-O - | grep " SHA1 = " | tr -d [:space:] | tr [:upper:] [:lower:] | \
awk -F= '{ print $2 }'
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "nmap-*" -exec rm -r {} \;
tar xjvf ~/nmap-5.51.tar.bz2
cd nmap-5.51
test $UID = 0 && chown -R root:root .
# If you don't have OpenSSL installed in the usual source-installed place
# (/usr/local/ssl), like if you have a distribution package installed that
# puts it under the /usr prefix, leave off the --with-openssl part below and
# configure should find it.
# I pass --disable-nls to configure because I don't need any translations.
# I only read/write English (well), if that is not the case for you, leave
# that one off.
# If you don't want to even try to build the front-end, pass
# --without-nmapfe to configure
./configure --prefix=/usr --mandir=/usr/man \
--with-openssl=/usr/local/ssl --disable-nls
make
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg nmap
# Install the new version
make install
# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .