#! /bin/sh
# adaptible for upd also
export TCPPRTS=`netstat -na -t | grep "^tcp" | sed "s/^[^:]*:\(.\).*/\1/g"
| sort -nu`
echo "Active tcp ports:" $TCPPRTS
for PRT in ${TCPPRTS} ; do
echo port number $PRT : `grep "[^0123456789]${PRT}\/tcp" /etc/services`
export TPID=`fuser ${PRT}/tcp | c
#! /bin/sh
# adaptible for upd also
export TCPPRTS=`netstat -na -t | grep "^tcp" | sed "s/^[^:]*:\(.\).*/\1/g"
| sort -nu`
echo "Active tcp ports:" $TCPPRTS
for PRT in ${TCPPRTS} ; do
echo port number $PRT : `grep "[^0123456789]${PRT}\/tcp" /etc/services`
export TPID=`fuser ${PRT}/tcp |
This is my first-attempt, a learning experience...
limitations are currently:
* stateless: it doesn't conditionally enable ports when an outgoing
session starts up, and disable them when session stops.
ftp, irc require rather permissive filters otherwise..
* UDP ports: this version
This is my first-attempt, a learning experience...
limitations are currently:
* stateless: it doesn't conditionally enable ports when an outgoing
session starts up, and disable them when session stops.
ftp, irc require rather permissive filters otherwise..
* UDP ports: this version
4 matches
Mail list logo