Okay, so lately we got a new Nmap version 6.25 which has better support in detecting Windows 7 services and Windows 8. For full change log at Nmap you can click here. Now, since it has not been pushed in the repository, and it can for now be updates only by SubVersion we built this for you. This will detect local Nmap version and latest Nmap version and will download the tarball, decompress it and compile it.
You can get it directly via wget from here.
#! /bin/bash
# Moving to temporary directory to prevent junking the system
cd /tmp
curr_ver=`nmap -V | grep version`
curr_ver=`echo ${curr_ver:13:4}`
# Getting new Latest Nmap version
echo ""
echo ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo ''
echo ' .__.................__......................_._.........'
echo ' / _\.___..___....../ _\.___..___._..._._.__(_) |_._..._.'
echo ' \ \./ _ \/ _ \_____\ \./ _ \/ __| |.| | __| | __| |.| |'
echo ' _\ \ __/ __/_____|\ \ __/ (__| |_| | |..| | |_| |_| |'
echo ' \__/\___|\___|.....\__/\___|\___|\__,_|_|..|_|\__|\__, |'
echo ' ..................................................|___/.'
echo ''
echo ' Automatic Nmap Update Script'
echo ''
echo ' Built by Yuval (tisf) Nativ of the See-Security Group'
echo ''
echo ' http://www.see-security.com'
echo ' http://www.hackingdefined.org'
echo ''
echo ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo ""
if [[ $EUID -ne 0 ]]; then
echo ''
echo 'Error: This script must be run as root so that Nmap can be installed.' 1>&2
echo ''
exit 1
fi
echo "Getting latest Nmap Version."
wget http://nmap.org/download.html 2> /dev/null
var=`cat download.html | grep 'stable</u>--> Nmap release tarball'`
nmap_ver=`echo ${var:92:4}`
echo "Latest Nmap Version detected is $nmap_ver."
echo ""
echo "Currently installed is version $curr_ver when latest version is $nmap_ver."
echo "Do you with to continue with downloading and recompiling new source? [y/n]"
read answer
if [[ $answer == 'n' ]]; then
echo "Nothing to be done. Exiting now. "
echo ""
exit 1
fi
echo "Getting source code for Nmap $nmap_var......"
wget http://nmap.org/dist/nmap-`echo $nmap_ver`.tar.bz2 2> /dev/null
echo "Got tarball...."
tar xvjf nmap-*.tar.bz2
cd nmap-*
echo "Starting configuration and compilation. Please hold on, this might take some time."
./configure
make
sudo make install
echo "Installation all done. Please enjoy your new and updated Nmap $nmap_ver."
