Nmap Development mailing list archives

Re: Nmap On Android


From: Jon Svede <jsvede () yahoo com>
Date: Sun, 6 Feb 2011 19:22:18 -0800 (PST)

Regarding using JNI to bridge to the Nmap binaries, I worked on a project using 
Nmap and Java.  At that time (2009/10) we were advised to avoid JNI because it 
would require us to continually rebuild binaries to keep current with the Nmap 
releases.  We were advised to use the Runtime.exec() integration so that we 
would have greater freedom from the Nmap release cycle.

After I left that job, I wrote a small open source library called Nmap4j which 
is on sourceforge.net (nmap4j.sourceforge.net).  It's purpose is to enable Java 
classes to run Nmap and get the output as Java objects.  It leverages the XML 
output of Nmap and uses a SAX parser to convert the data to objects.  I've 
tested it with some large XML files and it performs reasonably well; the largest 
file I parsed was around 1 million hosts, with 74000 up and the rest down; this 
took about 70 seconds to parse.  If this solution helped those wishing to 
develop a UI I'd be happy to assist with updates/changes/fixes to the Nmap4j 
library as needed.

I don't know much about Android development but I know it's Java friendly.  This 
library might be helpful if that is case.

Jon





________________________________
From: Vlatko Kosturjak <kost () linux hr>
To: luke jeter <luke.jeter () gmail com>
Cc: nmap-dev nmap-dev <nmap-dev () insecure org>
Sent: Sun, February 6, 2011 1:45:54 PM
Subject: Re: Nmap On Android

On 02/04/2011 05:06 PM, luke jeter wrote:
I've been talking about it since the end of last summer, but haven't had the
time to actually do anything, yet. The previous version I'm aware of
installed a pre-compiled Nmap binary and then ran it. I think a better
alternative is to leverage the Android NDK -- but other than getting the NDK
on my machine, I haven't really looked into the viability of this. I've been
given a 'green light' to do this as my project for one of my classes this
semester, so maybe I'll finally get something done, but it won't be very
robust and I plan to ignore the 'Androids don't have root access and can't
make raw packets' issue.

Nmap is ported on Android, so there's not too much left job to do on NDK
side. The binary works as root user as well as normal user. Of course,
if you don't have root access, you'll be limited what type of scanning
you can perform.

Something that was suggested to me last year, is that simply porting Nmap to
Android probably isn't a big enough project for GSoC (isn't the target ~1000
hours?). My suggestion would be to think of ways to extend or enhance it, as
well. Hopefully by May I'll be able to provide something for someone to
build on, or at least give an example of one implementation alternative.

My personal opinion (not Nmap official!) about further Android
advancement and what can be done as SoC (i.e. they are big enough):
- develop official Nmap Android frontend to Nmap binary. In this case
Android GUI would execute Nmap binary and parse results. Maybe John
Holden is willing to donate some of his interface code?
- proceed with "librarization" of Nmap: i.e. make library of nmap. I
think I saw this already on Nmap Gsoc page, but don't know why nobody
pick that. This would help in other efforts like rainmap/zenmap beside
Android. And we would skip this nasty bug as well:
http://www.crystax.net/trac/ticket/1
(As this bug is only present with binaries(!) and not libraries(!))
In this case, Java GUI would call nmap through library using Java Native
Interface (JNI).

Kost
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/



      
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: