LATEST NEWS

Installing nmap on rooted android devices

img
Apr
04

Hi all, this is basically what I came up with after mangling with nmap installation on my android. I am a command line guy so this is not something you get from Google Play. Yea you may find nmap for android there but that is installation files, while this is just a basic bash script to do that.

Please take note that your android device must be rooted to do this. IF your device is not rooted, you may try to do it alternately. Please refer here (https://secwiki.org/w/Nmap/Android)

Here is the script.

 nmap.sh

#!/system/xbin/bash

rm -Rf /data/local/nmap

cd /sdcard

if [ -f /sdcard/nmap-5.61TEST4-android-arm-bin.tar.bz2 ]
then
echo /sdcard/nmap-5.61TEST4-android-arm-bin.tar.bz2 found skipping download
tar -jxvf nmap-5.61TEST4-android-arm-bin.tar.bz2
else
wget http://ftp.linux.hr/android/nmap/nmap-5.61TEST4-android-arm-bin.tar.bz2
tar -jxvf nmap-5.61TEST4-android-arm-bin.tar.bz2
fi

#remount system for writing files
mount -o remount,rw /system

if [ -f /data/local/nmap ]
then
echo /data/local/nmap found skipping
else
mkdir /data/local/nmap
cp /sdcard/nmap-5.61TEST4/bin/* /data/local/nmap
cp /sdcard/nmap-5.61TEST4/share/nmap/*services* /data/local/nmap
rm -rf /sdcard/nmap-5.61TEST4-android-arm-bin.tar.bz2
rm -rf /sdcard/nmap-5.61TEST4
chmod 777 /data/local/nmap/*
fi

ln -s /data/local/nmap/nmap /system/xbin/nmap
mount -o remount,ro /system

nmap --version

Here are some screenshot of the script in action.

untar to system Downloading the binaries

For more references:

Share! Share!
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share