LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Why this script wont block bittorrent, kazaa and other p2p apps (https://www.linuxquestions.org/questions/linux-security-4/why-this-script-wont-block-bittorrent-kazaa-and-other-p2p-apps-592564/)

crackyblue 10-17-2007 02:07 AM

Why this script wont block bittorrent, kazaa and other p2p apps
 
IPT=/us/bin/iptables
STRING_="/etc/rc.d/strings"
IP_ALLOW="/etc/rc.d/ip"
if [ -e $STRING_ ]; then
while read STRING_TRAP; do
$IPT -I INPUT -p tcp -m string --string $STRING_TRAP --algo kmp \
-d 0/0 --dport 80 -j LOG --log-level info \
--log-prefix "P2P Apps Connection Attempts"
$IPT -I INPUT -p tcp -m string --string $STRING_TRAP --algo kmp \
-d 0/0 --dport 80 -j REJECT

if [ -e $IP_ALLOW ]; then
while read IP_TRAP; do
$IPT -A INPUT -s $IP_TRAP -p tcp -m tcp -d 0/0 \
--dport 80 -m string --string $STRING_TRAP \
--algo 'kmp' -j LOG --log-level info \
--log-prefix "Allowed IP to Use P2P Apps"
$IPT -A INPUT -s $IP_TRAP -p tcp -m tcp -d 0/0 \
--dport 80 -m string --string $STRING_TRAP \
--algo 'kmp' -j ACCEPT
done < $IP_ALLOW
fi

done < $STRING_

else
echo "No file containing string found..."
fi

win32sux 10-17-2007 02:55 PM

crackyblue, I've moved your post (which you originally made here) into a thread of its own.

In the future, please refrain from hijacking other people's threads.


All times are GMT -5. The time now is 11:04 PM.