Nmap Development mailing list archives

Re: Like to build a static, small basic nmap


From: Fyodor <fyodor () insecure org>
Date: Tue, 7 Nov 2006 14:17:35 -0800

On Tue, Nov 07, 2006 at 02:36:39PM +0100, Dominik wrote:

and tried out firstly with dynamic libs.

I got a ~900kB binary, with many outside libs:

Did you "strip" the binary?  When I compile 4.20ALPHA11 with the default options I get:

-rwx------ 1 fyodor fyodor 2283185 Nov  7 14:10 nmap

But after running "strip nmap" I get it down to 500K:

-rwx------ 1 fyodor fyodor 503408 Nov  7 14:10 nmap

I'm sure it could be reduced further by tweaking compile and configure
options, etc.

As for making a static version, that conflicts with your goal of
reducing the binary size.  But you can try "make clean; ./configure
--without-openssl; make static".  That may not work on all platforms.
On my Linux box, it results in this:

flog~/nmap>ls -l nmap
-rwx------ 1 fyodor fyodor 3063840 Nov  7 14:15 nmap*
flog~/nmap>ldd nmap
        not a dynamic executable

And stripping it cuts the size in half:

flog~/nmap>strip nmap
flog~/nmap>ls -ld nmap
-rwx------ 1 fyodor fyodor 1434416 Nov  7 14:16 nmap*

I hope this helps,
-Fyodor

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


Current thread: