diff options
author | mboelen <michael@cisofy.com> | 2014-09-08 17:13:51 +0400 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2014-09-08 17:13:51 +0400 |
commit | 29442cdfcfa44dbfab097114e3d804a7f7623fef (patch) | |
tree | e32ad8fc48116de0ce07026b5659d234ea2be599 | |
parent | ac54b4fe8369c699c5afb9c7893f5be9cb67edd6 (diff) |
Changes to allow non-privileged scans
-rwxr-xr-x | lynis | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -272,6 +272,25 @@ echo " ${PROGRAM_extrainfo}" echo "################################################################################" fi + + if [ ${PENTESTINGMODE} -eq 1 ]; then + echo "${PURPLE}" + echo " #########################################################" + echo " # NON-PRIVILEGED mode (e.g. pentesting) #" + echo " #########################################################" + echo "" + echo " Some tests will require root permissions" + echo " Logging is disabled (no log and no report)" + echo "" + echo " Press [ENTER] to continue or [CTRL] + C to break" + echo "" + echo " #########################################################" + echo "${NORMAL}"; echo "" + if [ ${NEVERBREAK} -eq 0 ]; then read void; fi + fi + + + # ################################################################################# # @@ -320,7 +339,13 @@ fi # Create new PID file (use work directory if /var/run is not available) - if [ -d /var/run ]; then PIDFILE="/var/run/lynis.pid"; else PIDFILE="lynis.pid"; fi + if [ ${PENTESTINGMODE} -eq 1 ]; then + PIDFILE="lynis.pid" + elif [ -d /var/run ]; then + PIDFILE="/var/run/lynis.pid" + else + PIDFILE="lynis.pid" + fi OURPID=`echo $$` echo ${OURPID} > ${PIDFILE} chmod 600 ${PIDFILE} |