Thursday, August 11, 2011

Iptables block facebook

There are many “solutions” for blocking your company employees accessing Yahoo Messenger, hi5, Facebook or any other distracting services, but none of them is working properly.



So here is a perfect solution:


What you need:


- linux router for your network
- iptables firewall at least v1.3.7


Here are the rules:
Deny Yahoo Messenger packets:


iptables -I FORWARD -m string --string 'YMSG' --algo bm -j DROP
iptables -I FORWARD -m string --string 'messenger' --algo bm -j DROP
iptables -I FORWARD -m string --string 'meebo' --algo bm -j DROP
iptables -I FORWARD -m string --string 'buddy' --algo bm -j DROP
iptables -I FORWARD -m string --string 'webmessenger' --algo bm -j DROP
iptables -I FORWARD -m string --string 'web-messenger' --algo bm -j DROP


Deny facebook traffic rule:


iptables -I FORWARD -m string --string 'facebook' --algo bm -j DROP


Deny hi5 traffic rule:


iptables -I FORWARD -m string --string 'hi5' --algo bm -j DROP

and so on… you can modify these rules to fit your needs, you just need to edit the –string parameter


--string ''


Using this solution to filter specified traffic you don’t have to worry about port, protocol, application , source or destination.


Hope it helps someone.

Block Internet Messenger With Iptables

normally we will use port filtering with iptables to block the internal user from accessing unwanted application or website but here the tips for you to do it :


If you’re a network administrator and you’re using Linux on your servers, you can stop the rest of the users from using IM applications by blocking their access to the most-used IM protocols:




ICQ and AOL:


# iptables -A FORWARD –dport 5190 -j DROP
# iptables -A FORWARD -d login.oscar.aol.com -j DROP


MSN:


# iptables -A FORWARD -p TCP –dport 1863 -j DROP
# iptables -A FORWARD -d 64.4.13.0/24 -j DROP


Yahoo Messenger:


# iptables -A FORWARD -p TCP –dport 5000:5010 -j REJECT
# iptables -A FORWARD -d cs.yahoo.com -j REJECT
# iptables -A FORWARD -b scsa.yahoo.com -j REJECT

 Simple Python Calculator This script will allows your to calculate the integers given with the chosen operation. You can add, substract, mu...