LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-03-2009, 08:34 AM   #1
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Block Gtalk messenger using squid or iptables on RHEL5


Hello all,

Sometime ago my CentOS squid server crashed due to old hardware. So wanted to put a new one. Did not have CentOS, so put RHEL5 with squid working well in transparent mode.

Now I want to block Gtalk messenger application. I had done this earlier by blocking 5222 port in iptables, but it was pidgin then.
This rule does not work for Gtalk messenger.

I tried blocking several ports but none of them is working. Finally I blocked all the ports after 1024 in disgust but as expected internet also stopped as 3128 was closed. I have blocked a lot of sites and URLs related to gtalk that I could without hampering the internet and work.

Now is there any way of blocking gtalk application from squid? Or any tool available for linux that will do that?

Is there any way squid will know how gtalk authenticates? Or is there any way squid will know if packets are coming from certain application? I seem to read on net that browsing using IE can be blocked. So it is possible to detect which browser is running. Can similar thing be done using squid or some external tool?
 
Old 08-04-2009, 01:57 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
I have found that safesquid and for that matter even MS ISA server have the ability to block the access with User-Agent. But squid does not seem to have this functionality.
Right now I am running Squid Version 2.6.STABLE6.
Will check with the newer version if there are some other functionalities added.
I tried to use external_acl for User-Agent but it seems squid is unable to see it for google talk though I can see it in log files.
Is there any other method for blocking squid other than through user-agent?
 
Old 08-05-2009, 05:05 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Now i kept trying without success.
I tried http_reply_access without any success.
Then req_header . Log file shows request to be denied but I can still login with gtalk messenger.

This is what is the requested header that I can see in log file.
Code:
Connection:%20Keep-Alive%0d%0aContent-Length:%200%0d%0aHost:%20filetransferenabled.mail.google.com%0d%0aUser-Agent:%20Google%20Talk%0d%0a
And this is the acl in squid file. I am doubting my regular expression for comparing the User Agent. Can anyone help with the regular expression so that it matches google talk anywhere in the user agent field even with some trailing or succeeding characters?

Code:
acl gtalk_ban req_header User-Agent -i .Google .Google\ Talk .%20Google%20Talk%0d%0a
Sorry I am bad with regex.
 
Old 08-07-2009, 12:41 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Well the same acl works with User-Agent option for MSIE. So there is something else. May be squid is not able to recognize what user agent is being used or else that field is encrypted or something.
What am I missing?
 
Old 08-07-2009, 07:35 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Now that. All the rules and ACLs that I create are applied to browsing that is happening through web browser. But none of the rules are applied if using some other mode like gtalk messaging client, thunderbird or any other app.
Does this make any sense for you guys or am I shooting in the dark with eyes wide shut?
 
Old 08-10-2009, 05:16 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
I tried to capture the packets with wireshark and analyze them. Google talk uses a lot strategies it seems to connect.
If I block the port 5222 it will connect to port 80. If I block the tcp connections it will use http connections.
If I block talkx.l.google.com or other domains for talk.google it will connect to google.com.
Now how do I block this gtalk ? This is really becoming pain in ***.
Also squid does not know about the user agent used. So this option is also invalid now.
Any ideas?????
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to block gmail & gtalk (https traffic)using squid satishmali1983 Linux - Server 4 06-25-2009 01:22 AM
block gtalk in Squid sandeepthug Linux - Software 2 04-01-2009 07:07 AM
How to block gtalk messenger through squid sakthi.s Linux - Server 4 04-18-2007 02:51 AM
Howto Block Msn Messenger in Squid johnlee Linux - Security 2 10-30-2001 03:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration