sid-owner.txt

sid-owner.txt - v i а SеrgеniuS, 05/01/2011 06:17 am

Download (1003 Bytes)

 
1
#!/bin/bash
2
#
3
# sid-owner.txt - Example rule on how the sid-owner match could be used.
4
#
5
# Copyright (C) 2001  Oskar Andreasson <bluefluxATkoffeinDOTnet>
6
#
7
# This program is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; version 2 of the License.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program or from the site that you downloaded it
18
# from; if not, write to the Free Software Foundation, Inc., 59 Temple
19
# Place, Suite 330, Boston, MA  02111-1307   USA
20
#
21
22
SID=`ps -eo sid,args |grep httpd |head -n 1 |cut -b 1-5`
23
24
/usr/local/sbin/iptables -A OUTPUT -p TCP -m owner --sid-owner $SID -j ACCEPT
25
26
Thank you!