How to protect your Asterisk or other IP PBX from hacking into it, abusing it and spending your credit?
Now XeloQ is growing rapidly, our support team get phone calls and emails regularly from customers on HOW to protect their IP PBX?
This is an important issue and besides normal ICT protection (to protect against Trojans, Spyware, viruses and hacking into mail /webservers) this should be a constant item for each ICT manager to be aware of. It all starts with awareness.
Besides our own security guidelines and blogs we collected some very good information to help you here. If you act on this in the described ways you and your IP PBX are pretty safe.
Ready? Let’s go.
1. Before you start out with VoIP at all, you would like to be informed if the company you do business with isn’t a fraud itself. Check all out here in our own blog:
2. Check our OWN safety guidelines . Read, understand and act on it.
3. Whether you run Asterisk, Trixbox, Elastix, 3CX, Avaya, Cisco, Lync, MyPBX or any other IP PBX, make sure all latest patches are installed. Check this at the supplier websites.
4. NEVER, we repeat NEVER use the default passwords on any system for Administrator access. Restrict REMOTE access to the systems from only 1 IP address
5. If you CAN, always install your IP PBX on a NAT LAN (local area network with NAT / private IP addresses) – this makes it hard to get into the IP PBX from the outside world
Read here to do this with Asterisk: http://forums.asterisk.org/viewtopic.php?t=74786 (also LOTS of other good tips)
Summary from that page:
‘Put the Asterisk box behind a NAT router, the system will not be contactable from the outside, but can initiate and maintain registered connections with SIP providers on the outside. That is the simplest way to make your asterisk box secure "enough" whilst still being able to make and recieve calls over the net. It wont work with external handsets, you may need to look at a low latency / SIP/RTP friendly VPN such as Open VPN to give you that functionality’.
6. Don’t use the same username and password on your extensions. Also make sure the internal extensions have difficult to ‘guess’ passwords.
7. Keep the inbound call routing in a different context to your outbound routing. That way, anyone who gets in, can’t get back out again. Common problem and biggest cause / source of toll fraud.
8. Restrict the IP addresses your extensions can register on to the local subnet using permit/deny in your sip.conf
9. Disable channels that you aren’t using (such as skinny and MGCP) and comment out ay default settings in the conf files
10. Set “alwaysauthreject=yes” in your sip configuration file. What this does is prevent Asterisk from telling a sip scanner which are valid extension numbers.
11. If you do not have ‘external’ extensions, you can DISABLE access on port 5060 / 6060 for INCOMING traffic.
12. Use restrictive dial plans (disallow calling to 0900 + Premium numbers) and non-numeric logins for your extensions.
13. If you wonder what happened and / if hackers got in or not, read all in the Asterisk LOG file: /var/log/asterisk/messages
14. Read the comments from Chris on http://forums.asterisk.org/viewtopic.php?t=74786 (somewhere in the middle); many of the above info came from him (thanks Chris) and he describes all the .conf files to adjust to make it very secure.
15. Install a SIP port firewall. This will not allow "fast scanning" of port 5060 and will blacklist the endpoint for 1 hour if something like this is happening.
More info: http://www.voip-info.org/wiki/view/Asterisk+firewall+rules
Now…..you do NOT want to see this anymore do you? Read on!!
TESTING – TESTING 1 -2 – NOW YOU’RE GONNA TEST !
Now all that has been done you want (and need) to test if all is secure. If you think there is no tool available to test and hack into any Asterisk based server, think again. It exists. Dozens of these tools are around but one good one is SIPVICIOUS. It is a SIP SCANNER and checks HOW TO BREAK into your Asterisk box.
If you followed all steps above….and in the article below nobody would ever be able to get in anymore
It doesn’t matter we tell it here because every hacker already knows this tool. So now we are going to USE THAT TOOL to see if you are secure. And that is what we want to know isn’t it?
Check it all on http://sysadminman.net/blog/2009/hacking-and-securing-your-asterisk-server-592 à installation steps and some more things to take care of are all included on that page.
When all is fine, it would be nice to get the following sticker on your Asterisk server wouldn’t it?
Good luck! And if you have any feedback, just post it here. We and all our worldwide IP PBX users would appreciate!
XeloQ IQ-Telephony Support Team