Nmap Development mailing list archives

Nmap 6.49BETA4 on Android


From: Vlatko Kosturjak <kost () linux hr>
Date: Mon, 13 Jul 2015 07:17:07 +0200

Hello!

6.49BETA4 got released, so I’ve managed to cross compile the new version as well.

For those who just wants the binaries, they are here (binaries should work on Android 4+ out of the box):
https://s3.amazonaws.com/nmap-dl/nmap-android/nmap-6.49BETA4-android-arm-bin.tar.bz2
https://s3.amazonaws.com/nmap-dl/nmap-android/nmap-6.49BETA4-android-i686-bin.tar.bz2
https://s3.amazonaws.com/nmap-dl/nmap-android/nmap-6.49BETA4-android-mipsel-bin.tar.bz2

Or if you don’t want to bother with this manual installing at all, you can download Network Mapper application from 
Play store at following URL:
https://play.google.com/store/apps/details?id=org.kost.nmap.android.networkmapper

Since, I’m using completely different approach in building it from the source, it’s worth mentioning major changes: 
binaries are now dynamically linked (due to DNS issues) and compiled with PIE support (due to Lollipop support). 
Dynamic linking is done against minimal number of libraries for DNS to work (mostly libc).

Note that I tried hardly to fix all reported bugs and issues (DNS resolving for example). If it will work for everyone, 
I will
focus on UI user experience (design, help, etc).

= Building Android version of Nmap from the source

In order to build Android version of Nmap from the source, you will need Android NDK and Makefile/scripts available 
from the following URL:
https://github.com/kost/nmap-android

Just follow instructions from README.md file.

In order to build Android UI, you will need Android SDK and NetworkMapper source available from the following URL:
https://github.com/kost/NetworkMapper

Just import the project in Android Studio and build it from there.

= Running binaries on previous Android versions

Since new binaries are compiled with PIE support and Android versions prior to version 4 did not support PIE – does 
that mean there’s no way to run these binaries on older systems? It’s not completely true. There is a way to run these 
binaries, but the process involves of compiling small snippet available at gist:

This small executable helps in running PIE executables where the linker doesn’t support PIE. So, for previous Android 
versions, you need to compile above gist and run nmap binary as following:

run_pie nmap_android_binary --version

Alternative would be to use old (6.47) statically compiled binaries (but no DNS resolving - sorry!):
http://seclists.org/nmap-dev/2015/q1/45

= About the patches

Since libpcap was updated in the meantime, this fix is not needed any more:
http://seclists.org/nmap-dev/2015/q1/152

List of patches this time:
10-fix-lua-cflags.diff - fixes CFLAGS - is there any way to make it possible to specify through env variable?
20-fix-lua-locale.diff - infamous locale fix, unfortunately, it is still needed
30-fix-nping-sysexits.diff - android does not have sysexits... 
40-fix-libpcap-bond.diff - wifi interface on Android does not have ifbond interface
50-fix-libpcap-ffs.diff - ffs on Android x86 architecture is not present, but on arm/mips it is. Quite strange. Looks 
like bug in Android NDK (using 10d)

= Links

Blog post about this:
https://k0st.wordpress.com/2015/07/13/nmap-6-49beta4-on-android/

Hope it helps,
-- 
Vlatko Kosturjak - KoSt
_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: