Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2020-12-15 16:30:09 +0300
committerGitHub <noreply@github.com>2020-12-15 16:30:09 +0300
commit701be9852bae4f64adf7b94f874956ffe1fffb54 (patch)
treef35ac76d4bf705634b6dbaf144d1c22e6ed4de6b /include/tests_networking
parent258b2bf05f155ebf779ddcba3dafbde73c348712 (diff)
parent1a75d66ad990260e2ba46da68c6ad373bed6b822 (diff)
Merge pull request #1060 from Varbin/solaris-netstat
[NETW-3012] Use netstat on Solaris to gather listening ports
Diffstat (limited to 'include/tests_networking')
-rw-r--r--include/tests_networking9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/tests_networking b/include/tests_networking
index 9bf5a082..867429ec 100644
--- a/include/tests_networking
+++ b/include/tests_networking
@@ -512,6 +512,15 @@
ReportException "${TEST_NO}:3" "netstat missing to gather listening ports"
fi
;;
+ Solaris)
+ if [ -n "${NETSTATBINARY}" ]; then
+ LogText "Test: Retrieving netstat information to find listening ports"
+ FIND=$(${NETSTATBINARY} -an -P udp | ${AWKBINARY} '{ if($7=="LISTEN") { print $1"|udp|LISTEN|" }}')
+ FIND2=$(${NETSTATBINARY} -an -P tcp | ${AWKBINARY} '{ if($7=="LISTEN") { print $1"|tcp|LISTEN|" }}')
+ else
+ ReportException "${TEST_NO}:4" "netstat missing to gather listening ports"
+ fi
+ ;;
*)
# Got this exception? Provide your details and output of netstat or any other tool to determine this information.
ReportException "${TEST_NO}:2" "Unclear what method to use, to determine listening port information"