Hi All,
Lately (almost everyday), I have seen SIP registration attempt on our Asterisk SIP servers. The following are asterisk message log.
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9973"<sip:
9973@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9975"<sip:
9975@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9979"<sip:
9979@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9980"<sip:
9980@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9983"<sip:
9983@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9984"<sip:
9984@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9985"<sip:
9985@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9986"<sip:
9986@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9987"<sip:
9987@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9988"<sip:
9988@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9989"<sip:
9989@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9990"<sip:
9990@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9991"<sip:
9991@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9992"<sip:
9992@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9993"<sip:
9993@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9994"<sip:
9994@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9995"<sip:
9995@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9996"<sip:
9996@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"9999"<sip:
9999@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
Oct 17 23:52:29 NOTICE[4570] chan_sip.c: Registration from '"10000"<sip:
10000@XX.99.71.ZZ>' failed for '203.86.167.220' - Username/auth name mismatch
The rouge hacker are simply using scripts to attempt SIP account registration from 1-10000 and this blog down the asterisk trying to respond to a burst of hundreds of attempt in a seconds.
The filter #8 was in place to block attempt from sip_blacklist. Filter #9 attempt block any UDP packet destined for port 5060-5099 with a 1secs. burst of 25 attempt, by the destination address. The last filter #10 will add rogue hacker to the sip_blacklist. Please note that I intend to use the filter to block sip registration on all asterisk server behind the Mikrotik router. Did I screw up by using the INPUT and OUTPUT chain, as the Rule 8-10 does not work.
8 ;;; Drop SIP brute force registration
chain=input action=drop protocol=udp src-address-list=sip_blacklist dst-port=5060-5099
9 chain=output action=accept protocol=udp dst-port=5060-5099 dst-limit=1,25,dst-address/1m
10 chain=output action=add-dst-to-address-list protocol=udp address-list=sip_blacklist address-list-timeout=4w2d dst-port=5060-5099
I would very much appreciate if you could comment and point me to the right syntax to implement SIP registration hack attempt.
Thank you very much and Have a Nice day all