All pastes #519255 Raw Edit

Unnamed

public text v1 · immutable
#519255 ·published 2007-05-29 16:25 UTC
rendered paste body
#!/bin/sh
PATH=/usr/eth0cal/sbin:/usr/eth0cal/bin:/sbin:/bin:/usr/sbin:/usr/bin:/sbin/iptables
ssh="ssh"
netstat -laputen |cut -d/ -f2|while read Prog
do
#on saute les 2 premiere ligne
step=$(($step+1))
echo $step
if [ $step -gt 2 ] ;then
	if [ "$ssh" = "$Prog" ] ;then
		echo "le programe $Prog est autoriser"
	else
		echo "DROP sur le port: ?"
	fi
fi
#pour obtenire le port on fait
#netstat -laputen |cut -d: -f2 | cut -b1-6
# mai comment etre sur que $Prog correspond aux port car si un nouveau programe ce lance
#entre temps sa ne corespondra pas!
sleep 1
done