Advantage of VoIP technology

Are you taking advantage of VoIP technology yet?
VoIP Technology uses SIP Trunking. SIP Trunk is similar to a phone-line, except that a SIP Trunk utilizes the IP network, not the PSTN. SIP Trunk are versatile and cost effective solution that delivers the benefits and cost savings of VoIP. You can now retain your existing IP PBX system and leverage your existing Internet connection for both voice and data. All you need is a VoIP provider which carries quality product with competitive rate. DIDforsale provides Inbound and Outbound SIP DID’s for 2600+ rate centers. Each DID comes with unbelievable 20 channels.

Voip Service Provider
www.didforsale.com

Setup FAX on Asterisk with DIDForSale SIP DIDs

These instructions were provided by one of our customer.

1) follow the <a href=“http://www.didforsale.com/blog/?p=47”>same instructions</a> to setup a *SIP* trunk (not an IAX trunk)

2) in pbx web console, create an IAX extension. Make sure to
– enter a secret. This secret will be used later on so make sure to enter it.
– disable dictation service
– set “Record Incoming / Outgoing” to “Never”

3) Create an inbound route that forwards to the newly created IAX extension above

4) create a new virtual fax with the same extension and secret as in step 2)

5) restart asterisk and you’re done

Hope this will help you using our DIDs for FAX.

www.didforsale.com

Is your Asterisk system under heavy attack

This week one of our customer was attacked by more than 10000 Unique IPs. These hackers try to register on your system using some random username and easy to crack password. Few week back I wrote few tips on securing your asterisk servers.
http://www.didforsale.com/blog/?p=185

Even if you took all the steps to secure your asterisk, still you dont want these attackers to flood your system with dummy registration requests. Use iptables and easy to implement shell script to block these attackers. You can easily block flooding traffic to your system. Iptables, can be used to filter IP traffic, provides high level packet filtering. Use the shell script below and setup a cron and have a good night sleep. The script will automatically block the IPs flooding your Asterisk system with failed registration requests.

Monitor Asterisk’s Log for Failed Registrations

In most cases of a sip flood attack, the host tries to register on your Asterisk. All the failed attempts from these hosts are identified in the Asterisk log (/var/log/messages or /var/log/full if you are using Asterisk Based PBX  as “No matching peer found.” The following script scans /var/log/full for these patterns, strips the IP address of attacker, and block it.

Script reads the log file and use IPTABLES to block any further attempts. While reading the log file it always set a check in and check out flag. So that next time it can start from last check out position.

Copy the code and save in /usr/local/bin/check_sip_attack
chomod 755 /usr/local/bin/check_sip_attack
#########Start from Next line  ##########

#!/bin/bash
# Script Donated by www.didforsale.com
#crontab -l
# make an entry in Crontab
#01-59/2 * * * * /usr/local/bin/check_sip_attack

PATH=${PATH}:/usr/sbin
BINDIR=dirname $0; echo $BINDIR | grep ^/ > /dev/null || BINDIR=pwd/dirname $0
arch=”uname -muname -s
mach=”hostname

# echo “BINDIR= ”  ${BINDIR}
cd /var/log/asterisk
log=”full”
if [ ! -r ${log} ]; then
printf “could not read error file (${log})n”
else
start=”grep -n -e CRON: start ${log} | tail -n -1 | sed s/:/ /g | awk '{print $1}'
stop=”grep -n -e CRON: stop ${log} | tail -n -1 | sed s/:/ /g | awk '{print $1}'
if [ “$start” = “” ]; then start=0; fi
if [ “$stop” = “” ]; then stop=0; fi
if [ “$start” -le “$stop” ]; then
error=”tail -n +${stop} ${log} | grep -i Registration | grep -i Failed | tail -n +1
if [ ! ( “x$error” = “x” ) ]; then
printf “nnCRON: start — sending info — datenn” >> ${log}
ccc=printf "%s" "$error" | wc -l | awk '{print $1}'
if [ $ccc -gt 0 ]; then
printf “EXCERPT FROM ASTERISK LOG FILE ${log}:nn%snnDONE.nn” “$error”
printf “%s” “$error” > /tmp/sipappatck.tmp
for ip in cat /tmp/sipappatck.tmp | awk '{print $11}' | sort | uniq | sed s/'//g ; do
echo “iptables -I INPUT -s $ip -j DROP”
/sbin/iptables -I INPUT -s $ip -j DROP
done
fi
printf “nnCRON: stop — info sent — datenn” >> ${log}
fi
fi
fi

exit 0

# end
#########Stop here ##########

Final step is to schedule the script with cron. Add a line in cron.

01-59/2 * * * * /usr/local/bin/check_sip_attack
This will run the scrip for every two minutes (Of course you can change the timings) and have a good night sleep.

Any questions or comments are very welcome.

www.didforsale.com

Is your Asterisk Server Secure?

Do you know?
You can be responsible for  thousands of dollar of calls made out of your asterisk?
Your system can be used to spam people.
Your system can be used for fraudulent activities.
Your customers can be out of service until you realized the problem and fix it.

How?
Weak passwords on extensions.
Allow registration from unknown networks.
Weak Root passwords for your System.
Weak password for Admin accounts.

So by now you must have understand why it is so important to secure you VoIP system. Not only to save you from all the monetary losses but also to protect you from all the legal or ethical issues.

Here are few important thing that you must do.

– Have strong password
– Allow registration only from trusted networks.
– Put a limit on extensions on the type of calls they can make.
– Put a limit of extension no of calls or number of minutes they can make in a day.
– Running automated scripts to monitor the activity on your system on all the extensions.

This link has nice tips.
http://blogs.digium.com/2009/03/28/sip-security/
Here I copy pasted important steps.

1) Don’t accept SIP authentication requests from all IP addresses. Use the “permit=” and “deny=” lines in sip.conf to only allow a reasonable subset of IP addresess to reach each listed extension/user in your sip.conf file.  Even if you accept inbound calls from “anywhere” (via [default]) don’t let those users reach authenticated elements!
2) Set “alwaysauthreject=yes” in your sip.conf file. This option has been around for a while (since 1.2?) but the default is “no”, which allows extension information leakage.  Setting this to “yes” will reject bad authentication requests on valid usernames with the same rejection information as with invalid usernames, denying remote attackers the ability to detect existing extensions with brute-force guessing attacks.
3) Use STRONG passwords for SIP entities. This is probably the most important step you can take.  Don’t just concatenate two words together and suffix it with “1″ – if you’ve seen how sophisticated the tools are that guess passwords, you’d understand that trivial obfuscation like that is a minor hinderance to a modern CPU.  Use symbols, numbers, and a mix of upper and lowercase letters at least 12 digits long.
4) Block your AMI manager ports. Use “permit=” and “deny=” lines in manager.conf to reduce inbound connections to known hosts only.  Use strong passwords here, again at least 12 characters with a complex mix of symbols, numbers, and letters.
5) Allow only one or two calls at a time per SIP entity, where possible. At the worst, limiting your exposure to toll fraud is a wise thing to do.  This also limits your exposure when legitimate password holders on your system lose control of their passphrase – writing it on the bottom of the SIP phone, for instance, which I’ve seen.
6) Make your SIP usernames different than your extensions. While it is convenient to have extension “1234″ map to SIP entry “1234″ which is also SIP user “1234″, this is an easy target for attackers to guess SIP authentication names.  Use the MAC address of the device, or some sort of combination of a common phrase + extension MD5 hash (example: from a shell prompt, try “md5 -s ThePassword5000″)
7) Ensure your [default] context is secure.  Don’t allow unauthenticated callers to reach any contexts that allow toll calls.  Permit only a limited number of active calls through your default context (use the “GROUP” function as a counter.)  Prohibit unauthenticated calls entirely (if you don’t want them) by setting “allowguest=no” in the [general] part of sip.conf.
I hope this will keep you away from some troubles.
-Jai