LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-03-2016, 11:50 PM   #1
charly78
Member
 
Registered: Aug 2012
Location: Toronto,Canada
Posts: 73

Rep: Reputation: Disabled
allow only certain iptable string User-Agent


I have a Asterisk phone server and I get attacked every so often and I have all sorts of things that stop the attacks but recently am looking for a way to do with with User-Agent string and have all my external phones use a manipulated User agent and only allow user agents that are well what I allow..

I have no idea how to do this..

how do I drop all user agents

i know I could easily do
iptables -A INPUT -p udp --dport 5060 -m string --algo bm --string "User-Agent: cUStoM123TT" -j ACCEPT

but how do I start by dropping all unknown * User-Agent

how do I properly write this . Does anyone see any issues i would have with this?. would this work?

Last edited by charly78; 02-03-2016 at 11:51 PM.
 
Old 02-04-2016, 01:12 AM   #2
paul2015
Member
 
Registered: Apr 2015
Distribution: CentOS Fedora
Posts: 149

Rep: Reputation: 4
sorry I dont understan well what you have wrote but what if you set default policy to drop everything and allow what you want.
 
Old 02-04-2016, 08:52 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by charly78 View Post
I have a Asterisk phone server and I get attacked every so often and I have all sorts of things that stop the attacks but recently am looking for a way to do with with User-Agent string and have all my external phones use a manipulated User agent and only allow user agents that are well what I allow..

I have no idea how to do this..

how do I drop all user agents

i know I could easily do
iptables -A INPUT -p udp --dport 5060 -m string --algo bm --string "User-Agent: cUStoM123TT" -j ACCEPT

but how do I start by dropping all unknown * User-Agent
Simplistic solution: Immediately after that rule add one that reads
Code:
iptables -A INPUT -p udp --dport 5060 -j REJECT
 
1 members found this post helpful.
  


Reply

Tags
asterisk, iptables



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
[SOLVED] Anyone know what the user agent string for Debian in Chromium is? barnac1e Debian 4 06-16-2012 08:24 AM
User Agent string EliasAlucard Linux - General 3 05-15-2012 03:22 AM
[SOLVED] spoofing the user agent string through squid nass Slackware 4 11-07-2011 08:23 AM
scripts should use an informative user-agent string with contact information linuxbird Linux - Newbie 1 06-20-2010 04:01 PM
LXer: Microsoft Buries $10,000 For People With IE8's User-Agent String LXer Syndicated Linux News 0 06-18-2009 12:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:33 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