diff options
Diffstat (limited to 'security/ossec-hids-local-config/files/command-open-ports.sh.in')
-rw-r--r-- | security/ossec-hids-local-config/files/command-open-ports.sh.in | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/security/ossec-hids-local-config/files/command-open-ports.sh.in b/security/ossec-hids-local-config/files/command-open-ports.sh.in new file mode 100644 index 0000000..d5ba047 --- /dev/null +++ b/security/ossec-hids-local-config/files/command-open-ports.sh.in @@ -0,0 +1,19 @@ +#!/bin/sh + +# This script is part of FreeBSD port - report any issues to the port MAINTAINER + +family=$1 +protocol=$2 +ports=$3 + +if [ -z "${ports}" ]; then + privileged_ports="1-$((`sysctl -n net.inet.ip.portrange.first` - 1))" + + ossec_home="%%OSSEC_HOME%%" + . "${ossec_home}/etc/command.conf" + + ports="privileged_${protocol}_ports" + eval ports=\$${ports} +fi + +sockstat -l -${family} -P ${protocol} -p ${ports} | grep -Eo '[^[:space:]]+:[0-9]+' | sort -u |