Add open port detection

This commit is contained in:
Dan Schaper 2016-09-26 20:39:39 -07:00
parent 874853fe18
commit 014bdf911a
1 changed files with 21 additions and 0 deletions

View File

@ -81,6 +81,15 @@ function versionCheck {
else
echo "lighttpd not installed." >> ${DEBUG_LOG}
fi
echo "::: Writing PHP version to logfile."
php_ver=$(php -v | head -n1)
if [ -n php_ver ]
then
echo "${php_ver}" >> ${DEBUG_LOG}
else
echo "PHP not installed." >> ${DEBUG_LOG}
fi
echo >> ${DEBUG_LOG}
}
@ -151,6 +160,17 @@ function hostnameCheck {
fi
}
function portCheck {
echo "############################################################" >> ${DEBUG_LOG}
echo "######## Open Port Information #########" >> ${DEBUG_LOG}
echo "############################################################" >> ${DEBUG_LOG}
echo "::: Writing local server ports to logfile"
${SUDO} netstat -tulpn >> ${DEBUG_LOG}
echo >> ${DEBUG_LOG}
}
function compareWhitelist {
if [ ! -f "$WHITELISTMATCHES" ]; then
${SUDO} touch ${WHITELISTMATCHES}
@ -269,6 +289,7 @@ versionCheck
distroCheck
ipCheck
hostnameCheck
portCheck
compareWhitelist
compareBlacklist
testNslookup