John Tregoning rss icon

Apr 18 2008

Installing nmap on linux with no root/sudo access

I found myself needing to verify what ports are open on my home network, I decided to install nmap into my host provider shell account, for which unfortunately I don't get sudo/root access. After looking through the nmap's makefile for a while I came up with this script:

#!/bin/bash

LATEST_STABLE_NMAP='nmap-4.60'
FILE_EXT='.tar.bz2'

wget http://download.insecure.org/nmap/dist/${LATEST_STABLE_NMAP}${FILE_EXT}
bzip2 -cd ${LATEST_STABLE_NMAP}${FILE_EXT} | tar xvf -

cd ${LATEST_STABLE_NMAP}

./configure
make

cp ./nmap ../

#zenmap GUI for nmap (comment out if not required)
cp -r ./zenmap ../
ln -sf ../zenmap ../nmapfe
ln -sf ../zenmap ../xnmap

#Copy only the relevant dictionary/db/config files
find . -maxdepth 1 -type f -name "nmap-*" ! -iname "*.*" -exec cp '{}' ../ \;

#clean up
cd ..
rm -r ${LATEST_STABLE_NMAP}
rm ${LATEST_STABLE_NMAP}${FILE_EXT}
Link to script file: here

Later on that day, after successfully running nmap on my sudoless account I found out about nmap-online.com... duh!

Tagged as: , , , , , , , ,