From 0d47952611198ef6b1163f366dc03922d20b1475 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:42:04 +0200 Subject: Adding upstream version 7.94+git20230807.3be01efb1+dfsg. Signed-off-by: Daniel Baumann --- macosx/BUNDLING.md | 130 ++++++++++++++++++++++ macosx/Makefile | 187 ++++++++++++++++++++++++++++++++ macosx/README.md | 96 ++++++++++++++++ macosx/check_test.sh | 124 +++++++++++++++++++++ macosx/createdmg.sh | 76 +++++++++++++ macosx/nmap.pmdoc/01nmap-contents.xml | 3 + macosx/nmap.pmdoc/01nmap.xml | 25 +++++ macosx/nmap.pmdoc/02zenmap-contents.xml | 3 + macosx/nmap.pmdoc/02zenmap.xml | 37 +++++++ macosx/nmap.pmdoc/03ncat-contents.xml | 3 + macosx/nmap.pmdoc/03ncat.xml | 25 +++++ macosx/nmap.pmdoc/04ndiff-contents.xml | 3 + macosx/nmap.pmdoc/04ndiff.xml | 25 +++++ macosx/nmap.pmdoc/05nping-contents.xml | 3 + macosx/nmap.pmdoc/05nping.xml | 25 +++++ macosx/nmap.pmdoc/index.xml | 56 ++++++++++ macosx/nmap.png | Bin 0 -> 116077 bytes macosx/openssl.modules | 81 ++++++++++++++ macosx/pkg_bg.jpg | Bin 0 -> 200397 bytes 19 files changed, 902 insertions(+) create mode 100644 macosx/BUNDLING.md create mode 100644 macosx/Makefile create mode 100644 macosx/README.md create mode 100755 macosx/check_test.sh create mode 100755 macosx/createdmg.sh create mode 100644 macosx/nmap.pmdoc/01nmap-contents.xml create mode 100644 macosx/nmap.pmdoc/01nmap.xml create mode 100644 macosx/nmap.pmdoc/02zenmap-contents.xml create mode 100644 macosx/nmap.pmdoc/02zenmap.xml create mode 100644 macosx/nmap.pmdoc/03ncat-contents.xml create mode 100644 macosx/nmap.pmdoc/03ncat.xml create mode 100644 macosx/nmap.pmdoc/04ndiff-contents.xml create mode 100644 macosx/nmap.pmdoc/04ndiff.xml create mode 100644 macosx/nmap.pmdoc/05nping-contents.xml create mode 100644 macosx/nmap.pmdoc/05nping.xml create mode 100644 macosx/nmap.pmdoc/index.xml create mode 100644 macosx/nmap.png create mode 100644 macosx/openssl.modules create mode 100644 macosx/pkg_bg.jpg (limited to 'macosx') diff --git a/macosx/BUNDLING.md b/macosx/BUNDLING.md new file mode 100644 index 0000000..904144e --- /dev/null +++ b/macosx/BUNDLING.md @@ -0,0 +1,130 @@ +# Table of Contents +--- + + * [Jhbuild](#jhbuild) + * Possible error + * [gtk-mac-bundler](#bundler) + * [How to use](#howto) + * Prerequisite + * Usage + +## Jhbuild + +In order to set up Jhbuild properly before building Nmap suite, follow the tutorial at [https://wiki.gnome.org/Projects/GTK%2B/OSX/Building](https://wiki.gnome.org/Projects/GTK%2B/OSX/Building), but keep reading this file if you encounter any error... + +If you had any error, just type the following command to delete jhbuild, + + $ rm -rf ~/.local ~/.new_local ~/.cache ~/.config ~/Source/jhbuild ~/Source/pyenv ~/Library/Caches/pip* ~/gtk + +And we'll start over together: + +1. First, simply download the following script in your _$HOME_ directory ([https://git.gnome.org/browse/gtk-osx/plain/gtk-osx-build-setup.sh](https://git.gnome.org/browse/gtk-osx/plain/gtk-osx-build-setup.sh)). Edit it to make sure that `MACOSX_DEPLOYMENT_TARGET` exists and is set to the lowest supported version of OS X, e.g. "10.11". Then run it: + + ~~~~ + $ sh gtk-osx-build-setup.sh + ~~~~ + + And add it to your _$PATH_, so you can run jhbuild without the absolute path: + + ~~~~ + $ export PATH=$HOME/.local/bin:$PATH + ~~~~ + +2. In `~/.jhbuildrc-custom`, make sure that this line is setup properly and matches `MACOSX_DEPLOYMENT_TARGET` from step 1: + + ~~~~ + setup_sdk(target="10.11") + ~~~~ + +3. Now do, + + ~~~~ + $ jhbuild bootstrap-gtk-osx + ~~~~ + + To install missing dependencies (with **--force** option to force rebuilding).
+ +4. And, + + ~~~~ + $ jhbuild build meta-gtk-osx-bootstrap + $ jhbuild build meta-gtk-osx-core + +5. Now we need Python2 and the GTK2 bindings for it, but gtk-osx has built +Python3, and the bindings will prefer that even though the dev headers aren't +present. Specifically, we need pycairo prior to 1.19 (when they dropped Python2 +support) and gtk-integration-python. There's got to be a better way, but what I +did was first install python2: + + $ jhbuild build python + +Then install pycairo. This is necessary because if it's missing for Python 2, +the other bindings won't build for Python 2 either. Make sure version is less +than 1.19 in ~/.cache/jhbuild/gtk-osx-python.modules. This may "succeed" but it +will have built the Python3 bindings. Clear out the build tree and make sure +the source will prefer python2: + + $ jhbuild build pycairo + $ rm -rf ~/.cache/jhbuild/build/pycairo-* + $ sed -i 's/python3/python2/' ~/gtk/source/pycairo-*/meson_options.txt + $ jhbuild build pycairo + +Now build the rest of the python bindings. Some of these will fail (and maybe +they failed as prereqs for pycairo earlier), so hang on and I'll tell you how +to fix those: + + $ jhbuild build meta-gtk-osx-python + +Ok, when you get a failure, that's your chance to reconfigure with python2. +Jhbuild will give you some options; choose "4. start a shell" and then check +for the proper configuration command (may be visible in scrollback, otherwise +check config.log) and copy it. Clear out the build directory (probably the +current directory, ~/.cache/jhbuild/build/package-name-version/*) then from +there run the configuration command with PYTHON variable overridden, e.g.: + + $ PYTHON=$(which python2) ~/gtk/source/package-name-version/configure --some-options + +Now exit that shell and go to the build step. This might mean "ignore error and +continue with build" or it might mean "rerun step build" depending on when the +error happened. + +### Possible error + +For those of you who have this error while trying to make, + +~~~~ +svn: E155021: This client is too old to work with the working copy at... +~~~~ + +You need to **update SVN**.
+Go to [http://www.wandisco.com/subversion/download#osx](http://www.wandisco.com/subversion/download#osx) and download and install the approriate version for your OS. + +Now, add the path for the new SVN version to your _$PATH_: + +~~~~ +$ export PATH=/opt/subversion/bin:$PATH +~~~~ + +## gtk-mac-bundler + +Now that Jhbuild is properly configured, we need to install **gtk-mac-bundler** in order to render the bundle file: + +~~~~ +$ git clone git://git.gnome.org/gtk-mac-bundler +$ cd gtk-mac-bundler +$ make install +~~~~ + +## How to use +#### Prerequisite: +—`openssl.modules`: + +This is a jhbuild moduleset that can be used to build/update openssl. + +#### Usage: + +Now use it like this: + +~~~~ +$ jhbuild -m openssl.modules build nmap-deps +~~~~ diff --git a/macosx/Makefile b/macosx/Makefile new file mode 100644 index 0000000..a9e7327 --- /dev/null +++ b/macosx/Makefile @@ -0,0 +1,187 @@ +# This makefile builds a disk image (.dmg) containing the installer for Nmap, +# Zenmap, Ncat, and Ndiff. + +export NMAP_VERSION := $(shell echo NMAP_VERSION | $(CPP) -imacros ../nmap.h - | sed -n '$$s/[" ]//g;$$p') +OSX_VERSION=$(shell sw_vers -productVersion | cut -d'.' -f1,2 | tr -d ' ') +OSX_MIN_VERSION = 10.15 + +NAME_VERSION = nmap-$(NMAP_VERSION)$(if $(APPENDAGE),-$(APPENDAGE)) + +IMAGE_NAME = $(NAME_VERSION).dmg +PKG_NAME = $(NAME_VERSION).mpkg + +IMAGE_STAGING_DIR = $(NAME_VERSION) + +NMAP_BUILD_DIR = nmap-build +NMAP_STAGING_DIR = nmap-root + +ZENMAP_BUILD_DIR = zenmap-build +ZENMAP_STAGING_DIR = zenmap-root + +NCAT_BUILD_DIR = ncat-build +NCAT_STAGING_DIR = ncat-root + +NDIFF_BUILD_DIR = ndiff-build +NDIFF_STAGING_DIR = ndiff-root + +NPING_BUILD_DIR = nping-build +NPING_STAGING_DIR = nping-root + +JHBUILD_PREFIX=$(HOME)/gtk/inst +JHBUILD_SOURCE=$(HOME)/gtk/source +PREFIX = /usr/local + +# Extra distribution file names +README_FILE = README.md +LICENSE_FILE = LICENSE +3RD_P_LIC_FILE = 3rd-party-licenses.txt +LICENSES_FILE = licenses + +EXTRA_DIST = README.md ../LICENSE ../docs/3rd-party-licenses.txt ../docs/licenses + +CONFIGURE_ARGS = --prefix="$(PREFIX)" --with-libdnet=included --with-libpcap=included --with-libpcre=included --with-liblua=included CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" PYTHON="$(PYTHON)" + +CFLAGS = -mmacosx-version-min=$(OSX_MIN_VERSION) +CXXFLAGS = -mmacosx-version-min=$(OSX_MIN_VERSION) + +# Jhbuild static libraries +PYTHON = $(JHBUILD_PREFIX)/bin/python3 +OPENSSL_STATIC = $(JHBUILD_PREFIX)/lib/libssl.a $(JHBUILD_PREFIX)/lib/libcrypto.a +LIBZ_STATIC = $(JHBUILD_PREFIX)/lib/libz.a + +# These are the positions used by the createdmg.sh and check_test.sh scripts +export ICON_SIZE=88 +export FONT_SIZE=13 +export MPKG_POS_X=110 +export MPKG_POS_Y=170 +export APPS_POS_X=110 +export APPS_POS_Y=310 +export README_POS_X=802 +export README_POS_Y=180 +export LICENSE_POS_X=802 +export LICENSE_POS_Y=310 +export THIRD_P_POS_X=802 +export THIRD_P_POS_Y=440 +export LICENSES_POS_X=670 +export LICENSES_POS_Y=60 + +$(IMAGE_NAME): tool-checks $(IMAGE_STAGING_DIR)/$(PKG_NAME) + rm -f $@ + # Create the dmg disk image and convert it to read only disk + ./createdmg.sh $(IMAGE_STAGING_DIR) $(README_FILE) $(LICENSE_FILE) $(3RD_P_LIC_FILE) $(LICENSES_FILE) + # Check the created disk image for the sizes, backgrounds and icons presence and positions + ./check_test.sh $(README_FILE) $(LICENSE_FILE) $(3RD_P_LIC_FILE) $(LICENSES_FILE) + +tool-checks: have-$(CC) have-jhbuild have-gtk-mac-bundler + +have-%: + which $* + +#$(IMAGE_STAGING_DIR)/$(PKG_NAME): check-nmap check-ncat check-ndiff check-zenmap check-nping LICENSE.formatted +$(IMAGE_STAGING_DIR)/$(PKG_NAME): check-nmap check-ncat check-ndiff check-zenmap check-nping LICENSE.formatted + rm -rf $(IMAGE_STAGING_DIR) + mkdir -p $(IMAGE_STAGING_DIR) + cp -rf $(EXTRA_DIST) $(IMAGE_STAGING_DIR)/ + # Create packages (.pkg) for all the components to install in the installer (.mpkg) + pkgbuild --root $(NMAP_STAGING_DIR) --identifier org.insecure.nmap --version $(NMAP_VERSION) --install-location /usr/local nmap.pkg + pkgbuild --root $(NCAT_STAGING_DIR) --identifier org.insecure.nmap.ncat --version $(NMAP_VERSION) --install-location /usr/local ncat.pkg + pkgbuild --root $(NDIFF_STAGING_DIR)/usr/local --identifier org.insecure.nmap.ndiff --version $(NMAP_VERSION) --install-location /usr/local ndiff.pkg + pkgbuild --root $(NPING_STAGING_DIR) --identifier org.insecure.nmap.nping --version $(NMAP_VERSION) --install-location /usr/local nping.pkg + pkgbuild --root $(ZENMAP_STAGING_DIR) --identifier org.insecure.nmap.zenmap --version $(NMAP_VERSION) --install-location /Applications zenmap.pkg + + # Produce a .xml with packages information + productbuild --synthesize \ + --package 'nmap.pkg' \ + --package 'ncat.pkg' \ + --package 'ndiff.pkg' \ + --package 'nping.pkg' \ + --package 'zenmap.pkg' \ + distribution.xml + + # Make a new file and add background and title attributes + head -n 2 distribution.xml > finalDist.xml + echo " Nmap $(NMAP_VERSION)" >> finalDist.xml + # This line is for adding a background image to the .mpkg + echo " " >> finalDist.xml + tail -n +3 distribution.xml >> finalDist.xml + + # Build the .mpkg according to the final .xml file (and so all the .pkg) + productbuild --distribution finalDist.xml --resources . --package-path . $(NAME_VERSION).mpkg + + mv $(NAME_VERSION).mpkg $(NAME_VERSION)/$(NAME_VERSION).mpkg + +check-%: stage-% + (find $*-root -perm -a+x -type f | xargs otool -L | awk '/:$$/{e=$$0}index($$0,"$(JHBUILD_PREFIX)"){x=1;print e; print}END{exit x}') && echo "Libs are clean" + +export-%: + rm -rf $* +# Using @BASE discards local changes. + svn export .. $* + +export-tarball: + rm -rf nmap-$(NMAP_VERSION) + svn export .. nmap-$(NMAP_VERSION) + tar czf nmap-$(NMAP_VERSION).tar.gz nmap-$(NMAP_VERSION) + cp nmap-$(NMAP_VERSION).tar.gz $(JHBUILD_SOURCE)/pkgs/ + +xstage-nmap: export-$(NMAP_BUILD_DIR) + cd $(NMAP_BUILD_DIR) && ./configure --without-zenmap --without-ncat --without-ndiff --without-nping --with-openssl="$(JHBUILD_PREFIX)" --with-libz="$(JHBUILD_PREFIX)" $(CONFIGURE_ARGS) + # LIB* is libssh2's name for *_LIBS + make -C $(NMAP_BUILD_DIR) OPENSSL_LIBS="$(OPENSSL_STATIC)" LIBSSL="$(OPENSSL_STATIC)" ZLIB_LIBS="$(LIBZ_STATIC)" LIBZ="$(LIBZ_STATIC)" + rm -rf $(NMAP_STAGING_DIR) + make -C $(NMAP_BUILD_DIR) install DESTDIR="`pwd`/$(NMAP_STAGING_DIR)" OPENSSL_LIBS="$(OPENSSL_STATIC)" ZLIB_LIBS="$(LIBZ_STATIC)" + +xstage-ncat: export-$(NCAT_BUILD_DIR) + cd $(NCAT_BUILD_DIR) && ./configure --without-zenmap --with-ncat --without-ndiff --without-nping --with-openssl="$(JHBUILD_PREFIX)" $(CONFIGURE_ARGS) + make -C $(NCAT_BUILD_DIR) build-ncat OPENSSL_LIBS="$(OPENSSL_STATIC)" + rm -rf $(NCAT_STAGING_DIR) + make -C $(NCAT_BUILD_DIR) install-ncat DESTDIR="`pwd`/$(NCAT_STAGING_DIR)" OPENSSL_LIBS="$(OPENSSL_STATIC)" + +xstage-nping: export-$(NPING_BUILD_DIR) + cd $(NPING_BUILD_DIR) && ./configure --without-zenmap --without-ncat --without-ndiff --with-nping --with-openssl="$(JHBUILD_PREFIX)" $(CONFIGURE_ARGS) + make -C $(NPING_BUILD_DIR) build-nping OPENSSL_LIBS="$(OPENSSL_STATIC)" + rm -rf $(NPING_STAGING_DIR) + make -C $(NPING_BUILD_DIR) install-nping DESTDIR="`pwd`/$(NPING_STAGING_DIR)" OPENSSL_LIBS="$(OPENSSL_STATIC)" + +openssl.modules: ../nmap.h + sed -i.bak '/ENTITY nmap_version/s/\".*\"/\"$(NMAP_VERSION)\"/' $@ + +stage-%: export-tarball openssl.modules + jhbuild -m "file://`pwd`/openssl.modules" build $* + rm -rf $*-root + mkdir $*-root + rsync -a --files-from "$(JHBUILD_PREFIX)/_jhbuild/manifests/$*" "$(JHBUILD_PREFIX)" $*-root/ + +stage-zenmap: export-$(ZENMAP_BUILD_DIR) + cd $(ZENMAP_BUILD_DIR)/zenmap && jhbuild run install_scripts/macosx/make-bundle.sh + rm -rf $(ZENMAP_STAGING_DIR) + mkdir -p $(ZENMAP_STAGING_DIR) + cp -rf $(ZENMAP_BUILD_DIR)/zenmap/dist/Zenmap.app $(ZENMAP_STAGING_DIR) + +stage-ndiff: export-$(NDIFF_BUILD_DIR) + mkdir -p $(NDIFF_STAGING_DIR)/usr/local/bin + mkdir -p $(NDIFF_STAGING_DIR)/usr/local/share/man/man1 + cp $(NDIFF_BUILD_DIR)/ndiff/ndiff.py $(NDIFF_STAGING_DIR)/usr/local/bin/ndiff + cp $(NDIFF_BUILD_DIR)/ndiff/docs/ndiff.1 $(NDIFF_STAGING_DIR)/usr/local/share/man/man1/ + +LICENSE.formatted: +# Use the license formatter from the Windows installer. + ../mswin32/license-format/licformat.sh ../LICENSE > $@ + +clean: + rm -rf $(IMAGE_STAGING_DIR) + rm -rf $(NMAP_BUILD_DIR) + rm -rf $(NMAP_STAGING_DIR) + rm -rf $(ZENMAP_BUILD_DIR) + rm -rf $(ZENMAP_STAGING_DIR) + rm -rf $(NCAT_BUILD_DIR) + rm -rf $(NCAT_STAGING_DIR) + rm -rf $(NDIFF_BUILD_DIR) + rm -rf $(NDIFF_STAGING_DIR) + rm -rf $(NPING_BUILD_DIR) + rm -rf $(NPING_STAGING_DIR) + rm -f LICENSE.formatted + rm -f $(IMAGE_NAME) + rm -rf distribution.xml finalDist.xml nmap.pkg ncat.pkg ndiff.pkg nping.pkg zenmap.pkg + +.PHONY: clean export-% stage-% diff --git a/macosx/README.md b/macosx/README.md new file mode 100644 index 0000000..c79fdb3 --- /dev/null +++ b/macosx/README.md @@ -0,0 +1,96 @@ +# Table of Contents +--- + + * [Introduction](#intro) + * [Requirements](#requ) + * [Installation](#install) + * [Files in this directory](#files) + * [Zenmap](#zenmap) + * [Repositories and Troubleshooting](#repo) + * [The CONTRIBUTING file](#contributing) + +## Introduction + + * **Nmap** is a free and open source utility for network exploration and security auditing. + * **Zenmap** is a multi-platform graphical frontend and results viewer for Nmap. + * **Ncat** is a general-purpose network sending and receiving utility, a reimplementation of Netcat. + * **Ndiff** is a an Nmap scan comparison utility. + * **Nping** is a tool for packet generation and sending. + +This package contains Nmap, Zenmap, Ncat, Ndiff, and Nping. It is intended to work on Intel Macs running **Mac OS X 10.8 or later**. + +Installation of all packages is optional. Unselect Zenmap to get just the command-line tool. Unselect Nmap if you prefer to use a copy of Nmap that is already installed. Zenmap will not work without Nmap. + +The nmap, ncat, ndiff, and nping command-line binaries will be installed in `/usr/local/bin`, and additional support files will be installed in `/usr/local/share`. The Zenmap application bundle will be installed in `/Applications/Zenmap.app`. + +For a full description of Nmap's installation on Mac OS, visit the page: +[https://nmap.org/book/inst-macosx.html](https://nmap.org/book/inst-macosx.html) + +## Requirements + +In order to compile, build and run Nmap on Mac OS, you will requiere the followings: + +1. **Jhbuild** for bundling and dependencies (see the [BUNDLING file](../BUNDLING.md)) +2. **Xcode** for Mac OS 10.8 or later ([https://developer.apple.com/xcode](https://developer.apple.com/xcode/)) +3. **Xcode Command-line Tools** for Mac OS 10.8 or later ([https://developer.apple.com/downloads](https://developer.apple.com/downloads/) — then download the latest version compatible with your OS version) + +## Installation + +Ideally, you should be able to just type: + + ./configure + make + make install + +from `nmap/` directory (the root folder). + +For far more in-depth compilation, installation, and removal notes, read the **Nmap Install Guide** at [https://nmap.org/book/install.html](https://nmap.org/book/install.html). + +## Files in this directory + +* [openssl.modules](openssl.modules): This is a Jhbuild moduleset that can be used to build dependencies (openssl) as required for building Nmap, Ncat, and Nping. Use it like this: + + ~~~~ + $ jhbuild -m openssl.modules build nmap-deps + ~~~~ + +* [Makefile](Makefile): The Mac OS X Makefile used to build everything specific to this OS. +* [BUNDLING.md](BUNDLING.md): A manual on how to setup and use Jhbuild on Mac OS X. + +## Zenmap + +### Files into `zenmap/install_scripts/macosx/`: + +All of the files have to do with packaging on Mac OS X. They are useful only for those wanting to build binary distributions of Zenmap for Mac OS X. + +* [Info.plist](../zenmap/install_scripts/macosx/Info.plist): A properties list file template that is filled out by [make-bundle.sh](../zenmap/install_scripts/macosx/make-bundle.sh). +* [make-bundle.sh](../zenmap/install_scripts/macosx/make-bundle.sh): This script builds a .app bundle. It must be run from the root of the Zenmap source tree. The finished bundle is put in `dist/Zenmap.app`. +* [zenmap.icns](../zenmap/install_scripts/macosx/zenmap.icns): The icon file for the bundle. It was created using the Icon Composer utility (`$ open -a "Icon Composer"`). +* [zenmap_auth.c](../zenmap/install_scripts/macosx/zenmap_auth.c): This is a simple wrapper program that attempts to run [launcher.sh](../zenmap/install_scripts/macosx/launcher.sh) with privileges. +* [launcher.sh](../zenmap/install_scripts/macosx/launcher.sh): A launcher script that configures the environment for Zenmap, Python, and GTK before launching the main Zenmap script file. +* [zenmap.bundle](../zenmap/install_scripts/macosx/zenmap.bundle): An XML configuration file for gtk-mac-bundler which specifies files and metadata for the application bundle ([https://wiki.gnome.org/Projects/GTK%2B/OSX/Building](https://wiki.gnome.org/Projects/GTK%2B/OSX/Building)). + +### Authorization Wrapper: + +The **bundling** process is as follows: + +1. First, the bundler ([make-bundle.sh](../zenmap/install_scripts/macosx/make-bundle.sh)) look at the bundle XML (`zenmap.bundle`) and copy everything over. +2. The launcher script ([launcher.sh](../zenmap/install_scripts/macosx/launcher.sh)) gets renamed into the app name (`Zenmap`). +3. The authorization wrapper is compiled to `Zenmap` so that it is the entry point of the app. +4. The last part is filling in the [Info.plist template file](../zenmap/install_scripts/macosx/Info.plist) based on the current information in `zenmap.ZenmapCore.Version`. + +After the bundling process is done and the app is installed, the **execution** path is as follows: + +**Zenmap (zenmap_auth) —> zenmap.bin (launcher.sh) —> python zenmap.py** + +## Repositories and Troubleshooting + +Nmap uses a read-only repository on **Github** for issues tracking and pull requests. You can contribute at the following address: [https://github.com/nmap/nmap](https://github.com/nmap/nmap). + +The read-write repository is managed with **Subversion**. Although, all actual commits are made to our Subversion repository on [https://svn.nmap.org](https://svn.nmap.org/). + +In order to be always up to date, you can consult the Changelog here: [https://nmap.org/changelog.html](https://nmap.org/changelog.html). + +## The CONTRIBUTING file + +General information about contributing to Nmap can be found in the [CONTRIBUTING file](../CONTRIBUTING.md). It contains information specifically about Nmap's use of Github and how contributors can use Github services to participate in **Nmap development**. diff --git a/macosx/check_test.sh b/macosx/check_test.sh new file mode 100755 index 0000000..b547401 --- /dev/null +++ b/macosx/check_test.sh @@ -0,0 +1,124 @@ +#!/bin/sh -e + +test -n "${NMAP_VERSION}" || exit 1 +export title="nmap-${NMAP_VERSION}" +export disk="/Volumes/${title}" +export backgroundPictureName="nmap.png" +export finalDMGName="${title}.dmg" +export applicationName="${title}.mpkg" +RES="True" +NB_FILES=7 + +hdiutil attach ${finalDMGName} + +# Try to list files in the Volume, if we can't, its because its not ready yet +# so we should sleep while its mounted before trying to check if everything is ok +stop=false +while [ "$stop" = false ]; do + test=`ls -l /Volumes/${title}/ | wc -l` + if [ "$test" -eq $NB_FILES ]; then + stop=true + fi + sleep 1 +done + +echo "\nDisk: ${disk}" +echo "Checking positions...\n" + +export MPKG=`echo ' + tell application "Finder" + set f to POSIX file "'${disk}'/'${applicationName}'" as alias + get properties of f + end tell +' | osascript | grep -o 'position:[0-9]*, [0-9]*' | awk -F':' '{ print $2 }'` + +export README=`echo ' + tell application "Finder" + set f to POSIX file "'${disk}'/'$1'" as alias + get properties of f + end tell +' | osascript | grep -o 'position:[0-9]*, [0-9]*' | awk -F':' '{ print $2 }'` + +export LICENSE=`echo ' + tell application "Finder" + set f to POSIX file "'${disk}'/'$2'" as alias + get properties of f + end tell +' | osascript | grep -o 'position:[0-9]*, [0-9]*' | awk -F':' '{ print $2 }'` + +export LICENSES_3RD=`echo ' + tell application "Finder" + set f to POSIX file "'${disk}'/'$3'" as alias + get properties of f + end tell +' | osascript | grep -o 'position:[0-9]*, [0-9]*' | awk -F':' '{ print $2 }'` + +export LICENSES=`echo ' + tell application "Finder" + set f to POSIX file "'${disk}'/'$4'" as alias + get properties of f + end tell +' | osascript | grep -o 'position:[0-9]*, [0-9]*' | awk -F':' '{ print $2 }'` + +if [ "$MPKG" = "$MPKG_POS_X, $MPKG_POS_Y" ]; then + echo "${applicationName}: OK" +else + echo "${applicationName}: Wrong" + RES="False" +fi; + +if [ "$README" = "$README_POS_X, $README_POS_Y" ]; then + echo "README.md: OK" +else + echo "README.md: Wrong" + RES="False" +fi; + +if [ "$LICENSE" = "$LICENSE_POS_X, $LICENSE_POS_Y" ]; then + echo "LICENSE: OK" +else + echo "LICENSE: Wrong" + RES="False" +fi; + +if [ "$LICENSES_3RD" = "$THIRD_P_POS_X, $THIRD_P_POS_Y" ]; then + echo "3rd-party-licenses.txt: OK" +else + echo "3rd-party-licenses.txt: Wrong" + RES="False" +fi; + +if [ "$LICENSES" = "$LICENSES_POS_X, $LICENSES_POS_Y" ]; then + echo "licenses: OK" +else + echo "licenses: Wrong" + RES="False" +fi; + +export BG=`echo ' + tell application "Finder" + set f to POSIX file "'${disk}'/.background/'${backgroundPictureName}'" as alias + if exists file f then + return true + else + return false + end if + end tell +' | osascript` + +if [ "$BG" = "true" ]; then + echo "\nBackground exists: Yes\n" +else + echo "\nBackground exists: No\n" + RES="False" +fi; + +hdiutil detach ${disk} + +if [ "$RES" = "True" ]; then + echo "\nTest passed?: Yes\n" + exit 0 +else + echo "\nTest passed?: No\nThere are some errors that should be corrected\n" + exit 1 +fi; diff --git a/macosx/createdmg.sh b/macosx/createdmg.sh new file mode 100755 index 0000000..1c80507 --- /dev/null +++ b/macosx/createdmg.sh @@ -0,0 +1,76 @@ +#!/bin/sh -e +set -x + +test -n "${NMAP_VERSION}" || exit 1 +export source=$1 +export title="nmap-${NMAP_VERSION}" +export size=50000 +export backgroundPictureName="nmap.png" +export finalDMGName="${title}.dmg" +export applicationName="${title}.mpkg" +NB_FILES=7 + +rm -rf ${source}/.background/${backgroundPictureName} +rm -rf ${source}/.background/ +rm -rf pack.temp.dmg +rm -rf ${title}.dmg +rm -rf ${source}/Applications + +# Copy the background image to the background of the image disk +mkdir ${source}/.background/ +cp ${backgroundPictureName} ${source}/.background/ +ln -s /Applications ${source}/ + +# Ensure that we have no virtual disk currently mounted +hdiutil detach /Volumes/${title}/ 2> /dev/null || true + +hdiutil create -srcfolder "${source}" -volname "${title}" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -ov -format UDRW -size ${size}k pack.temp.dmg + +# Mount the disk image and store the device name +export device=$(hdiutil attach -readwrite -noverify -noautoopen "pack.temp.dmg" | egrep '^/dev/' | sed 1q | awk '{print $1}') + +# Try to list files in the Volume, if we can't, its because its not ready yet +# so we should sleep while its mounted before trying to design it with Applescript +stop=false +while [ "$stop" = false ]; do + test=`ls -l /Volumes/${title}/ | wc -l` + if [ "$test" -eq $NB_FILES ]; then + stop=true + fi + sleep 1 +done + +# Applescript: design the virtual disk image we just mounted +# This will fail if there is not a graphical login +echo ' + tell application "Finder" + tell disk "'${title}'" + open + + set current view of container window to icon view + set toolbar visible of container window to false + set statusbar visible of container window to false + set the bounds of container window to {100, 100, 1000, 660} + set theViewOptions to the icon view options of container window + set icon size of theViewOptions to '${ICON_SIZE}' + set text size of theViewOptions to '${FONT_SIZE}' + set arrangement of theViewOptions to not arranged + set background picture of theViewOptions to file ".background:'${backgroundPictureName}'" + + set position of item "'${applicationName}'" of container window to {'${MPKG_POS_X}', '${MPKG_POS_Y}'} + set position of item "Applications" of container window to {'${APPS_POS_X}', '${APPS_POS_Y}'} + set position of item "'$2'" of container window to {'${README_POS_X}', '${README_POS_Y}'} + set position of item "'$3'" of container window to {'${LICENSE_POS_X}', '${LICENSE_POS_Y}'} + set position of item "'$4'" of container window to {'${THIRD_P_POS_X}', '${THIRD_P_POS_Y}'} + set position of item "'$5'" of container window to {'${LICENSES_POS_X}', '${LICENSES_POS_Y}'} + + update without registering applications + + close + end tell + end tell +' | osascript - + +hdiutil detach ${device} +hdiutil convert "pack.temp.dmg" -format UDZO -imagekey zlib-level=9 -o "${finalDMGName}" +rm -f pack.temp.dmg diff --git a/macosx/nmap.pmdoc/01nmap-contents.xml b/macosx/nmap.pmdoc/01nmap-contents.xml new file mode 100644 index 0000000..d93b4ef --- /dev/null +++ b/macosx/nmap.pmdoc/01nmap-contents.xml @@ -0,0 +1,3 @@ + + + diff --git a/macosx/nmap.pmdoc/01nmap.xml b/macosx/nmap.pmdoc/01nmap.xml new file mode 100644 index 0000000..67e0dc6 --- /dev/null +++ b/macosx/nmap.pmdoc/01nmap.xml @@ -0,0 +1,25 @@ + + + org.insecure.nmap.Nmap.pkg + 1 + + + + Nmap + / + + + + + parent + installFrom.isRelativeType + + + 01nmap-contents.xml + /CVS$ + /\.svn$ + /\.cvsignore$ + /\.cvspass$ + /\.DS_Store$ + + diff --git a/macosx/nmap.pmdoc/02zenmap-contents.xml b/macosx/nmap.pmdoc/02zenmap-contents.xml new file mode 100644 index 0000000..a5d41b4 --- /dev/null +++ b/macosx/nmap.pmdoc/02zenmap-contents.xml @@ -0,0 +1,3 @@ + + + diff --git a/macosx/nmap.pmdoc/02zenmap.xml b/macosx/nmap.pmdoc/02zenmap.xml new file mode 100644 index 0000000..0082370 --- /dev/null +++ b/macosx/nmap.pmdoc/02zenmap.xml @@ -0,0 +1,37 @@ + + + org.insecure.nmap.Zenmap.pkg + 1 + + + + Zenmap/Applications/Zenmap.app + /Applications + + + + + parent + installFrom.isRelativeType + + + 02zenmap-contents.xml + + + + + + + + + + /CVS$ + /\.svn$ + /\.cvsignore$ + /\.cvspass$ + /\.DS_Store$ + + diff --git a/macosx/nmap.pmdoc/03ncat-contents.xml b/macosx/nmap.pmdoc/03ncat-contents.xml new file mode 100644 index 0000000..a178a29 --- /dev/null +++ b/macosx/nmap.pmdoc/03ncat-contents.xml @@ -0,0 +1,3 @@ + + + diff --git a/macosx/nmap.pmdoc/03ncat.xml b/macosx/nmap.pmdoc/03ncat.xml new file mode 100644 index 0000000..b0d5e4c --- /dev/null +++ b/macosx/nmap.pmdoc/03ncat.xml @@ -0,0 +1,25 @@ + + + org.insecure.nmap.Ncat.pkg + 1 + + + + Ncat + / + + + + + parent + installFrom.isRelativeType + + + 03ncat-contents.xml + /CVS$ + /\.svn$ + /\.cvsignore$ + /\.cvspass$ + /\.DS_Store$ + + diff --git a/macosx/nmap.pmdoc/04ndiff-contents.xml b/macosx/nmap.pmdoc/04ndiff-contents.xml new file mode 100644 index 0000000..63000ce --- /dev/null +++ b/macosx/nmap.pmdoc/04ndiff-contents.xml @@ -0,0 +1,3 @@ + + + diff --git a/macosx/nmap.pmdoc/04ndiff.xml b/macosx/nmap.pmdoc/04ndiff.xml new file mode 100644 index 0000000..08dc0a0 --- /dev/null +++ b/macosx/nmap.pmdoc/04ndiff.xml @@ -0,0 +1,25 @@ + + + org.insecure.nmap.Ndiff.pkg + 1 + + + + Ndiff + / + + + + + parent + installFrom.isRelativeType + + + 04ndiff-contents.xml + /CVS$ + /\.svn$ + /\.cvsignore$ + /\.cvspass$ + /\.DS_Store$ + + diff --git a/macosx/nmap.pmdoc/05nping-contents.xml b/macosx/nmap.pmdoc/05nping-contents.xml new file mode 100644 index 0000000..9138f05 --- /dev/null +++ b/macosx/nmap.pmdoc/05nping-contents.xml @@ -0,0 +1,3 @@ + + + diff --git a/macosx/nmap.pmdoc/05nping.xml b/macosx/nmap.pmdoc/05nping.xml new file mode 100644 index 0000000..cf4ca27 --- /dev/null +++ b/macosx/nmap.pmdoc/05nping.xml @@ -0,0 +1,25 @@ + + + org.insecure.nping.Nping.pkg + 1 + + + + Nping + / + + + + + parent + installFrom.isRelativeType + + + 01nping-contents.xml + /CVS$ + /\.svn$ + /\.cvsignore$ + /\.cvspass$ + /\.DS_Store$ + + diff --git a/macosx/nmap.pmdoc/index.xml b/macosx/nmap.pmdoc/index.xml new file mode 100644 index 0000000..4287e94 --- /dev/null +++ b/macosx/nmap.pmdoc/index.xml @@ -0,0 +1,56 @@ + + + Nmap + org.insecure + + + + + + + + + + + + + + + + + + + + + + + + + + + + README + LICENSE.formatted + + + + 01nmap.xml + 02zenmap.xml + 03ncat.xml + 04ndiff.xml + 05nping.xml + properties.customizeOption + properties.title + properties.anywhereDomain + properties.systemDomain + diff --git a/macosx/nmap.png b/macosx/nmap.png new file mode 100644 index 0000000..f7337c3 Binary files /dev/null and b/macosx/nmap.png differ diff --git a/macosx/openssl.modules b/macosx/openssl.modules new file mode 100644 index 0000000..e558703 --- /dev/null +++ b/macosx/openssl.modules @@ -0,0 +1,81 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/pkg_bg.jpg b/macosx/pkg_bg.jpg new file mode 100644 index 0000000..8604350 Binary files /dev/null and b/macosx/pkg_bg.jpg differ -- cgit v1.2.3