From ArchWiki
Jump to navigation Jump to search

nmap 5.51

I noticed that openvas-check-setup complains about more recent versions of nmap - Arch uses v7 as of writing, but the script says only 5.51 is properly supported.

Unsure if this is the correct way to do it but grabbing and altering the [nmap-svn AUR]'s PKGBUILD to the following worked for me, so that it downloads the 5.51 tarball and compiles that. (Maintainer and contributor headings removed as I'm not sure if email addresses should be on the talk pages.. I'm new to commenting here. All credit to the maintainers and contributors in the above link)

pkgdesc="A network exploration tool and security/port scanner"
arch=('armv6h' 'armv7h' 'i686' 'x86_64')
license=('GPLv2' 'custom:nmap')
depends=('pcre' 'openssl' 'libpcap>=1.0.0' 'lua52' 'libnl')
makedepends=('python2' 'subversion') # python is needed for zenmap
optdepends=('pygtk: zenmap'
            'sudo: privilege escalation for zenmap'
            'xterm: privilege escalation for zenmap'
            'kdebase-runtime: privilege escalation for zenmap'
            'gksu: privilege escalation for zenmap')

pkgver() {
  cd "${srcdir}/nmap-${pkgver}"
  local ver="5.51"
  printf "%s" "${ver//[[:alpha:]]}"

build() {
  cd "${srcdir}/nmap-${pkgver}"

  sed -i 's# @LIBS@# @LIBS@ -lnl-3#' ncat/

  ./configure \
    --prefix=/usr \
    PYTHON="python2" \
    --libexecdir=/usr/lib \
    --mandir=/usr/share/man \
    --with-libpcap=included \
    --with-openssl=/usr \

  cd "ncat/"
  cd "../"

package() {
  cd "${srcdir}/nmap-${pkgver}"
  make DESTDIR="${pkgdir}" install
  python2 -m compileall "${pkgdir}/usr/lib/python2.7/site-packages/zenmapCore"

  # remove zenmap uninstall script
  rm "${pkgdir}/usr/bin/uninstall_zenmap"

  # install custom GPL2 license
  install -Dm644 'COPYING' "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

# vim:set et sw=2 sts=2 tw=80:

Then add to /etc/pacman.conf:

IgnorePkg = nmap

Deryk (talk) 09:19, 14 January 2016 (UTC)

This nmap version 5.51 is not mandatory for any of the standard scans provided by OpenVAS. Those version would be required if you want to run any of the NSE wrapper for nmap (found within the nmap_nse/ folder) Wzgp8irex (talk)