| View previous topic :: View next topic |
| Author |
Message |
stereotype
Joined: 06 Nov 2006 Posts: 36
|
Posted: Tue Sep 23, 2008 4:14 pm Post subject: Any easy way to block selected user-agent strings? |
|
|
Hi
Does anyone know of an easy way to block selected user-agent strings?
I know it can be done fairly easy on Apache via the .htaccess file...
Does Icecast have any such capability?
Cheers
Max |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Tue Sep 23, 2008 8:22 pm Post subject: |
|
|
You cannot rely on blocking on useragent strings as the apps that you tend to want to block often allow the useragent strings to be faked.
karl. |
|
| Back to top |
|
 |
stereotype
Joined: 06 Nov 2006 Posts: 36
|
Posted: Wed Sep 24, 2008 1:49 pm Post subject: |
|
|
Hi Karl
Yeah I understand that, but I have a very specific need.
Since I don't wanna bore you with too many details, I'll just say that our stream is tied to our hardware, and I want to restrict usage to the hardware's user agent string...
The easiest way I have found is to do a proxypass via apache, and let apache filter the strings before forwarding the connection on to icecast.
I haven't had the time to try that yet though...
Any easier way to acomplish this from within icecast?
Whitelisting would be the best option, but blacklisting would of course be fine too...
Last edited by stereotype on Thu May 26, 2011 4:59 pm; edited 1 time in total |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Sep 24, 2008 2:56 pm Post subject: |
|
|
there is a user agent filter tryout in kh (works in a similar way to IP allow/deny) but the only general way is to use url auth and deny/allow listeners based on the user agent field that is passed on the listener_add.
karl. |
|
| Back to top |
|
 |
stereotype
Joined: 06 Nov 2006 Posts: 36
|
Posted: Wed Sep 24, 2008 4:12 pm Post subject: |
|
|
Can you point me to more info on the user-agent stuff on kh?
Is kh ok for production use?
Thanks again Karl... |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Sep 24, 2008 6:05 pm Post subject: |
|
|
Just look at the sample xml files for the <deny-agents> tag. It works like the IP files in 2.3.2 except that it can also take wildcard matches. Yes it is ok for production use.
karl. |
|
| Back to top |
|
 |
stereotype
Joined: 06 Nov 2006 Posts: 36
|
Posted: Wed Sep 24, 2008 7:09 pm Post subject: |
|
|
thanks karl
that looks very good
just a few final questions:
1. any way of blocking empty agent strings?
2. are the strings case sensitive?
3. with regards to the format of the file, do i just list the bare strings one per-line? (should I use quotes, double quotes or perhaps any other special characters?)
4. can i use more than 1 wildcard? (i.e. would *amp* block "winamp")
thanks again...
max |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Sep 24, 2008 8:18 pm Post subject: |
|
|
1. Is that even valid, useragent:\r\n, blank lines and lines beginning with # are ignored from those files.
2. yes
3. it's one possible match per line, special chars are * ? and []
4. yes.
karl. |
|
| Back to top |
|
 |
stereotype
Joined: 06 Nov 2006 Posts: 36
|
Posted: Thu Sep 25, 2008 4:42 am Post subject: |
|
|
| thanks a lot karl |
|
| Back to top |
|
 |
stereotype
Joined: 06 Nov 2006 Posts: 36
|
Posted: Sun Oct 12, 2008 1:03 pm Post subject: |
|
|
Karl
I've given kh a try and had all sorts of trouble.
I've also had troubles when moving from 2.3.1 to 2.3.2 and this seems quite similar. Like for example, the xml config file that was fine with 2.3.1 wouldnt work with 2.3.2, with no clues to what was wrong.
Anyway, with kh, the web admin pages don't display properly and some odd things seem to happen... Tried both kh1 and kh2 with not much luck...
Tried both the 2.3.2-release and kh xsl files with no luck...
After a few hours of random madness I gave up...
You said kh was OK for production use, so am I missing something?
Does it require any library updates or something else? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Oct 12, 2008 1:30 pm Post subject: |
|
|
If you have issues then let us know, it's the only way to resolve them. As you haven't said what you have configured I can't say what is wrong or possibly a bug. Let me know the specifics of what you are using along with the xml and log file contents.
karl. |
|
| Back to top |
|
 |
MATPOC
Joined: 02 May 2007 Posts: 4 Location: Russia
|
Posted: Mon Dec 14, 2009 7:52 pm Post subject: |
|
|
| Some days ago I found strange requests in the log of my icecast server - many requests of /<mountpoint>/index.html. All of them contains "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)" user-agent string. A quick search said that this is the Internet Explorer for Windows 2000 - strange thing for our days. Deep search said that this user-agent means viruses of trojaned hosts. So your new feature is very useful to block junk traffic. |
|
| Back to top |
|
 |
|