Matthew,<div><br></div><div>Once the source is banned, the REGISTER requests are not forwarded internally to the database, so there are zero chances of brute forcing anything. The scanner might as well guess and never know; Anyhow, sometimes sending back a false 200 OK can help stop the flooding if it the "unfriendly" scanner is in stateless mode, wasting your bandwidth or cluttering your monitoring. They'll get a useless password and your attack should drop.</div>

<div><br></div><div>Best,</div><div><br></div><div><span style="font-size:13px;color:rgb(80,0,80);font-family:Arial"><div style="color:rgb(119,119,119)"><font>Lorenzo Mangani</font></div><div style="font-size:x-small;color:rgb(119,119,119)">

<font size="1"><a href="http://QXIP.NET">QXIP.NET</a></font></div></span></div><div><br><div class="gmail_quote">On Mon, May 7, 2012 at 9:05 PM, Matthew Ogden <span dir="ltr"><<a href="mailto:matthew@tenacit.net" target="_blank">matthew@tenacit.net</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, so if I understand this correctly then,<br>
<br>
You have your defaults at 20 times per 2 seconds. But, at this point, pike<br>
is not banning them from trying to connect, it is simply ignoring trying to<br>
authenticate them, is that correct?<br>
<br>
In other words, I will continue to see their traffic hitting my network<br>
card, in and out, and entries in ngrep? But they are very unlikely to<br>
succeed in brute forcing a password? (Or perhaps I have misunderstood this)<br>
<br>
As so:<br>
(Friendly scanner indeed!)<br>
<br>
U 2012/05/07 20:02:08.715659 <a href="http://213.189.34.21:5341" target="_blank">213.189.34.21:5341</a> -> MY_SERVER_IP:5060<br>
REGISTER sip:MY_SERVER_IP SIP/2.0'<br>
Via: SIP/2.0/UDP 213.189.34.21:5341;branch=z9hG4bK-285169266;rport'<br>
Content-Length: 0'<br>
From: "102" <sip:102@MY_SERVER_IP>'<br>
Accept: application/sdp'<br>
User-Agent: friendly-scanner'<br>
To: "102" <sip:102@MY_SERVER_IP>'<br>
Contact: <a href="mailto:sip%3A123@1.1.1.1">sip:123@1.1.1.1</a>'<br>
CSeq: 1 REGISTER'<br>
Call-ID: 828443369'<br>
Max-Forwards: 70'<br>
'<br>
<br>
#<br>
U 2012/05/07 20:02:08.715727 MY_SERVER_IP:5060 -> <a href="http://213.189.34.21:5341" target="_blank">213.189.34.21:5341</a><br>
SIP/2.0 100 Trying'<br>
Via: SIP/2.0/UDP 213.189.34.21:5341;branch=z9hG4bK-285169266;rport=5341'<br>
From: "102" <sip:102@MY_SERVER_IP>'<br>
To: "102" <sip:102@MY_SERVER_IP>'<br>
CSeq: 1 REGISTER'<br>
Call-ID: 828443369'<br>
Server: Sipwise NGCP LB 2.X'<br>
Content-Length: 0'<br>
'<br>
<br>
#<br>
U 2012/05/07 20:02:08.728398 <a href="http://213.189.34.21:5341" target="_blank">213.189.34.21:5341</a> -> MY_SERVER_IP:5060<br>
REGISTER sip:MY_SERVER_IP SIP/2.0'<br>
Via: SIP/2.0/UDP 213.189.34.21:5341;branch=z9hG4bK-1723630567;rport'<br>
Content-Length: 0'<br>
From: "102" <sip:102@MY_SERVER_IP>'<br>
Accept: application/sdp'<br>
User-Agent: friendly-scanner'<br>
To: "102" <sip:102@MY_SERVER_IP>'<br>
Contact: <a href="mailto:sip%3A123@1.1.1.1">sip:123@1.1.1.1</a>'<br>
CSeq: 1 REGISTER'<br>
Call-ID: <a href="tel:4175934776" value="+14175934776">4175934776</a>'<br>
Max-Forwards: 70'<br>
'<br>
<br>
#<br>
U 2012/05/07 20:02:08.728478 MY_SERVER_IP:5060 -> <a href="http://213.189.34.21:5341" target="_blank">213.189.34.21:5341</a><br>
SIP/2.0 100 Trying'<br>
Via: SIP/2.0/UDP 213.189.34.21:5341;branch=z9hG4bK-1723630567;rport=5341'<br>
From: "102" <sip:102@MY_SERVER_IP>'<br>
To: "102" <sip:102@MY_SERVER_IP>'<br>
CSeq: 1 REGISTER'<br>
Call-ID: <a href="tel:4175934776" value="+14175934776">4175934776</a>'<br>
Server: Sipwise NGCP LB 2.X'<br>
Content-Length: 0'<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:spce-user-bounces@lists.sipwise.com">spce-user-bounces@lists.sipwise.com</a><br>
[mailto:<a href="mailto:spce-user-bounces@lists.sipwise.com">spce-user-bounces@lists.sipwise.com</a>] On Behalf Of Andreas Granig<br>
Sent: 07 May 2012 08:46 PM<br>
To: <a href="mailto:spce-user@lists.sipwise.com">spce-user@lists.sipwise.com</a><br>
Subject: Re: [Spce-user] autoban or fail2ban<br>
<br>
Hi,<br>
<br>
On 05/07/2012 08:35 PM, Jon Bonilla (Manwe) wrote:<br>
> The spce has SIP attack protection against DOS and DDOS attacks.<br>
><br>
> If you're talking about ssh or similar you should use iptables. Please<br>
> check the security chapter of the handbook.<br>
<br>
To make it clear, flood traffic above a certain threshold is blocked in<br>
user-space on the load-balancer. You can check the blocked ips with the<br>
following command:<br>
<br>
ngcp-sercmd lb htable.dump ipban<br>
<br>
Every time an IP gets into this blacklist, a warning is logged in<br>
kamailio-lb.log, using this kamailio config line:<br>
<br>
xlog("L_WARN", "IP '$var(banip)' is blocked and banned - M=$rm R=$ru F=$fu<br>
T=$tu IP=$pr:$si:$sp ID=$ci\n");<br>
<br>
Sometimes it makes sense to block the traffic on kernel level already to<br>
keep the receive queue clean, so fail2ban could make sense here. See the<br>
section "Fail2Ban" in<br>
<a href="http://kb.asipto.com/kamailio:usage:k31-sip-scanning-attack" target="_blank">http://kb.asipto.com/kamailio:usage:k31-sip-scanning-attack</a> (the rest is<br>
already implemented in the SPCE), just adapt the "failregex" to the log<br>
message shown above.<br>
<br>
Andreas<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Spce-user mailing list<br>
<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a><br>
<a href="http://lists.sipwise.com/listinfo/spce-user" target="_blank">http://lists.sipwise.com/listinfo/spce-user</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:rgb(80,0,80);font-family:Arial"><div style="color:rgb(119,119,119)">

<font><span style="font-family:Arial;color:rgb(119,119,119)"><br></span></font></div><div style="color:rgb(119,119,119)"><br></div></span></span><br>
</div>