Home page logo

nmap-dev logo Nmap Development mailing list archives

Zenmap on Mac OS X howto
From: David Fifield <david () bamsoftware com>
Date: Thu, 3 Apr 2008 10:00:54 -0600


These are instructions for running Zenmap under Mac OS X, without having
to override your PYTHONPATH or any other hassle. I describe two ways to
do it, using MacPorts and Fink, two common systems for installing Unix
software on Mac OS X. I did this on a 10.5.2 system.

Start with an up-to-date checkout of Nmap.

To use either of these methods, you need the Xcode Tools. It comes with
an IDE and everything but basically you just want GCC and the build
infrastructure. I found it in a file called XcodeTools.mpkg on the
installation CD. You may be able to get the tools from
http://developer.apple.com/tools/download/ as well. If you do that,
please write back telling what you had to do (in terms of creating an
account or anything like that), so we can update the documentation at

Why is this howto necessary? Mac OS X doesn't ship with libraries
required by Zenmap: GTK+, PyGTK, and pysqlite. This howto is mostly
about getting those dependencies installed.

You also need Apple's X11 server installed. I found it installed by
default. There is an effort to make a native port of GTK+ to Mac OS X
(http://developer.imendio.com/projects/gtk-macosx/), which will
eliminate the requirement on the X server. However I built a version of
Zenmap against the native library and it has some deficiencies, like not
being able to minimize the window.

== Using MacPorts

MacPorts is easy to install and use, but while they package Nmap, they
don't package Zenmap. Use MacPorts to install the dependencies and then
build Nmap.

1. Download and run the MacPorts .dmg installer from
   http://www.macports.org/install.php. I used version 1.6.0.
2. The installer was supposed to make changes to my .profile, but for
   some reason it didn't. If that happens, make the changes to PATH and
   MANPATH recommended at http://guide.macports.org/#installing.shell.
3. Install PyGTK and all its dependencies:
     sudo port install py25-gtk
4. Install pysqlite. Note that this will install the sqlite3 package as
   a dependency.
     sudo port install py25-sqlite3
5. Uninstall sqlite3. There is some problem with the MacPorts sqlite3,
   and if you try to run Zenmap you'll get an error message reading
   "NULL result without error in PyObject_Call". The most helpful web
   page I could find about this problem is
   http://trac.edgewall.org/ticket/2969#comment:30. Anyway, removing the
   MacPorts sqlite3 so that pysqlite uses the sqlite3 that comes with
   Mac OS X fixes the problem.
     sudo port uninstall -f sqlite3
   The "-f" option uninstalls sqlite3 without uninstalling py25-sqlite3.
6. Now you have Python, PyGTK, and pysqlite installed in the MacPorts
   tree at /opt/local. Build Nmap, telling it which Python to use:
     cd nmap
     make PYTHON=/opt/local/bin/python2.5
     sudo make install
7. Run Zenmap.
     sudo /usr/local/bin/zenmap

== Using Fink

Fink is harder to set up, but both Nmap and Zenmap are packaged courtesy
of Daniel Johnson, so you don't need to compile Nmap yourself.

1. Download and extract the Fink source tarball from
   http://www.finkproject.org/download/index.php. I used version 0.28.1.
   Note there are binary distributions for versions of Mac OS X prior to
   10.5. I didn't try those, because 10.5 is only supported in the
   source distribution.
2. Run the bootstrap script.
     cd fink-0.28.1
   When you get the chance, select the "unstable" distribution.
3. Set up your environment variables.
   Then open a new terminal window to make sure the changes are applied.
4. Run
     fink selfupdate
   Choose "rsync" when you get the chance.
5. Install Nmap and Zenmap (both are in the nmap package).
     fink install nmap
6. Run Zenmap.

Any Mac users care to comment? I'm working on creating a .app bundle of
Zenmap, however that is turning out to be more difficult than

Can anyone in the know tell me the distinction between MacPorts and
DarwinPorts? Wikipedia says DarwinPorts is the old name, but it still
seems to have an independent web site.

David Fifield

Sent through the nmap-dev mailing list
Archived at http://SecLists.Org

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]