Talk:OpenVAS

From ArchWiki
Jump to: navigation, 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)

pkgname="nmap"
pkgver=5.51
pkgrel=1
pkgdesc="A network exploration tool and security/port scanner"
arch=('armv6h' 'armv7h' 'i686' 'x86_64')
url="httpss://nmap.org"
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')
options=('!makeflags')
source=("https://nmap.org/dist/nmap-5.51.tar.bz2")
provides=("nmap")
sha512sums=('SKIP')

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/Makefile.in

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

  cd "ncat/"
  make
  cd "../"
  make
}

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)