Just in case anyone is using Blockhosts
(http://www.aczoom.com/blockhosts/) with their Linux servers and
Asterisk here are the rules necessary to block invalid users:
"asterisk-NoPeer":
r'Registration from .* failed for \'{HOST_IP}\' - No matching peer
found',
"asterisk-NoAuth":
r'Registration from .* failed for \'{HOST_IP}\' - Username/auth name
mismatch',
"asterisk-NoPass":
r'Registration from .* failed for \'{HOST_IP}\' - Wrong password',
Just add these rules to your /etc/blockhosts.conf file.作者: 角色 時間: 2010-9-1 19:55
Thank ckleea for providing the information to us!
YH作者: ckleea 時間: 2010-9-1 20:56
I am trying to use this setting on my centos-asterisk作者: 角色 時間: 2010-9-1 22:33
本帖最後由 角色 於 2010-9-2 09:23 編輯
You meant your Asterisk always be attached by hackers?
YH作者: kermit 時間: 2010-9-2 03:53
There are a lot of hacker want to enum my extension. Everyday, I check my log file, I can see those information.作者: 角色 時間: 2010-9-2 06:58
That is why you hve to make your password very very long to get rid of those attacks.
YH作者: ckleea 時間: 2010-9-2 08:26
But the log will tell you which ip attacks your server. When you put the ips in the blacklist of hosts.allow. It will drops their connection.作者: bubblestar 時間: 2010-9-2 09:19
I am certain that hackers will change thier IPs frequently to invade their target system, not necessary using their own IP but making use of other innocent IP ranges on purpose resulting in DoS (Denial of Service).
On the other hand, your log blacklist may become larger and larger someday later that will also create certain degree of burgen on your own system.
Anyhow, doing something is better than doing nothing, at least in this stage. 作者: kermit 時間: 2010-9-2 13:53
After setting "alwaysauthreject=yes allowguest=no " each ip can try two extension only.作者: bubblestar 時間: 2010-9-2 15:35
Cool ! Thanks for the information. It sounds very simple to set up. Hope it is effective.作者: bubblestar 時間: 2010-9-2 15:43
Taking IP-01 as an example, I found its "älwaysauthreject=yes" already a default. It means that what I need to do is to change "ällowguest=no".作者: 角色 時間: 2010-9-6 08:56
You may elimilate the chances of being hacked by setting
alwaysauthreject=yes
複製代碼
in sip.conf. For details, you may take a look at the following website:
A new attack from 64.156.192.26作者: 電腦超人 時間: 2010-10-4 23:14
再來一個...
119.70.40.102
inetnum: 119.64.0.0 - 119.71.255.255
netname: Xpeed
descr: LG Powercomm
descr: 537-18,Bangbaedong,Seochogu, Seoul
descr: *******************************************
descr: Allocated to KRNIC Member.
descr: If you would like to find assignment
descr: information in detail please refer to
descr: the KRNIC Whois Database at:
descr: http://whois.nic.or.kr/english/index.htm
descr: *******************************************作者: 電腦超人 時間: 2010-10-5 03:13
再來...
119.188.7.146
inetnum: 119.176.0.0 - 119.191.255.255
netname: UNICOM-SD
descr: China Unicom Shandong Province Network
descr: China Unicom
country: CN
admin-c: CH1302-AP
tech-c: XZ14-AP
remarks: service provider
status: ALLOCATED PORTABLE
mnt-by: APNIC-HM
mnt-lower: MAINT-CNCGROUP
mnt-lower: MAINT-CNCGROUP-SD
mnt-routes: MAINT-CNCGROUP-RR
remarks: -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+
remarks: This object can only be updated by APNIC hostmasters.
remarks: To update this object, please contact APNIC
remarks: hostmasters and include your organisation's account
remarks: name in the subject line.
remarks: -+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+
changed: hm-changed@apnic.net 20080225
changed: hm-changed@apnic.net 20090508
changed: hm-changed@apnic.net 20100927
source: APNIC
IP Address 86.110.67.42
Host srv-bg07.sicor.net
Location DE DE, Germany
City Grönenbach, 02 -
Organization SICOR GmbH
ISP Trusted Network
AS Number AS21385 Trusted Network GmbH
Latitude 47°88'33" North
Longitude 10°21'67" East
Distance 1174.47 km (729.78 miles)作者: 角色 時間: 2010-10-20 07:44
"The Asterisk source contains a very important file named SECURITY, which outlines several steps you should take to keep your Asterisk systemsecure. It is vitally important that you read and understand this file. If you ignore the security precautions outlined there, you may end up allowing anyone and everyone to make long-distance or toll calls at your expense!"
Create a user account that will be used to run Asterisk: adduser --system --no-create-home --home /var/lib/asterisk --shell /bin/false asterisk
vim /etc/init.d/asterisk
#Uncomment those lines
AST_USER="asterisk"
AST_GROUP="asterisk"
mkdir /var/run/asterisk
chown asterisk.asterisk /var/run/asterisk
vim /etc/asterisk/asterisk.conf
astrundir => /var/run/asterisk
chown -R asterisk.asterisk /etc/asterisk
chown -R asterisk.asterisk /usr/lib/asterisk
chown -R asterisk.asterisk /var/log/asterisk
chown -R asterisk.asterisk /var/spool/asterisk
chown -R asterisk.asterisk /var/lib/asterisk
chown -R asterisk.asterisk /dev/zap/pseudo
Launch Asterisk in debug mode to check that it loads OK: