summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>2024-01-20 00:50:15 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2024-01-20 01:05:57 +0700
commitcacefe368b87a9e9acb06ba4485924d46e729fb1 (patch)
treee3db3204540b2b74e8a7eaa02826fe8f6f96af55
parent081b1c8c4056059799af286c6f348ce2fe925c09 (diff)
downloadslackbuilds-cacefe368b87a9e9acb06ba4485924d46e729fb1.tar.gz
slackbuilds-cacefe368b87a9e9acb06ba4485924d46e729fb1.tar.xz
network/nessus: Added (vulnerability scanner).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--network/nessus/README7
-rw-r--r--network/nessus/doinst.sh43
-rw-r--r--network/nessus/nessus.SlackBuild89
-rw-r--r--network/nessus/nessus.info10
-rw-r--r--network/nessus/rc.nessusd112
-rw-r--r--network/nessus/slack-desc19
6 files changed, 280 insertions, 0 deletions
diff --git a/network/nessus/README b/network/nessus/README
new file mode 100644
index 0000000000..3758625cd1
--- /dev/null
+++ b/network/nessus/README
@@ -0,0 +1,7 @@
+Nessus Vulnerability Scanner
+
+Nessus Professional, the industry's most widely deployed vulnerability
+assessment solution helps you reduce your organization’s attack surface and
+ensure compliance. Nessus features high-speed asset discovery, configuration
+auditing, target profiling, malware detection, sensitive data discovery,
+and more.
diff --git a/network/nessus/doinst.sh b/network/nessus/doinst.sh
new file mode 100644
index 0000000000..d27a6df2c1
--- /dev/null
+++ b/network/nessus/doinst.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+if [ -e /etc/rc.d/rc.nessusd ]; then
+ chroot . sh /etc/rc.d/rc.nessusd status > /dev/null 2>&1
+ RETVAL=$?
+ if [ "$RETVAL" == "0" ]; then
+ chroot . sh /etc/rc.d/rc.nessusd stop > /dev/null 2>&1
+ fi
+fi
+
+preserve_perms etc/rc.d/rc.nessusd.new
+
+echo ""
+echo "Unpacking Nessus Core Components..."
+chroot . /opt/nessus/sbin/nessuscli install /opt/nessus/var/nessus/plugins-core.tar.gz
+
+echo " - You can start Nessus by typing sh /etc/rc.d/rc.nessusd start"
+echo " - Then go to https://"`hostname`":8834/ to configure your scanner"
+echo ""
diff --git a/network/nessus/nessus.SlackBuild b/network/nessus/nessus.SlackBuild
new file mode 100644
index 0000000000..55cd63900a
--- /dev/null
+++ b/network/nessus/nessus.SlackBuild
@@ -0,0 +1,89 @@
+#!/bin/bash
+
+# Slackware build script for Tenable(TM) Nessus Vulnerability Scanner
+
+# Copyright 2019-2024 Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
+PRGNAM=nessus
+VERSION=${VERSION:-10.6.4}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+if [ "$ARCH" != "x86_64" ]; then
+ echo "Unsupported platform"
+ exit 1
+fi
+
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf $PRGNAM-$VERSION
+cd $PKG
+
+rpm2cpio $CWD/Nessus-$VERSION-*.rpm | cpio --extract --make-directories --verbose
+
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+mkdir -p $PKG/etc/rc.d
+
+# Remove SystemD and Firewalld rules
+rm -rf $PKG/usr/lib
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cat $CWD/rc.nessusd > $PKG/etc/rc.d/rc.nessusd.new
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/network/nessus/nessus.info b/network/nessus/nessus.info
new file mode 100644
index 0000000000..3bc7b6f2cc
--- /dev/null
+++ b/network/nessus/nessus.info
@@ -0,0 +1,10 @@
+PRGNAM="nessus"
+VERSION="10.6.4"
+HOMEPAGE="https://www.tenable.com/products/nessus"
+DOWNLOAD="UNSUPPORTED"
+MD5SUM=""
+DOWNLOAD_x86_64="https://www.tenable.com/downloads/api/v2/pages/nessus/files/Nessus-10.6.4-es7.x86_64.rpm"
+MD5SUM_x86_64="2a3552d4568be658846119ebb270f229"
+REQUIRES=""
+MAINTAINER="Giuseppe Di Terlizzi"
+EMAIL="giuseppe.diterlizzi@gmail.com"
diff --git a/network/nessus/rc.nessusd b/network/nessus/rc.nessusd
new file mode 100644
index 0000000000..3a80ca3c4c
--- /dev/null
+++ b/network/nessus/rc.nessusd
@@ -0,0 +1,112 @@
+#!/bin/sh
+
+# Tenable(TM) Nessus Scanner Start & Stop script
+#
+
+# Source function library.
+if [ -f /etc/init.d/functions ] ; then
+ . /etc/init.d/functions
+else
+ exit 0
+fi
+
+# Load nessusd environment
+[ -f /etc/sysconfig/nessusd ] && . /etc/sysconfig/nessusd
+
+# Avoid using root's TMPDIR
+unset TMPDIR
+
+test -x /opt/nessus/sbin/nessus-service || {
+ echo "Nessus not properly installed"
+ exit 1
+}
+
+RETVAL=0
+
+NESSUS_PID_FILE="/opt/nessus/var/nessus/nessus-service.pid"
+NESSUS_NAME="Nessus"
+
+start() {
+
+ echo -n $"Starting Nessus services: "
+
+ /opt/nessus/sbin/nessus-service -q -D
+ RETVAL=$?
+
+ if [ "$RETVAL" == "0" ]; then
+ success
+ else
+ failure
+ fi
+
+ echo
+ return 0
+
+}
+
+stop() {
+
+ echo -n $"Shutting down Nessus services: "
+
+ test -f "$NESSUS_PID_FILE" && kill `cat /opt/nessus/var/nessus/nessus-service.pid`
+ RETVAL=$?
+
+ sleep 4
+
+ if [ "$RETVAL" == "0" ]; then
+ success
+ else
+ failure
+ fi
+
+ echo
+ return 0
+
+}
+
+restart() {
+ stop
+ start
+}
+
+status() {
+
+ if [ -f "$NESSUS_PID_FILE" ]; then
+
+ exp_pid=$(cat $NESSUS_PID_FILE)
+ pid_dir="/proc/$exp_pid"
+
+ if [ -d "$pid_dir" ]; then
+ if [ "$(cat ${pid_dir}/stat | awk '{print $2}' | tr -d '()')" == "nessus-service" ]; then
+ echo "$NESSUS_NAME is running"
+ return 0
+ fi
+ fi
+
+ fi
+
+ echo "$NESSUS_NAME is not running"
+ return 3
+
+}
+
+
+case "$1" in
+ start)
+ start
+ ;;
+ status)
+ status
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $?
diff --git a/network/nessus/slack-desc b/network/nessus/slack-desc
new file mode 100644
index 0000000000..f89856a44a
--- /dev/null
+++ b/network/nessus/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+nessus: nessus (Nessus Vulnerability Scanner)
+nessus:
+nessus: Nessus Professional, the industry's most widely deployed
+nessus: vulnerability assessment solution helps you reduce your
+nessus: organization's attack surface and ensure compliance. Nessus features
+nessus: high-speed asset discovery, configuration auditing, target profiling,
+nessus: malware detection, sensitive data discovery, and more.
+nessus:
+nessus:
+nessus: Homepage: https://www.tenable.com/products/nessus
+nessus: