Koozali.org: home of the SME Server

IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« on: April 17, 2009, 09:53:25 PM »
Hello all,

Just to let you know, we have seen two attempted SIP hack attacks over the last month.  The attacker floods the asterisk server with registration requests in the hope that one will pass.  If it does then a remote phone is registered to the server and used to dial international or premium rate lines.  In one case, the attacker attempted to register extension numbers 1 thru 10000, one after the other (obviously under program control).  In each case, the hacker was using the assumption that the extension number and asterisk password were the same. 

So....  If you have remote phones attached to your server then you should consider doing some, or preferably all, of the following;

If you run SARK/SAIL...

  • For REMOTE PHONES - make sure that passwords do not match the extension number and that they are strong passwords.  SAIL will automatically generate a strong password for you when you create a new extension (versions prior to 2.2.1-631  did not do this). If you do have some cases where extension and password are the same then change the password, commit it and restart the phone.  The phone should automatically pick up its new provisioning data and restart normally with the new password.
  • Implement Class Of Service to prevent anyone dialling premium rate numbers.
  • Consider a Class Of Service restriction to limit phones to dialling only local & emergency numbers at night time (which is when the bogus phone calls usually occur)

If you run some other Asterisk GUI, or vanilla Asterisk...

  • you will probably need to manually inspect your remote phones and passwords and change them accordingly.  This will likely necessitate reprogramming/reprovisioning the phones
  • Products like FreePBX and its numerous derivatives/superlatives don't support Class Of Service or outbound number class barring so you may need to do a bit of legwork to find a solution which prevents dials to high rate number classes.

You aren't going to stop these attacks but you can make life very difficult for an aggressor by taking just a few minor precautions.  You shouldn't need to worry about locally attached phones because a remote attacker probabaly won't be able to handle the natting necessary to log in as a local over your firewall.



Best

S


« Last Edit: April 18, 2009, 12:35:02 PM by selintra »

Offline David Harper

  • *
  • 653
  • +0/-0
  • Watch this space
    • Workgroup Technology Solutions
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #1 on: April 18, 2009, 09:36:35 AM »
Thanks for the heads up. Am I correct in saying that this only affects customers with remote extensions configured? What about SAIL to SAIL trunks?

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #2 on: April 18, 2009, 10:07:03 AM »
Hi David

Yes - remote connections are the main problem.  A SAIL-SAIL trunk could be compromised but it's a lot less likely because they don't use extension numbers.  However, no harm in ceating a strong password if you use these trunks.   

Best

S

Offline madadam

  • *
  • 149
  • +0/-0
    • http://www.extremetourist.com
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #3 on: April 19, 2009, 03:35:00 AM »
Hi guys,

Thanks for the heads up. I have one small suggestion (feature request) and one question.

Firstly the suggestion. Can you place the "Phone location" on the summary table on then Extensions page? I have a lot of phones and it would help to see at a glance which are "local" and which are "remote".

Secondly I always specify the Mac Address of any remote phones. When a remote phone authenticates does the mac address need to match?

Cheers,

Adam
...

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #4 on: April 19, 2009, 11:16:33 AM »
I think we can put that in for you...  Sarkinternal is "on the bench" now as it happens (recording stuff) so I'll see if they can squeeze it in.  On reflection, provided you have dynamic proxying turned on, you can tell anyway because the "UP" icon is different for locals and remotes.

Just as an aside - do you all understand dynamic proxying and what it does?  It's probably one of the most powerful features in SAIL, particulary if you have a lot of phones to look after.

Mac address does not need to match but if you specify one then SAIL will place a provisioning file for the phone (if it is a supported model) into the main Ibay so that the phone can remote provision itself if required.

Best

S



« Last Edit: April 19, 2009, 11:22:08 AM by selintra »

Offline madadam

  • *
  • 149
  • +0/-0
    • http://www.extremetourist.com
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #5 on: April 19, 2009, 11:59:39 AM »
Ahhh, gosh!

I shouldn't admit it here publicly but I had assumed that providing a MAC address in SAIL was like setting up a network with reserved IP on the DHCP server or as a way to authenticate a request to join the network.

Thanks for the heads up.

Adam
...

Offline iam

  • *
  • 25
  • +0/-0
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #6 on: May 08, 2009, 11:45:46 AM »
For those who have zap/dahdi PSTN lines...

I can make outgoing calls from my notebook with xlite and PUBLIC internet address through my pbx with dahdi pstn connection regardless of if extension configured as remote or local.

So in that case just to set nat to no or yes with local/remote option isn't enough ...
Change passwords for strong for all the extensions if you open registrations to internet....

Sincerely

Offline matsk

  • *
  • 3
  • +0/-0
    • Tinnio
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #7 on: May 13, 2009, 07:56:14 AM »
Is it possible to implement a trap for "many failed registrations" that could warn the admin?

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #8 on: May 13, 2009, 12:13:11 PM »
Yes you could run a cron job to grep the asterisk messages log and set a threshold based upon how many hits you get.

S

Offline matsk

  • *
  • 3
  • +0/-0
    • Tinnio
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #9 on: May 13, 2009, 01:32:48 PM »
Hmm, I think that a deriviate function is better than a static value. A deriviate can see a sudden increase of attempt's whitch a static value will miss.

The weekend is saved, writing script and polish and paint the sailboat ;-)

/M

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: IMPORTANT! - ALL Asterisk USERS - READ THIS NOW!!
« Reply #10 on: May 13, 2009, 01:36:00 PM »
Code: [Select]
I think that a deriviate function is better than a static value.
Much better, but more work.

Let us know how you get on or if you need anything.

:)

Best

S