Nmap 6.46 on Android

I’ve just cross compiled Nmap 6.46 on Android since I did not do it for a while. If you just need binary, it’s here:

http://ftp.linux.hr/android/nmap/nmap-6.46-android-arm-bin.tar.bz2

If you need details, go here:
https://secwiki.org/w/Nmap/Android

Building Nmap from source (without SSL)

If you want to build it from the source, process is pretty straightforward:

git clone https://github.com/kost/nmap-android.git
cd nmap-android
cp -a android ~/src/nmap-6.46/
cd ~/src/nmap-6.46/android
#(adjust paths if needed in Makefile)
make doit

Building Nmap from source (with OpenSSL)

I see many people try to cross compile Nmap with OpenSSL support. Since, I did not specify OpenSSL part of cross compiling, I see there’s lot of complicated ways people do it. For example, like Gorjan Petrovski here:

http://blog.umitproject.org/2012/05/cross-compilation-of-static-nmap-with.html

In short, compiling of whole Android tree is not necessary. You just need to use same compiler for everything. I’m assuming you have NDK installed and standalone toolchain in PATH.

For building zlib, I’m using following snippet:

export CCARCH=arm-linux-androideabi
CC="${CCARCH}-gcc" ./configure --prefix=/sdcard/opt/zlib-1.2.8
make
make install

For building OpenSSL, I’m using following snippet:


export CCARCH=arm-linux-androideabi
./Configure dist --prefix=/sdcard/opt/openssl-1.0.1i
make CC="${CCARCH}-gcc" AR="${CCARCH}-ar r" RANLIB="${CCARCH}-ranlib" LDFLAGS="-static"
make install

For building Nmap, I’m using following snippet:


git clone https://github.com/kost/nmap-android.git
cd nmap-android
cp -a android ~/src/nmap-6.46/
cd ~/src/nmap-6.46/android
#(YOU have to EDIT makefile to adjust NDK and OpenSSL paths)
make havendk

Note: If you plan to compile OpenSSL support, you need to edit Makefile before issuing make havendk in order to specify OpenSSL path.

You should have binaries in place after build. You can strip them and transfer to your Android device.

Advertisements

One Response to Nmap 6.46 on Android

  1. Pingback: Nmap 6.49BETA4 on Android | k0st

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: